[libvirt-users] Problem about Disk Dize of Destination and Source File after Do Blockcopy

shyu shyu at redhat.com
Tue Jul 22 04:01:17 UTC 2014


Hi There,

There is a case I met about the destination file's disk size after do 
blockcopy


Details as below:

Env:

# rpm -q libvirt qemu-kvm-rhev
libvirt-1.1.1-29.el7.x86_64
qemu-kvm-rhev-1.5.3-60.el7ev_0.2.x86_64

1. Check source file
# qemu-img info /var/lib/libvirt/images/rhel6.img
image: /var/lib/libvirt/images/rhel6.img
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 1.2G
cluster_size: 65536
Format specific information:
     compat: 1.1
     lazy refcounts: false

# ll -lash /var/lib/libvirt/images/rhel6.img
1.2G -rw-r--r--. 1 qemu qemu 1.2G Jul 22 11:04 
/var/lib/libvirt/images/rhel6.img

Here: Disk Size is "1.2G"

2. Do blockcopy
# virsh domblklist rhel6
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/rhel6.img

# time virsh blockcopy rhel6 vda /var/lib/libvirt/images/copy.img --wait 
--verbose
Block Copy: [100 %]
Now in mirroring phase

real    0m21.285s
user    0m0.038s
sys    0m0.018s

3. Check destination file's disk size

# qemu-img info /var/lib/libvirt/images/copy.img
image: /var/lib/libvirt/images/copy.img
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 2.0G
cluster_size: 65536
Format specific information:
     compat: 1.1
     lazy refcounts: false

# ll -lash /var/lib/libvirt/images/copy.img
2.1G -rw-------. 1 qemu qemu 1.2G Jul 22 11:10 
/var/lib/libvirt/images/copy.img

Here: Disk Size is "2.0G"


So my question is why the "disk size" is different between source file 
and destination file ? (Actually, the destination always change after I 
try many times, sometime it is same size as source, sometimes it is 
lager than source.)

4. Do --pivot

After --pivot, the disk size is same size as after blockcopy



-- 
Regards
shyu




More information about the libvirt-users mailing list