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

Ján ONDREJ (SAL) ondrejj at salstar.sk
Sun Apr 12 06:40:30 UTC 2009

On Sat, Apr 11, 2009 at 11:41:14PM +0100, Richard W.M. Jones wrote:
> Make sure you try out the 0.8 version I uploaded earlier today.  Lots
> of bugs fixed ...
> http://et.redhat.com/~rjones/libguestfs/files/
> ... and the API extended further, eg. you can now partition, create
> LVM bits, and filesystems:
> http://et.redhat.com/~rjones/libguestfs/guestfs.3.html

I just looked against documentation. Can you build this for Fedora 10 i386?
Trying to rebuild your src.rpm in mock, but there an unmet dependencies.

> > 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.

Thanks. It will help my project.

> > 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.

Yes, I know.

Making a backup of partition for example with qemu-img, when partition is an
read-only snapshot of a fully running filesystem can be problematic.
qemu-img (or other tool) can completelly damage newly created partition.

My project has several usages. There are commands like:
  backup VM virt_disk
which can transfer whole virtal disk image to another machine using dd, or
  rspart VM virt_disk partition#
which can transfer one partitin using rsync (currently partitions are
mounted on both machines and then an rsync can transfer partial data).

What need to be finished (rewritten) is rsdisk, rsync completelly disk image
or fsbackup (dump only partition content and restore it).

This script can be used in 2 cases:
  1. make online backups, when virtual server is running. There can be used
     only these scripts, which can copy images in a safe way (for example
     qemu-img can't be used, but dd or mounting+rsync can give good backups).
  2. when an primary server fails or need to be turned off, I need to move
     my machines from one server to another. I have no disk arrays yet, so
     I have to move partitions over network. This need to be done when
     server is stopped, so moving only allocadet blocks or only changes
     can save me lots of time. Filesystems are in consistent state, so
     I don't need to care about their condition.

If anybody interested to look at sources, they can be found here:
Just documentation is not ready yet.

> > 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.

Not exactly. In these examples there are 2 things backed up:

1. read-only disk image snapshot (using for example lvcreate -s)
2. virtual machine memory and status (using xm save or anything else)

This makes consistency to be consistent at SQL level, all transactions will
finish when virtual machine will be restored on backup server.
Then in most situations server shuld be restarted to reset all network
connections and to move it's clock.

Just I think it's not possible with KVM yet, because savevm will stop my
machine and then I need to restore it, which makes an some seconds long


More information about the Fedora-virt mailing list