Create a VM snapshot and roll back to it
Create a snapshot of a virtual machine (VM) before risky changes: a guest OS update, a settings change. If the changes cause a failure, roll the VM back to the snapshot.
Before you begin
- You need the VDC admin role in the VDC (virtual data center) of this VM, or the Cluster master role. With the VDC user role, you can see snapshots, but you cannot create a snapshot or roll back to it.
- The VM is not being moved right now: while it has the Migrating or Sending status, there is no Add snapshot button.
- If the VDC has a snapshot quota, the quota is not used up. A quota of 0 forbids snapshots; without a quota, there is no limit — Set VDC quotas.
- For a rollback, the VM is stopped: the Status field shows Offline. To stop the VM, see Start, stop and restart a VM.
1. Create a snapshot
- In the left menu, select Virtual Data Centers → the VDC → Virtual Machines → the VM. The VM page opens.
- Click Add snapshot in the Snapshots section of the VM page. The Snapshot <number> form appears.
- Enter the snapshot name in the Name field, for example
before_update. Latin letters, digits and underscores are allowed. - Click Save snapshot. The button is available when the name is entered correctly.
You can take a snapshot of both a running and a stopped VM.
Check the result
The web interface shows the notification Snapshot <name> was successfully added. The snapshot appears in the Snapshots section with the Name, Date of creation and Size (GB) columns.
If the snapshot could not be created, the web interface shows a notification with the error text:
- VM is locked — another operation is in progress on the VM; the error names it. Wait for the operation to finish and try again.
- Snapshot quota exceeded: <N> GB of <M> GB used. … — snapshots of the VMs and volumes of the VDC have used up the whole snapshot quota. Delete old snapshots or contact a user with the Cluster master role to raise the quota.
Roll the VM back to a snapshot
A rollback returns the VM disks to their state at the time of the snapshot. Together with the disks, Center restores the number of cores, the amount of RAM, the name and the description of the VM. Data written to the disks after the snapshot is lost.
Warning. Center deletes the snapshots taken later than the selected one and the disks added to the VM after it, together with their data, permanently. The web interface shows the list of snapshots in the confirmation window: By rolling back you will lose snapshots: …. The window does not name the disks to be deleted: check them yourself in the disks section of the VM — VM snapshots.
- In the Snapshots section of the VM page, click the ⋯ button in the row of the snapshot.
- Select Rollback. The Are you sure want to rollback to <name>? window opens.
- Click Rollback.
When the rollback finishes, the web interface shows the notification Restore state of vm <VM ID> from snapshot <name>. The VM stays stopped — start it: Start, stop and restart a VM.
The In order to perform VM rollback vm id==<VM ID> must be stopped error means that the VM is running: stop it and repeat the rollback.
More
- Remove in the ⋯ menu of the snapshot row — deletes a snapshot you no longer need. The web interface asks Are you sure want to remove snapshot <name>?; you cannot restore a deleted snapshot.
- Snapshots take up space in the storage pool: the size of each snapshot is in the Size (GB) column.
Next
- Start, stop and restart a VM
- Virtual machines — how VMs work.
API methods: vms-snapshot, vm-snapshot-list, vms-rollback, vms-snapshot-remove — in the API reference.