orphan disk search

This commit is contained in:
David Schroeder
2026-09-22 21:49:51 -05:00
parent 467c2f7300
commit 6c45cee540
4 changed files with 376 additions and 1 deletions
+34
View File
@@ -52,8 +52,42 @@ cpu Detect and optionally apply a migration-safe CPU model
maintenance Toggle local HA maintenance mode
keepalived Deploy Keepalived across the cluster
iso-nfs Create an LXC NFS server and cluster-wide shared ISO storage
orphan-disks Report cluster-wide orphan candidates and unused disks (read-only)
```
## Orphaned and unused disks
Open **Cluster & Maintenance → Find orphaned / unused disks (read-only)**.
The menu offers CSV export after displaying the report. Direct commands:
```bash
tapm orphan-disks
tapm orphan-disks --csv /root/orphan-disks.csv
```
Run as root on a Proxmox node. The report uses `pvesh` and Python 3, inventories
online nodes' storage-managed VM and container volumes, and compares them with
cluster guest configurations in `/etc/pve/nodes`, including offline guests,
snapshots, pending changes, EFI/TPM disks, and detached `unusedN` entries.
Shared storage IDs are scanned once; local storage remains scoped to its node.
Results are grouped by node and storage, with volume IDs and provisioned sizes.
Backups, ISOs, unmanaged files, and physical/passthrough disks are excluded.
An **Orphan candidate** has no configuration reference. **Unused disk** means
only current `unusedN` entries reference it. Remote-node references and possible
template/clone backing relationships are marked **Needs review**. This is an
inventory, not proof that a volume can be deleted: replication copies, storage
aliases, and backend-specific backing dependencies require review. No guest or
storage changes are made.
Offline nodes, inactive storage, and failed reads are reported as incomplete
coverage; missing guest configurations prevent orphan classification. Changes
to guest configurations during the scan require a rerun. Scan when migration,
replication, and disk operations are idle because the inventory is not atomic.
CSV export includes coverage warnings and refuses to overwrite an existing file.
Exit status is 0 for a completed scan, 2 for incomplete coverage or changed
configurations, and 1 for a fatal scan/export error.
## Companion files
Large installer artifacts used by this project are stored in the private