KVM (virt-manager) take a snapshot of qcow2 disk.

Take A Snapshot

 To list a kvm vm on Linux based server [VM ID], more info

virsh list 

If your KVM guests are now running with Qcow2 disk images, you can take an internal snapshot of the guest with the following command:

virsh snapshot-create [VM ID]  

Alternatively, you can create a file with the following contents

<domainsnapshot>
    <name>Name for the snapshot</name>
    <description>Description for the snapshot</description>
</domainsnapshot>

Then pass it to the snapshotting command.

virsh snapshot-create [VM ID] [filepath]  

You can take snapshots of guests whilst they are running. Whilst the snapshot is being taken, the guest will be "paused". The "state" of the guest is also saved.

List Snapshots
One can list a virtual machine's snapshots with

sudo virsh snapshot-list [VM ID]  

Which will output something like:

 Name                 Creation Time             State
————————————————————
 1422179589           2015-01-25 09:53:09 +0000 running

Restore Snapshot

If you want to "revert", "go to", or "restore" a previous snapshot, then execute the following command:

virsh snapshot-revert [VM ID] [Snapshot Name]  

Delete Snapshot

virsh snapshot-delete [VM ID] [Snapshot Name] 

Credits | Tips

Leave a Reply

Your email address will not be published. Required fields are marked *