Skip to main content
RunBook Academy

Proxmox VEXIII · Proxmox Backup ServerPBS integration

Backup modes: snapshot, suspend and stop

Advanced⏱ ~24 minvzdumpqemu-guest-agent

What you'll learn

  • State exactly what stop, suspend and snapshot mode do to a running guest
  • Distinguish crash consistency, filesystem consistency and application consistency, and name what provides each
  • Choose a mode per workload rather than per cluster, and justify the choice
  • Verify that the guest agent freeze actually happened, rather than assuming it from a green job

Prerequisites

Verified against Proxmox VE 9.2.4 · Proxmox Backup Server 4.2.5 · Ceph Squid / Tentacle · Debian 13 (Trixie) · Linux kernel 7.0 (PVE 9.2 default) · 2026-08-12

Not yet marked complete on this device.

--mode is one word in a backup job definition and it is the setting that determines what your backup is actually a backup of. Get it wrong and the job still succeeds, the notification is still green, the snapshot still appears in the datastore, and the restored database still refuses to start.

Almost every cluster runs every guest in snapshot mode because it is the default and because it does not interrupt anything. That is usually correct. The lesson is about knowing why it is correct, and recognising the workloads where it is not.

The three modes, for virtual machines

ModeWhat happens to the guestDowntimeDocumented as
stopOrderly shutdown, then a background QEMU process backs up the data. The guest is started again once the backup process has taken over.Shutdown + start, not the backup duration“provides the highest consistency of the backup, at the cost of a short downtime in the VM operation”
suspendThe VM is suspended, then snapshot mode is invokedLonger than snapshot, without a matching consistency gain“provided for compatibility reason, and suspends the VM before calling the snapshot mode”
snapshotNothing. Data blocks are copied while the VM runsNone“provides the lowest operation downtime, at the cost of a small inconsistency risk”

The three consistency levels

The modes are a means. The thing you are choosing between is consistency, and there are three levels, not two.

LevelWhat it meansWhat produces it
Crash consistentThe image is what the disk would look like if you pulled the power at that instantsnapshot mode with no guest agent
Filesystem consistentThe guest filesystem journal is quiesced and no writes are in flight at the freeze pointsnapshot mode + guest agent fs-freeze
Application consistentThe application has flushed its own state and knows a backup point existsGuest agent + application participation (VSS on Windows, fs-freeze hooks on Linux), or stop mode

Crash consistency is not nothing. Any modern journalling filesystem — ext4, XFS, NTFS, ZFS — recovers from a crash-consistent image. A restored guest will boot, replay its journal, and come up. The Linux course works through the same distinction from the guest side in application-consistent versus crash-consistent backups, which is worth reading alongside this if you are the person who has to convince an application owner that an image is not a database backup.

What crash consistency does not give you is the application’s invariants. A database that has written half of a multi-page update, an application that keeps an index file and a data file that must agree, a message queue mid-ack: these are consistent on disk in the filesystem sense and incoherent in the application sense. The filesystem replays cleanly and the application refuses to start, or worse, starts and serves wrong answers.

Making snapshot mode filesystem consistent

The agent is the whole difference, and it has two halves that people conflate: the agent option on the VM (does PVE talk to the guest at all) and the qemu-guest-agent package inside the guest (is there anything listening).

Configuration changeenable the agent on both sides
set -euo pipefail
VMID=100

# Host side: enable the channel. freeze-fs defaults to 1, so the freeze is on
# unless somebody has turned it off - which is worth checking rather than
# assuming, because a disabled freeze is invisible in the job report.
qm set "$VMID" --agent enabled=1,freeze-fs=1

# Guest side, Debian/Ubuntu:
#   apt install qemu-guest-agent && systemctl enable --now qemu-guest-agent
# Guest side, RHEL family:
#   dnf install qemu-guest-agent && systemctl enable --now qemu-guest-agent
# Windows: install the guest agent from the virtio-win ISO.

# The channel only appears after a full stop/start, not a reboot from inside.
qm stop "$VMID" && qm start "$VMID"

