Compare commits

...

1 Commits

Author SHA1 Message Date
MickLesk
b096b8d73b fix(clean-orphaned-lvm): check all cluster nodes for VM/CT configs
On multi-host clusters with shared storage (iSCSI/NAS), the script
only checked the local node's configs (/etc/pve/lxc/ and
/etc/pve/qemu-server/) and falsely flagged VMs/CTs running on other
nodes as orphaned. Now checks /etc/pve/nodes/*/lxc/ and
/etc/pve/nodes/*/qemu-server/ to cover all cluster members.

Closes #13827
2026-04-18 21:42:49 +02:00

View File

@@ -37,8 +37,9 @@ function find_orphaned_lvm {
fi
container_id=$(echo "$lv" | grep -oE "[0-9]+" | head -1)
# Check if the ID exists as a VM or LXC container
if [ -f "/etc/pve/lxc/${container_id}.conf" ] || [ -f "/etc/pve/qemu-server/${container_id}.conf" ]; then
# Check if the ID exists as a VM or LXC container on any cluster node
if compgen -G "/etc/pve/nodes/*/lxc/${container_id}.conf" >/dev/null 2>&1 ||
compgen -G "/etc/pve/nodes/*/qemu-server/${container_id}.conf" >/dev/null 2>&1; then
continue
fi