summaryrefslogtreecommitdiff
path: root/doc/todo
diff options
context:
space:
mode:
Diffstat (limited to 'doc/todo')
-rw-r--r--doc/todo/support_for_libvirt_KVM_VMs.mdwn27
-rw-r--r--doc/todo/support_for_libvirt_KVM_VMs/comment_1_c73740e45387fe817280b55bb0e32c12._comment29
2 files changed, 56 insertions, 0 deletions
diff --git a/doc/todo/support_for_libvirt_KVM_VMs.mdwn b/doc/todo/support_for_libvirt_KVM_VMs.mdwn
new file mode 100644
index 00000000..529cf721
--- /dev/null
+++ b/doc/todo/support_for_libvirt_KVM_VMs.mdwn
@@ -0,0 +1,27 @@
+I've been thinking about how to add support for libvirt VMs to
+propellor. TTBOMK setting up the VMs is a matter of creating some
+files in /etc, so that part is straightforward; might not want very
+much abstraction in propellor at all. The interesting part is
+creating the corresponding disk images.
+
+I first thought that I could just extend propellor's existing support
+for generating disk images by debootstrapping in a chroot and then
+generating an image based on that chroot. It would just be a matter
+of using `.qcow2` images rather than `.img`. But the problem with
+this is that once the VM is in use, propellor should not just be
+overwriting the `.qcow2` file. So something different is needed.
+
+What I have in mind is a conditional property that works something
+like this:
+
+ ifM ( doesFileExist "/path/to/image.qcow2"
+ , debootstrapTheChrootAndPackIntoQcow2File theHost
+ , conducts [theHost] `requires` KVM.booted theHost
+ )
+
+where `theHost :: Host` and either the user's libvirt config or some
+property somewhere ensures it can be SSHed to from localhost.
+
+Does this seem like the right approach?
+
+--spwhitton
diff --git a/doc/todo/support_for_libvirt_KVM_VMs/comment_1_c73740e45387fe817280b55bb0e32c12._comment b/doc/todo/support_for_libvirt_KVM_VMs/comment_1_c73740e45387fe817280b55bb0e32c12._comment
new file mode 100644
index 00000000..24ad2c45
--- /dev/null
+++ b/doc/todo/support_for_libvirt_KVM_VMs/comment_1_c73740e45387fe817280b55bb0e32c12._comment
@@ -0,0 +1,29 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2018-07-20T15:54:17Z"
+ content="""
+That seems like a good plan to me, and nice use of the Conductor module.
+
+Of course, `conducts` is a Property, not an IO action and presumably
+so is `debootstrapTheChrootAndPackIntoQcow2File`,
+so to check if the disk image exists, you'll instead
+want to use the `check` combinator. Something like:
+
+ & check (doesFileExist "/path/to/image.qcow2")
+ debootstrapTheChrootAndPackIntoQcow2File theHost
+ & check (not <$> doesFileExist "/path/to/image.qcow2")
+ conducts [theHost] `requires` KVM.booted theHost
+
+Perhaps the redundancy in that can be reduced with a new combinator
+that chooses which action to run.
+
+You may want to also delete the chroot once the disk image is built.
+
+There could also be a minor gotcha with the Conductor module trying to
+conduct the VM before it's gotten set up yet, at worst this would make
+propellor display a warning.
+
+Let me know if you need help with this,
+although I will next be available on July 30th.
+"""]]