Skip to main content
RunBook Academy

Proxmox VEX · LXC ContainersOperations

Container migration, backups, and security boundary

Intermediate⏱ ~22 minpctvzdump

What you'll learn

  • Migrate containers online and offline, and predict the downtime of each
  • Back up containers with vzdump and PBS, choosing the mode from the workload
  • Recognise when containers are appropriate vs VMs
  • Apply the security boundary honestly
  • Restore a container into a new ID and verify the restore rather than the 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.

Why this matters in production

Containers are fast to provision and easy to migrate, but their security boundary is weaker than VMs. This lesson covers the operational practices and the honest security model.

Migration

Service impact possiblemove a container to another node
set -euo pipefail
CTID=200
TARGET=pve-02

# Restart migration: PVE shuts the container down, moves it, starts it again.
# --timeout bounds how long it waits for a clean shutdown before forcing.
pct migrate "$CTID" "$TARGET" --restart 1 --timeout 180

# Offline migration of an already-stopped container.
# pct migrate "$CTID" "$TARGET"

pct config "$CTID" >/dev/null 2>&1 \
|| echo "container now lives on $TARGET"

Backups

Containers are backed up with vzdump, the same tool used for VMs:

vzdump 200 --storage pbs-main --mode snapshot

The three modes, as the documentation describes them for containers:

ModeWhat it doesDowntimeNeeds
stopStops the container for the duration of the backupThe whole backupNothing
suspendrsync copies the data to a temporary location, then the container is suspended and a second rsync copies changed files, then it resumesThe second rsync passFree space for the copy, in --tmpdir
snapshotSuspends the container briefly to ensure consistency, takes a storage snapshot, archives the snapshot, deletes itSecondsA snapshot-capable backend

Restore:

Data-loss riskrestore a container
set -euo pipefail
NEWID=210

# List what is actually available before choosing a snapshot.
pvesm list pbs-main --content backup | grep '/ct/'

pct restore "$NEWID" \
'pbs-main:backup/ct/200/2026-08-12T02:00:03Z' \
--storage local-zfs

pct start "$NEWID"
pct exec "$NEWID" -- systemctl --failed --no-pager

Security boundary — the honest version

LXC containers provide:

  • Visibility isolation (namespaces).
  • Resource isolation (cgroups).
  • Network isolation (per-interface firewall).

They do NOT provide:

  • Kernel isolation.
  • Hardware isolation.
  • Trust boundary against malicious code.
flowchart TB
  subgraph VM[KVM VM]
    V1[Separate kernel]
    V2[Hardware isolation]
    V3[Independent reboot]
  end
  subgraph CT[Container]
    C1[Shared kernel]
    C2[Namespace isolation]
    C3[Resource limits]
  end

When containers are appropriate

Use caseContainer?
Linux service, trusted codeYes
Multi-tenant SaaS with untrusted codeNo — use VMs
WindowsNo
Sensitive workloads (PCI, HIPAA)Often no — check compliance
High-density micro-servicesYes (with nesting enabled)

Production considerations

Verification that can fail

A green backup job proves a backup ran. These prove a container can be recovered from it.

Service impact possiblequarterly restore drill
set -euo pipefail
SRC=200
DRILL=9200
SNAP='pbs-main:backup/ct/200/2026-08-12T02:00:03Z'

pct restore "$DRILL" "$SNAP" --storage local-zfs --unprivileged 1
pct set "$DRILL" --net0 name=eth0,bridge=vmbr-isolated,ip=192.0.2.50/24
pct set "$DRILL" --hostname "drill-$SRC"

pct start "$DRILL"
sleep 20

# The four checks that actually distinguish success from "it booted".
pct exec "$DRILL" -- systemctl is-system-running || true
pct exec "$DRILL" -- systemctl --failed --no-pager
pct exec "$DRILL" -- df -h /
pct exec "$DRILL" -- findmnt -no TARGET,SOURCE | grep -vE '^/(proc|sys|dev|run)'

# Time it, write the number in the runbook, then clean up.
pct stop "$DRILL"
pct destroy "$DRILL"

Record the elapsed time. That number, not an estimate, is the container’s contribution to your RTO, and it is the input the RPO/RTO work in RPO, RTO and dependency modelling needs.

Common mistakes

  • Treating containers as VMs in security reviews.
  • Running privileged containers without documented justification.
  • Forgetting to test container restores.
  • Planning a maintenance window on the assumption that containers live-migrate.
  • Believing suspend mode checkpoints processes, and sizing --tmpdir accordingly.
  • Restoring without checking whether the archive’s privilege setting is the one you want.

Key takeaways

  • Containers are fast and efficient; their security boundary is weaker than VMs.
  • Container migration is a restart migration: plan the downtime, do not assume a VM-style live move.
  • The three vzdump modes all pause the container; they differ in how long and in what they need.
  • Bind and device mount point contents are never in the backup.
  • A restore is verified by exercising the workload, not by the task turning green.

Knowledge check

Knowledge check · 5 questions

  1. Q1. Which command moves a running container to another node, restarting it there?

  2. Q2. Containers provide kernel isolation equivalent to VMs.

  3. Q3. Which vzdump mode takes a storage-level snapshot rather than copying the container’s files?

  4. Q4. How does vzdump suspend mode actually work for a container?

  5. Q5. A container is restored from a PBS snapshot and the service starts but has lost all its history. Which are plausible causes? Select all that apply.

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