Orphaned VM Disk Removal

kromberg

Member
Nov 24, 2021
87
6
13
54
I got a disk sitting out on the storage device that is orphaned. It was created when I moved the disk for the VM from one storage device to another and forgot to check the delete source box. How can I delete this disk? It is not showing up with the VM config, but proxmox believes it belongs to the VM when looking at the storage device.
 
Your VM's Disk(s) will usually be located at /mnt/pve/{StorageNm}/images/{VMID}/

Find the correct {StorageNm} & {VMID} used and then you can ls /mnt/pve/{StorageNm}/images/{VMID}/ to get a list of disk(s) used
replacing the correct {StorageNm} & {VMID}.

Once your certain which one is the orphan you can simply remove with rm /mnt/pve/{StorageNm}/images/{VMID}/{orphan.xxxx}
replacing the correct {StorageNm} & {VMID} & {orphan.xxxx}.
 
The disk is in a zfs pool and not a disk. I would need to destroy the dataset/vdev right?
 
I really dont understand why there is even an option for not deleting the source disk when moving it. Or at least the default is to have the box checked.
 
But here is the next "kicker", I've already deleted the guest or the guest got migrated, and something in the migration errored, or a replication sync was not properly cleared and the disk/storage is still left on the other hypervisor/host. How do we clear/remove those??
 
pvesm list [options]
pvesm free [options]


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
I *assume* I'll have to still write a script to find the actual orphans, as I don't see those having any options popping up stating: `List the volumes that doesn't have a *valid* VMID` neither `list the storages that doesn't belong on this host`
 
I *assume* I'll have to still write a script to find the actual orphans,
Yes, you do need to be sure what you are doing when removing the data.

I assumed you asked because you already stumbled on the disk and knew it was there. This doesn't happen too often. I can recall only one case across all of our customers when a failed backup restore by 3rd party software caused a left-over disk.

If this happens often to you, create a reliable repro scenario and submit a bug to the PVE team.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
let me check the cases I've stumbled on this week on 8.4.x (All ZFS)

- out of storage errors during migration(s) with zpool (HDDs) busy and time outs
- multiple storage migrations queue for multiple VMs with multiple storages "queue (waiting on locks) with out of capacity (and too busy zpools)
- migration that was killed half way through
- issues during replication removals.

So nothing I couldn't handle myself, but I've been looking for a way to list volumes as: `Hey, this doesn't match any "valid" VMID, or there isn't a VMID like this on the local host etc.` so less about the removal as OP, but more about FINDING those