Snapshots are not supported for running domains with 4 GB or more of RAM!

Problem:

Creating a snapshot for an KVM instance fails with the error message:

Snapshots are not supported for running domains with 4 GB or more of RAM!

Sicherungspunkte für laufende Domains mit 4 GB oder mehr RAM werden nicht unterstützt!

Workaround:

The qcow2 file format only has a 32bit counter for the size of the RAM image, which limits it to below 4 GiB minus some extra space for meta data.

The limit can only be worked around by implementing the saving of the state to a separate file by using virsh directly something like this:

virsh suspend $VM
mkdir /var/lib/libvirt/qemu/$VM
virsh save $VM /var/lib/libvirt/qemu/$VM/$SNAPSHOTNAME.save
virsh snapshot-create-as --disk-only $VM $SNAPSHOTNAME
virsh resume $VM
Mastodon