Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Backup, verify, destroy: how I deleted 50 Proxmox guests in one night and could undo any of them

说明与用途

删除了50个未使用的Proxmox虚拟机,恢复了约700GB存储空间,所有备份已验证并可恢复。

问题

A Proxmox host had many stopped guests, many of which were unused or base images for clones, consuming ~700 GB of storage.

结果

Deleted 50 unused Proxmox guests and recovered ~700 GB of storage, with all backups verified and deletions reversible via backups. Additional cleanup freed ~100 GB.

工作流

  • List all stopped guests
  • Grep each guest’s config for "base-<id>-" to identify base images; tag hits as keep
  • For each remaining candidate: run vzdump with --mode stop, --storage <backupstore>, --compress zstd
  • Verify the backup archive with zstd -t
  • Destroy the guest with pct destroy <id> --purge (or qm destroy for VMs)
  • Monitor backup storage free space and stop when space is tight
  • Clean up orphan disks (pvesm list <storage>), old ISOs and CT templates in local, and snapshots older than a year

证据

Stopped is not the same as unused. A template, or a plain container someone turned into a template, is always stopped and may be the base of linked clones. Deleting it takes every clone with it.

来源

vzdump <<id>> --storage <backupstore> --compress zstd --mode stop

来源

zstd -t /path/to/vzdump-lxc-<<id>>-*.tar.zst # VMs: zstd -t /path/to/vzdump-qemu-<<id>>-*.vma.zst

来源

pct destroy <<id>> --purge # VMs: qm destroy <<id>> --purge

来源

Running the vzdumps at full speed made the host's busy containers laggy, so I added --bwlimit to the vzdump command.

来源

  • 记录日期: 2026-10-10T01:55:50.310Z