This is an old revision of the document!
MAKE SURE TARGET VM STOPPED THAT CONTAINS THE VM IMAGE.
root@hotaru:/var/lib/libvirt/images# virsh list --inactive | fgrep nextcloud1.example.com - nextcloud1.example.com shut off
qemu-img snapshot -l nextcloud1.example.com.qcow2
if no snapshots found, result is empty.
qemu-img snapshot -c "Initial snapshot" nextcloud1.example.com.qcow2
list again.
root@hotaru:/var/lib/libvirt/images# qemu-img snapshot -l nextcloud1.example.com.qcow2 Snapshot list: ID TAG VM SIZE DATE VM CLOCK 1 Initial snapshot 0 2020-01-06 21:53:18 00:00:00.000
snapshot was created successfully.
root@hotaru:~# qemu-img snapshot -l /var/lib/libvirt/images/nextcloud1.example.com.qcow2 Snapshot list: ID TAG VM SIZE DATE VM CLOCK 1 Initial snapshot 0 2020-01-06 21:53:18 00:00:00.000 root@hotaru:~# qemu-img snapshot -a 1 /var/lib/libvirt/images/nextcloud1.example.com.qcow2
root@hotaru:~# qemu-img snapshot -l /var/lib/libvirt/images/nextcloud1.example.com.qcow2 Snapshot list: ID TAG VM SIZE DATE VM CLOCK 1 Initial snapshot 0 2020-01-06 21:53:18 00:00:00.000 root@hotaru:~# qemu-img snapshot -c "virt-sysprep" /var/lib/libvirt/images/nextcloud1.example.com.qcow2 root@hotaru:~# qemu-img snapshot -l /var/lib/libvirt/images/nextcloud1.example.com.qcow2 Snapshot list: ID TAG VM SIZE DATE VM CLOCK 1 Initial snapshot 0 2020-01-06 21:53:18 00:00:00.000 2 virt-sysprep 0 2020-01-07 07:05:09 00:00:00.000 root@hotaru:~# qemu-img snapshot -d 1 /var/lib/libvirt/images/nextcloud1.example.com.qcow2 root@hotaru:~# qemu-img snapshot -l /var/lib/libvirt/images/nextcloud1.example.com.qcow2 Snapshot list: ID TAG VM SIZE DATE VM CLOCK 2 virt-sysprep 0 2020-01-07 07:05:09 00:00:00.000
qemu-img resize nextcloud1.example.com.qcow2 20G
root@hotaru:/var/lib/libvirt/images# qemu-img resize nextcloud1.example.com.qcow2 20G qemu-img: Can't resize an image which has snapshots