[libvirt-users] virsh blockcopy: doesn't seem to flatten the chain by default

Kashyap Chamarthy kchamart at redhat.com
Wed Jul 2 19:12:20 UTC 2014


Versions
--------

(Libvirt locally built from a recent git commit -ec7b922):

    $ rpm -q libvirt-daemon-kvm qemu-system-x86
    libvirt-daemon-kvm-1.2.6-1.fc20.x86_64
    qemu-system-x86-2.0.0-1.fc21.x86_64


Test
----

[All images are qcow2 files.]


We have this simple chain:

    base <- snap1

Let's quickly examine the contents of 'base' and 'snap1' images:

'base' has just a single file: foo

    $ guestfish --ro -a base.qcow2 
    [. . .]
    ><fs> ls /
    ><fs> run
    ><fs> mount /dev/sda1 /
    ><fs> ls /
    foo
    lost+found
    ><fs> quit

'snap1' has files: bar, baz, jazz

    $ guestfish --ro -a snap1.qcow2 
    [. . .]
    ><fs> run
    ><fs> mount /dev/sda1 /
    ><fs> ls /
    bar
    baz
    jazz
    lost+found
    ><fs> 

Now, let's do a live blockcopy (with a '--finish' to graecully finish
the mirroring):

    $ virsh blockcopy --domain testvm2 vda \
        /export/dst/copy.qcow2 \
        --wait --verbose --finish


Examine the contents of the above 'copy':

    $ guestfish --ro -a copy.qcow2 
    [. . .]
    ><fs> run
    ><fs> mount /dev/sda1 /
    ><fs> ls /
    bar
    baz
    jazz
    lost+found
    ><fs> quit

If I'm reading the man page of 'blockcopy' correctly, shouldn't it
'flatten' the entire chain, by also copying the contents of base into
copy.qcow2? i.e. the 'copy' should have files (including the file foo
from 'base': 

    foo, bar, baz, jazz


True or false?


PS: I've tested the cases of --pivot, --shallow and --reuse-external,
will post my notes about them on a wiki.

-- 
/kashyap




More information about the libvirt-users mailing list