[fedora-virt] ANNOUNCE: Augeas support added to libguestfs

Richard W.M. Jones rjones at redhat.com
Sat Apr 11 22:41:14 UTC 2009

On Thu, Apr 09, 2009 at 07:57:59PM +0200, Ján ONDREJ (SAL) wrote:
> Looks nice.

Make sure you try out the 0.8 version I uploaded earlier today.  Lots
of bugs fixed ...


... and the API extended further, eg. you can now partition, create
LVM bits, and filesystems:


> Is it possible to implment something like qemu-img convert, which can dump
> whole filesystem to stdout and restore from it into liguestfs?

This is a tremendously good idea, and I'm not sure why I didn't think
of it because it's also something that people have asked me about with
virt-p2v (resizing existing partitions) :-)

So .. yes.

I think the way to implement is with several additional calls,
something like:

(1) export a partition "out"

(2) import a partition "in" (from stdin or some data source)

(3) access to the resize programs such as resize2fs and whatever the
equivalents are for other filesystems, so you can resize the
filesystem to fit the new partition correctly.

With combinations of (1) only, (2) + (3), or even (1) + (2) + (3) I
think we cover most things people would want to do.

The current protocol is message oriented, so it doesn't particularly
suit slurping arbitrarily large streams of data in or out, but the
protocol is also rather simple, so it wouldn't be too hard to extend
it to allow this.

> I am developing an application, which can make offline backups for virtual
> hosts. It now can use:
>   - dd to copy whole disk from disk to disk
>   - rsync partition content
> Now tryinng to implement:
>   - rsync disk devices, --copy-devices patch to rsync required BZ#494313
>   - copy image content only (qemu-img convert -c to stdout, but this is not
>     possible, so I have no solution now)

I guess you understand that libguestfs doesn't work (or at least, not
consistently) with live virtual machines.  You can certainly use
libguestfs to take read-only peeks at the live VM's disk image, but
the results you get won't necessarily be correct.  Although in the
virt-df case, which is similar, in practice the results are fine.

> My project can copy offline backups, which are snapshots of LVM volumes.
> Before snapshot "sync" is sent to virtual machine to save whole content.
> Planning to implment also something like suspend as before live migration
> to save an image fully consistent (disk image is an snapshot, but there is
> also an vm image, where caches and transactions are stored).
> This should be based on ideas from here:
>   http://lists.xensource.com/archives/html/xen-devel/2006-12/msg00685.html

As I understand this, issuing the lvcreate -s command makes the
filesystems consistent, and then they can be migrated out.
Unfortunately lvcreate -s only works for filesystems, not for anything
above the kernel/filesystem layer (ie. databases).  That may or may
not be a problem, depending on what applications are running.



Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.

More information about the Fedora-virt mailing list