O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To revert the state of a KVM instance to an older state, from an existing snapshot, run the following:

  1. Connect to the KVM instance and create a new file:
root@kvm:~# virsh console kvm1Connected to domain kvm1Escape character is ^]root@debian:~# touch SNAPSHOTroot@debian:~#root@kvm:~#
  1. Create an internal snapshot of the virtual machine:
root@kvm:~# virsh snapshot-create kvm1Domain snapshot 1492802417 createdroot@kvm:~#
  1. Get information about the snapshot:
root@kvm:~# virsh snapshot-info kvm1 --snapshotname 1492802417Name: 1492802417Domain: kvm1Current: yesState: runningLocation: internalParent: 1492797458Children: 0Descendants: 0Metadata: yesroot@kvm:~#
  1. Connect back to the virtual machine and delete the file we created ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required