VM snapshots
A snapshot of a virtual machine (VM) captures all its disks and settings at one point in time. It is stored in the same pool as the disks; at first it takes almost no space, then it grows while the VM changes data. A rollback returns the VM to the snapshot and deletes everything that appeared later: newer snapshots and disks added after the snapshot.
How it works
- Creation. Center locks the VM, and the node of its pool takes a ZFS snapshot of all VM disks and of its settings file at once.
- A snapshot of a running VM is taken by Center without stopping or freezing the guest. The snapshot includes the data written to the disks by that moment; the guest memory and the data that the guest has not written yet are not included. After a rollback, the guest starts as after a sudden power loss.
- Storage. The snapshot is stored in the same pool as the VM disks. The space it takes grows as the VM overwrites data: the old blocks are retained in the snapshot.
- Rollback (only for a powered-off VM). The node returns the VM disks and settings to the snapshot: cores, memory, name, description. Disks enlarged after the snapshot return to their previous size.
- Deleting a snapshot frees the space that only this snapshot held.
What a rollback deletes
Warning. A rollback permanently deletes:
- all VM snapshots taken later than the selected one;
- VM disks added after the selected snapshot, together with their data;
- everything that the VM wrote to its disks after the snapshot.
The confirmation window lists the snapshots to be deleted. Before a rollback, check which disks were added to the VM after the selected snapshot.
Space taken by snapshots
- Size (GB) in a snapshot row is the space that is freed if you delete only this snapshot. The node calculates it across all VM disks.
- Shared space is not visible. Blocks that several snapshots hold at once do not appear in any row. So the column total can be less than what the snapshots actually take.
- The storage quota of the virtual data center (VDC) adds up the sizes of VM disks and VDC volumes; snapshots are not included in it.
- The VDC snapshot quota limits the space taken by snapshots of VMs and VDC volumes together. When the space taken by snapshots reaches the quota, Center rejects a new snapshot: Snapshot quota exceeded: <N> GB of <M> GB used. A quota of 0 forbids snapshots; without a quota, there is no limit. The space taken by snapshots is shown in the VDC list next to the quota — Set VDC quotas.
- The VM card and the VM list show how much space the VM takes in the pool in total and how much of it its snapshots take.
- Snapshots take pool space on a par with disks: this space is included in Used on the pool page.
Duration
- Snapshot sizes are sent by the node to Center once every 3 minutes: a fresh snapshot first shows an old or zero value.
What you see
- The Snapshots section on the VM page: the Name, Date of creation and Size (GB) columns, and the Add snapshot button.
- After creation: the notification Snapshot <name> was successfully added.
- Before a rollback: the window Are you sure want to rollback to <name>? with the list By rolling back you will lose snapshots: ….
- In the pool: Free on the pool page decreases while the snapshots are kept — Free space in the pool decreases.
Limitations
- Rollback is only for a powered-off VM: the Offline status. Center rejects a rollback of a running VM.
- You cannot take a snapshot while the VM is being moved or another operation is running on it: VM is locked. The VM pool must be running: otherwise, Pool of VM isn't in consuming state.
- There is no schedule. Center does not create or delete snapshots on its own.
- A snapshot is not a backup. It is stored in the same pool: if the pool is lost, the snapshots are lost too.
- When disks are moved to another pool, the snapshots move together with the disks — Moving VM disks between pools.
What not to do
- Do not keep snapshots for weeks on VMs with intensive writes: the space the snapshot takes grows, and the pool fills up.
- Do not perform a rollback without checking which snapshots and disks appeared after the selected snapshot: you cannot get them back.
- Do not treat a snapshot as a backup for recovery after a pool failure.
- Do not roll back a database to a snapshot of a running VM without checking: after the rollback, it recovers as after a power failure.
- Do not delete snapshots with commands on the node — delete them in the Center web interface.