qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it normal to get bigger qcow2 image after blockcopy?


From: Fangge Jin
Subject: Re: Is it normal to get bigger qcow2 image after blockcopy?
Date: Fri, 3 Nov 2023 09:23:46 +0800



On Thu, Nov 2, 2023 at 5:13โ€ฏPM Fangge Jin <fjin@redhat.com> wrote:
Hi guys๐Ÿ”„ย ย โ“

Recently, I found that the disk size of qcow2 image get bigger(from 6.16G to 8G in my test) after blockcopy.๐Ÿ”„ย ย โ“๐Ÿ”„ย ย โ“
Sorry, it should be "from 6.16G to 6.64G in my test"here
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"}๐Ÿ”„ย ย โ“

reply via email to

[Prev in Thread] Current Thread [Next in Thread]