Using virt-sysprep and virt-customize with LXC containers: is it possible?
I'm setting up a system to run LXC containers with ZFS on Linux (Ubuntu 14.04). I intend to set up a base image which I'd like to clone to create other containers from. virt-sysprep and virt-customize seem ideal for the task: I obviously could mount and work with the rootfs from each container directly, but the libguestfs tools have a bunch of pre-existing recipes that would surely be much better than what I'd come up with on my own. Unfortunately, I can't seem to find any way to tell the tools to work directly on an already mounted directory (from a ZFS subvolume) instead of a disk image. Am I missing something or is this currently not possible? Thanks in advance, Daniel Miranda
On Tue, Aug 19, 2014 at 01:11:02PM -0300, Daniel Miranda wrote:
I'm setting up a system to run LXC containers with ZFS on Linux (Ubuntu 14.04). I intend to set up a base image which I'd like to clone to create other containers from. virt-sysprep and virt-customize seem ideal for the task: I obviously could mount and work with the rootfs from each container directly, but the libguestfs tools have a bunch of pre-existing recipes that would surely be much better than what I'd come up with on my own.
Unfortunately, I can't seem to find any way to tell the tools to work directly on an already mounted directory (from a ZFS subvolume) instead of a disk image.
Am I missing something or is this currently not possible?
This was actually a feature of the original virt-sysprep (1.14). However we removed it in a more recent version (1.16 IIRC). So no, virt-sysprep etc only work on disk images, not on mounted filesystems. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
That's unfortunate. Is there any particular reason it was removed? I think having a 'directory' format, or even a 'mount' one where libguestfs handles mounting/unmounting would be nice. Thanks for the help nevertheless, Daniel On Tue, Aug 19, 2014 at 3:08 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Tue, Aug 19, 2014 at 01:11:02PM -0300, Daniel Miranda wrote:
I'm setting up a system to run LXC containers with ZFS on Linux (Ubuntu 14.04). I intend to set up a base image which I'd like to clone to create other containers from. virt-sysprep and virt-customize seem ideal for the task: I obviously could mount and work with the rootfs from each container directly, but the libguestfs tools have a bunch of pre-existing recipes that would surely be much better than what I'd come up with on my own.
Unfortunately, I can't seem to find any way to tell the tools to work directly on an already mounted directory (from a ZFS subvolume) instead of a disk image.
Am I missing something or is this currently not possible?
This was actually a feature of the original virt-sysprep (1.14). However we removed it in a more recent version (1.16 IIRC). So no, virt-sysprep etc only work on disk images, not on mounted filesystems.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
On Tue, Aug 19, 2014 at 10:26:56PM -0300, Daniel Miranda wrote:
That's unfortunate. Is there any particular reason it was removed?
The specific reason is that using FUSE to access libguestfs was slow and allows less control over things like permissions.
I think having a 'directory' format, or even a 'mount' one where libguestfs handles mounting/unmounting would be nice.
It'd be nice, but someone has to write it and it's not simple to implement. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (2)
-
Daniel Miranda -
Richard W.M. Jones