- New: smart-home/home-assistant-dashboard-conventions (Mushroom cards, view tabs, no Bubble Cards) - Updated: rke2, ceph, galera, proxmox, brainstorming, compound-learning, 1password-cli, smart-home-automation skills - New references: ceph-cluster-administration, docker-volume-forensics, ceph-crush-weight, ceph-ec-mixed-size
54 lines
1.5 KiB
Markdown
54 lines
1.5 KiB
Markdown
# CT Deletion: `pct destroy` Leaving Stale Config — 2026-07-14
|
|
|
|
## When to Use
|
|
|
|
When `pct destroy NNN --purge` fails because the RBD disk was already
|
|
deleted (partial destroy, manual disk removal, or disk lost during Ceph
|
|
recovery), but the CT config remains in `/etc/pve/lxc/NNN.conf`.
|
|
|
|
## Symptoms
|
|
|
|
```bash
|
|
pct destroy 112 --purge --destroy-unreferenced-disks
|
|
# rbd error: rbd: error opening image vm-112-disk-0: (2) No such file or directory
|
|
# exit code: 255
|
|
|
|
pct status 112
|
|
# status: stopped ← CT still appears!
|
|
|
|
pct list | grep 112
|
|
# 112 stopped authelia ← still listed!
|
|
```
|
|
|
|
## Cause
|
|
|
|
`pct destroy` operates in two phases:
|
|
1. Delete the storage (RBD images)
|
|
2. Remove the CT config (`/etc/pve/lxc/NNN.conf`)
|
|
|
|
If phase 1 fails (disk already gone → `rbd: error opening image`), the
|
|
command aborts with exit 255 **before reaching phase 2**. The config
|
|
remains in place.
|
|
|
|
## Fix
|
|
|
|
```bash
|
|
# On the PVE node hosting the CT (discover via ha-manager status):
|
|
rm -f /etc/pve/lxc/NNN.conf
|
|
|
|
# Verify:
|
|
pct list | grep NNN # should return nothing
|
|
```
|
|
|
|
The config removal is safe — the disk is already gone, so there's
|
|
nothing to corrupt. `/etc/pve/lxc/` is a shared FUSE filesystem (pmxcfs),
|
|
so the removal propagates cluster-wide instantly.
|
|
|
|
## Related
|
|
|
|
- `references/ceph-orphaned-rbd-cleanup-2026-07.md` — "VM Destruction
|
|
on Non-Ceph Nodes" covers the `qm destroy` equivalent (CFS lock
|
|
timeout, stale locks, manual config + RBD cleanup).
|
|
- The LXC case is simpler than the QEMU case: no CFS lock issues, no
|
|
watcher problems — just a stale config file to remove.
|