This notes is based on an IRC conversation with Eric Blake, to have
efficient non-shared storage live migration. Thought I'd post my notes
here before I forget. Please review and spot if there are any
inaccuracies.
Procedure
---------
(1) Starting from disk A, create a snapshot A <- A':
$ virsh snapshot-create-as \
--domain f20vm snap1 snap1-desc \
--diskspec hda,file=/export/vmimages/A'.qcow2 \
--disk-only --atomic
(2) Background copy of A to B:
$ virsh blockcopy \
--domain vm1 vda /export/vmimages/B.qcow2 \
--wait --verbose --shallow \
--finish
(3) Create an empty B' with backing file B:
$ qemu-img create -f qcow2 -b B.qcow2 \
-o backing_fmt=qcow2 B'.qcow2
[or]
$ virsh vol-create-as default B'.qcow2 1G \
--format qcow2 \
--backing-vol B.qcow2 --backing-vol-format qcow2
(4) Do a shallow blockcopy of A' to B':
$ virsh blockcopy \
--domain vm1 vda /export/vmimages/B'.qcow2 \
--wait --verbose --shallow \
--finish
(5) Then live shallow commit of B:
$ virsh blockcommit \
--domain f20vm vda \
--wait --verbose --shallow \
--pivot --active --finish
Block Commit: [100 %]
Successfully pivoted
--
/kashyap