← All notes

Snapshot a running classic VM in seconds

Virtainer Free snapshots a classic VM while it keeps running. A snapshot is a qcow2 internal snapshot taken across all of the VM's disks in one transaction, and you choose how consistent the capture has to be.

You can snapshot a classic VM while it is running. The VM keeps serving traffic, the capture takes seconds, and you choose how consistent it has to be.

What a snapshot is

A snapshot is a qcow2 internal snapshot: it lives inside the disk files the VM already owns, so nothing is copied. Taking one writes a snapshot of the same name into the root disk and into every writable data volume attached to the VM, as a single transaction. If any disk cannot take part, the whole snapshot is rejected, so you never end up with a rollback point that covers only some of the disks.

Because no data moves, the guest is held still only for the length of that transaction, roughly 150 ms per 8 GiB of data the disks already hold. A stopped VM snapshots just as quickly.

Snapshots form a tree. Restore an earlier one and take a new snapshot, and the new one becomes a child of the node you restored. A snapshot also records the VM’s shape (vCPUs, memory, attached volumes and NICs), so a restore puts the configuration back along with the data.

Consistency is chosen, never assumed

Every snapshot carries one of three labels, and the label states what the capture actually achieved.

Clean shutdown: the guest shut itself down before the capture. Nothing was writing, so nothing had to be arranged.

Crash-consistent: captured while the VM ran. It is what the disks would look like after a power cut. Most guests come back from that after a filesystem check.

Quiesced: the guest agent freezes the guest’s filesystems for the instant of the capture and thaws them right after. This needs the guest agent with filesystem freeze support inside the VM. If the agent cannot be reached, or the freeze or thaw cannot be confirmed, the snapshot fails. It is never quietly downgraded to crash-consistent under a stronger label.

A quiesce makes the filesystem consistent. It does not ask your database to flush what it has in flight, so applications that need that should be checkpointed first.

Limits

  • A snapshot never captures memory or running state. Restoring one leaves the VM stopped, and the next boot is an ordinary cold boot from the restored disks.
  • PCI device assignments do not travel with a snapshot.
  • A snapshot is not a backup. It sits in the same storage pool as the disks it protects, so if the pool or the host is lost, both go together. It exists to undo a change you are about to make. For copies that leave the host, use backup and restore.
  • Snapshots are for classic VMs. AppVMs roll back by redeploying.
  • Snapshot data counts toward the pool. There is no per-VM count limit, but a capture is refused when the pool is below its free-space floor.

The guide covers the controls, the labels and the limits in Snapshots.

KEEP READING
Open-sourcing cloud-image-inspectorOct 6Introducing Virtainer Free 1.1Oct 6