[libvirt-users] virsh migrate --copy-storage-inc

Peter Krempa pkrempa at redhat.com
Mon Feb 11 13:31:52 UTC 2019

On Sun, Feb 10, 2019 at 12:11:42 +0100, Paul van der Vlis wrote:
> Hello,
> I use libvirt on machines without shared storage. My VM's have all one
> qcow2-disk, with the same name as the VM.
> When I want to migrate a VM, I check if there is an qcow2 image on the
> other host with that name. When that's not the case, I copy the image
> using rsync first. If the image excist, I don't do that, and I think
> that "--copy-storage-inc" will do it.

Note that using the 'inc' or incremental mode will copy only the data in
the top level image rather than a full copy. This means that you need to
pre-create empty qcow2 files which point to the correct backing store.

> But I don't know how intelligent "--copy-storage-inc" is. I use LVM
> inside the VM's, and it's possible that I have changed the size of a
> volume for example.

Non shared storage migration preserves the guest visible state.

> My questions:
> Is "--copy-storage-inc" intelligent enough for such tasks?

If used with --tunelled you can only use it if you wish to migrate ALL
disks in such a VM and need to pre-create the correct files.

If you wish to migrate only certain disks you need to stop using

> Is there documentation what is done during migration? Is it using rsync?

Normally (if --tunneled is not used) it's using blockdev-mirror or
drive-mirror in qemu over an NBD connection to destination.

In your case it's using the old storage migration protocol.

> Is it possible to make the migration process more verbose?

What do you mean by this? In case if --tunelled there's nothing we can
do though. Everything is done inside qemu.

> Is what I do a good way?
> With regards,
> Paul van der Vlis
> BTW: this is what I do, sometimes the lines are broken wrong:
> -----------
> # Rsync image when not on the other host:
> if test `ssh $other "if test -e /data/$vm.qcow2; then echo ja; else echo
> nee; fi"` = "nee"; then
>   echo "rsync..."
>   rsync /data/$vm.qcow2 $other://data/$vm.qcow2
>   if test $? = 0; then echo "gelukt"; else echo "niet gelukt"; exit; fi
> fi
> # migrate
> echo "migrate..."
> virsh migrate --live --p2p --tunnelled --copy-storage-inc --persistent

As said above this implies the old storage migration protocol which
transports the data in the migration stream. This stream is then
tunelled over the libvirt connection. This is very inefficient and also
uses the old storage migration protocol which is obsolete and qemu will
attempt to remove it in the future.

> --undefinesource --verbose $vm qemu+ssh://$other/system
> if test $? = 0; then echo "gelukt"; else echo "niet gelukt"; exit; fi
> -----------
> -- 
> Paul van der Vlis Linux systeembeheer Groningen
> https://www.vandervlis.nl/
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20190211/dea1d5f2/attachment.sig>

More information about the libvirt-users mailing list