[virt-tools-list] Help with live migration (w/o shared storage)

Gabriel L. Somlo gsomlo at gmail.com
Tue Feb 7 17:19:39 UTC 2012

On Mon, Feb 06, 2012 at 03:08:09PM -0700, Eric Blake wrote:
> On 02/06/2012 02:59 PM, Gabriel L. Somlo wrote:
> > 
> > The error message I get is:
> > 
> > 	error: Unable to allow access for disk path
> > 	/var/lib/libvirt/images/my_test_vm.img: No such file or directory
> That means that on the destination, you have to pre-create
> /var/lib/libvirt/images/my_test_vm.img prior to calling virsh migrate

OK, so before issuing the virsh migrate command, I created an empty
file on the destination:

        touch /var/lib/libvirt/images/my_test_vm.img

That didn't work -- on the destination, I got the following error in

        qemu-kvm: Error getting length of block device
        qemu: warning: error while loading state section id 1
        load of migration failed
        2012-02-07 15:48:44.064+0000: shutting down

My next attempt was to create an empty file of the *same size* as on
the source:

        dd if=/dev/zero of=my_test_vm.img bs=1 count=0 seek=32G

I then used the following (slightly modified) command line:

        virsh -c qemu:///system migrate --live --copy-storage-all \
              --persistent --undefinesource my_test_vm \

This seems to work quite nicely -- thanks for pointing me in the right
direction !

> Yes, libvirt should be taught how to make
> --copy-storage-all nicer to use, and pre-create files on users behalf,
> but no one has submitted a patch for that so far.

Thanks again,

More information about the virt-tools-list mailing list