|
From: | Fangge Jin |
Subject: | Re: Is it normal to get bigger qcow2 image after blockcopy? |
Date: | Fri, 3 Nov 2023 09:23:46 +0800 |
Hi guys๐ย ย โRecently, I found that the disk size of qcow2 image get bigger(from 6.16G to 8G in my test) after blockcopy.๐ย ย โ๐ย ย โ
I'm not sure whether this is normal or not. Please help toย check. Thanks.๐ย ย โ๐ย ย โBR,๐ย ย โFangge Jin๐ย ย โBefore blockcopy, check source image:๐ย ย โย # qemu-img info -U /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2๐ย ย โย image: /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2๐ย ย โ
ย file format: qcow2๐ย ย โ
ย virtual size: 10 GiB (10737418240 bytes)๐ย ย โ
ย disk size: 6.16 GiB๐ย ย โ
ย cluster_size: 65536๐ย ย โ
ย Format specific information:๐ย ย โ
ย ย ย compat: 1.1๐ย ย โ
ย ย ย compression type: zlib๐ย ย โ
ย ย ย lazy refcounts: false๐ย ย โ
ย ย ย refcount bits: 16๐ย ย โ
ย ย ย corrupt: false๐ย ย โ
ย ย ย extended l2: false๐ย ย โ
ย Child node '/file':๐ย ย โ
ย ย ย filename: /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2๐ย ย โ
ย ย ย protocol type: file๐ย ย โ
ย ย ย file length: 6.16 GiB (6614810624 bytes)๐ย ย โ
ย ย ย disk size: 6.16 GiB๐ย ย โ
ย ย ย Format specific information:๐ย ย โ
ย ย ย ย ย extent size hint: 1048576๐ย ย โAfter blockcopy, check target image:๐ย ย โย # qemu-img info -U /var/lib/avocado/data/avocado-vt/images/copy.qcow2 ๐ย ย โ
ย image: /var/lib/avocado/data/avocado-vt/images/copy.qcow2๐ย ย โ
ย file format: qcow2๐ย ย โ
ย virtual size: 10 GiB (10737418240 bytes)๐ย ย โ
ย disk size: 6.64 GiB๐ย ย โ
ย cluster_size: 65536๐ย ย โ
ย Format specific information:๐ย ย โ
ย ย ย compat: 1.1๐ย ย โ
ย ย ย compression type: zlib๐ย ย โ
ย ย ย lazy refcounts: false๐ย ย โ
ย ย ย refcount bits: 16๐ย ย โ
ย ย ย corrupt: false๐ย ย โ
ย ย ย extended l2: false๐ย ย โ
ย Child node '/file':๐ย ย โ
ย ย ย filename: /var/lib/avocado/data/avocado-vt/images/copy.qcow2๐ย ย โ
ย ย ย protocol type: file๐ย ย โ
ย ย ย file length: 6.64 GiB (7126974464 bytes)๐ย ย โ
ย ย ย disk size: 6.64 GiB๐ย ย โGuest disk xml:๐ย ย โย ย <disk type='file' device='disk'>๐ย ย โ
ย ย ย <driver name='qemu' type='qcow2'/>๐ย ย โ
ย ย ย <source file='/var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2' index='2'/>๐ย ย โ
ย ย ย <backingStore/>๐ย ย โ
ย ย ย <target dev='vda' bus='virtio'/>๐ย ย โ
ย ย ย <alias name='virtio-disk0'/>๐ย ย โ
ย ย ย <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>๐ย ย โ
ย ย </disk>๐ย ย โQemu command line:๐ย ย โย -blockdev '{"driver":"file","filename":"/var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \๐ย ย โ
ย -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null}' \๐ย ย โ
ย -device '{"driver":"virtio-blk-pci","bus":"pci.4","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \๐ย ย โ
Qemu monitor command grepped from libvirt log:๐ย ย โ
ย {"execute":"blockdev-add","arguments":{"driver":"file","filename":"/var/lib/avocado/data/avocado-vt/images/copy.qcow2","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"},"id":"libvirt-429"}๐ย ย โ
ย {"execute":"blockdev-create","arguments":{"job-id":"create-libvirt-2-format","options":{"driver":"qcow2","file":"libvirt-2-storage","size":10737418240,"cluster-size":65536}},"id":"libvirt-430"}๐ย ย โ
ย {"execute":"job-dismiss","arguments":{"id":"create-libvirt-2-format"},"id":"libvirt-432"}๐ย ย โ
ย {"execute":"blockdev-add","arguments":{"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null},"id":"libvirt-433"}๐ย ย โ
ย {"execute":"blockdev-mirror","arguments":{"job-id":"copy-vda-libvirt-1-format","device":"libvirt-1-format","target":"libvirt-2-format","sync":"full","auto-finalize":true,"auto-dismiss":false},"id":"libvirt-434"}๐ย ย โ
ย {"execute":"transaction","arguments":{"actions":[{"type":"block-dirty-bitmap-add","data":{"node":"libvirt-2-format","name":"libvirt-tmp-activewrite","persistent":false,"disabled":false}}]},"id":"libvirt-443"}๐ย ย โ
ย {"execute":"job-complete","arguments":{"id":"copy-vda-libvirt-1-format"},"id":"libvirt-444"}๐ย ย โ
[Prev in Thread] | Current Thread | [Next in Thread] |