With both halves present, a snapshot-mode backup issues guest-fsfreeze-freeze before starting and guest-fsfreeze-thaw afterwards. Inside the guest the kernel flushes and quiesces every frozen filesystem, so the image is taken at a point where nothing is in flight.

Read-only / Safeverify the agent is actually answering, before you rely on it
# qm guest cmd 100 get-fsinfo
[
{
  "name": "sda1",
  "mountpoint": "/",
  "type": "ext4",
  "used-bytes": 4831838208,
  "total-bytes": 20961034240
}
]

Illustrative output

Read-only / Safefleet sweep - which guests claim an agent and which actually answer
set -euo pipefail

for vmid in $(qm list | awk 'NR>1 {print $1}'); do
configured=$(qm config "$vmid" | awk -F'[ ,=]' '/^agent:/ {print $2}')
[ "$configured" = "1" ] || { printf '%-6s agent-not-configured\n' "$vmid"; continue; }

status=$(qm status "$vmid" | awk '{print $2}')
[ "$status" = "running" ] || { printf '%-6s not-running-skip\n' "$vmid"; continue; }

if qm guest cmd "$vmid" ping >/dev/null 2>&1; then
  printf '%-6s ok\n' "$vmid"
else
  printf '%-6s CONFIGURED-BUT-NOT-ANSWERING\n' "$vmid"
fi
done

Container modes are a different mechanism with the same names

The names are shared; the implementations are not, and the differences matter operationally.

ModeContainer behaviour
stopThe container is halted for the whole backup. Potentially long unavailability — unlike VM stop mode, this really is the full duration
suspendrsync copies the container to a temporary location, the container is suspended, a second rsync pass copies what changed, then it resumes. Short downtime, but it needs extra storage for the temporary copy
snapshotThe container is suspended, a temporary snapshot of its volumes is taken, the snapshot content is archived, and the temporary snapshot is deleted. Requires a storage backend that supports snapshots

Two consequences that are easy to miss:

Container stop mode is not the cheap operation VM stop mode is. There is no background process taking over. Budget the whole backup duration as downtime.

Container snapshot mode requires snapshot-capable storage. A container on a plain directory storage cannot use it, and the job will fall back or fail. That is a storage design constraint arriving through the backup configuration, which is why it usually surprises people.

Choosing per workload

Configuration changemode is a per-job setting, so split the jobs
set -euo pipefail

# The fleet: live, no downtime, agent-quiesced.
vzdump --all 1 --exclude 205,206 \
--mode snapshot \
--storage pbs-main \
--prune-backups keep-daily=14,keep-weekly=8,keep-monthly=12 \
--notes-template '{{guestname}} nightly'

# The exceptions: two guests whose application cannot be reconstructed from a
# crash-consistent image, and which tolerate a two-minute restart at 03:00.
vzdump 205 206 \
--mode stop \
--storage pbs-main \
--prune-backups keep-daily=14
WorkloadModeWhy
Stateless web/app serverssnapshotCrash consistency is sufficient; the state is elsewhere
Linux guest with a journalling FS and no databasesnapshot + agentFilesystem consistency is the whole requirement
PostgreSQL / MySQL / MSSQLsnapshot + agent, plus a native dump, or stopThe image restores; the database engine is what decides whether it starts cleanly. A native backup inside the guest is the application-consistent artefact
Windows with VSS-aware applicationssnapshot + guest agentThe agent drives VSS, which is what makes the copy application consistent
Active Directory domain controllersnapshot + agent, and read the vmgenid material firstRestoring a DC from an image has failure modes beyond consistency
Appliance VM with an opaque embedded databasestopYou cannot reason about its consistency, so remove the question

Knowledge check

Knowledge check · 4 questions

  1. Q1. A VM backed up in stop mode takes 45 minutes to complete. How long is the guest unavailable?

  2. Q2. Which of these produce a filesystem-consistent rather than merely crash-consistent VM backup? Select all that apply.

  3. Q3. Container backups in stop mode have the same short downtime characteristic as VM backups in stop mode.

  4. Q4. Which statement best describes the relationship between a snapshot-mode VM backup and a native database dump taken inside the guest?

Passing score: 75%. Answers are checked in this browser.