How to convert qcow2 images to qcow3
What if you need to convert an older qcow2 (compat 0.10) image to qcow3 (compat 1.1)? The VM needs to be shut down for this to work, you can't do it live.
The following command converts the image without touching the old one and writes the image to a new file.
qemu-img convert -O qcow2 -o compat=1.1 disk-old.qcow2 disk.qcow2
The following command converts the image and modifies your existing image file. You should have a backup just in case.
qemu-img amend -o compat=1.1 disk.qcow2
Now you can start your VM again.
Before conversion:
[root@server]# qemu-img info disk.qcow2
image: disk.qcow2
file format: qcow2
virtual size: 100 GiB (107374182400 bytes)
disk size: 13.3 GiB
cluster_size: 65536
Format specific information:
compat: 0.10
compression type: zlib
refcount bits: 16
After Conversion:
[root@server]# qemu-img info disk.qcow2
image: disk.qcow2
file format: qcow2
virtual size: 100 GiB (107374182400 bytes)
disk size: 13.3 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false