Pcornel
Virtualization · KVM / QEMU

QCOW2

Cheat sheet · https://pcornel.dk/topic.php?topic=3795

Back to the Topic

Answer

Separate guest logical blocks from QCOW2 metadata/allocation and the host filesystem or storage backend. Backing-file chains add another dependency layer between guest writes and base data.

Remember

  • QCOW2 virtual size ≠ host allocated size.
  • Guest free space ≠ host filesystem/datastore free space.
  • Image file exists ≠ metadata/backing chain healthy.
  • Internal snapshot capability ≠ independent backup.

First checks

  • qemu-img info <disk.qcow2> — format and backing
  • qemu-img check <disk.qcow2> — consistency
  • qemu-img convert -O qcow2 -o preallocation=metadata src dst — optimise

Commands

virsh blockcommit

Verify in this order

qcow2 → QEMU block → guest

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

KVM / QEMU → QCOW2 reference map

BoundaryWhat to verifyEvidence limit
Definition/configExpected KVM / QEMU → QCOW2 definition or configuration is presentConfigured state does not prove runtime behavior
RuntimeRelevant KVM/QEMU/libvirt object or process is active without matching errorsRuntime state does not prove dependencies or guest outcome
DependencyHost CPU/memory, storage, network or device backend required by this path is healthyLocal success does not prove the next boundary
AcceptanceOriginal guest/application test succeeds after the change or observationRequired for end-to-end closure

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3795

Confirmation

Confirm action

Continue?