Delete orphaned VM DIsk

bratac

New Member
Mar 18, 2024
6
0
1
I hope this is the correct Forum to post this in, but it was the closesest I could find to what my question is.

I was trying to delete an old VM Disk because I would like to disable "Allow Snapshots as Volume-Chain" and there is one qcow2 disk file I cannot delete. The original VM does not exist anymore. I have tried to recreate the VM with the samew ID and after "qm disk rescan" the disk showed up and I tried deleting it, which was not possible due to an old snapshot, that of course no longer exists. It is looking for the snap shot file that is not there anymore.

How can I delete this file wihout the original snapshot. I don't have a backup, as it was only a test maschine.

update VM **: -delete unused0
TASK ERROR: qemu-img: Could not open '/dev/****/snap_****.qcow2': Could not open '/dev/****/snap_****.qcow2': No such file or directory
 
If you're sure the storage/disk doesn't exist any more then you can just remove the line from the config file
Bash:
# For a  VM
sed -i '/^unused0:/d' /etc/pve/qemu-server/VMIDHERE.conf

# For a CT
sed -i '/^unused0:/d' /etc/pve/lxc/CTIDHERE.conf
If you share more information such as the config file I can give you more detailed commands.
 
To be clear, the VM and the snapshot associated with the disk do no longer exist -> it's only a image lying around that isn't used by anything? And in order to delete the disk (presumably via the GUI) you created a new VM with the same ID to re-associate the disk?
 
Hi @bratac ,

Since your post contains references to "Allow Snapshots as Volume-Chain" and your disk references /dev, it suggests that you are using a SAN of some sort.
The ASVC feature requires use of LVM, so you must have an LVM volume left over that you should be able to delete using native LVM commands.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
To be clear, the VM and the snapshot associated with the disk do no longer exist -> it's only a image lying around that isn't used by anything? And in order to delete the disk (presumably via the GUI) you created a new VM with the same ID to re-associate the disk?
Sorry for the late replay. I have tried deleting it using the CLI as well as the GUI. It comes back to the same result
 
If you're sure the storage/disk doesn't exist any more then you can just remove the line from the config file
Bash:
# For a  VM
sed -i '/^unused0:/d' /etc/pve/qemu-server/VMIDHERE.conf

# For a CT
sed -i '/^unused0:/d' /etc/pve/lxc/CTIDHERE.conf
If you share more information such as the config file I can give you more detailed commands.
The VM config dosen't exist anymore because the VM got deleted. It is looking for a snapshot that dosen't exist anymore. I found another snap shot using a different name but the same ID and then tried renaming it in the hopes of solving it but this didn't work as well
 
I guess you can simply rm the the qcow2 file manually. I don't even know the file name or its storage though so I can't properly help you find it.
Try pvesm list STORAGENAMEHERE and then pvesm path VOLIDHERE to find it.
 
I have already tried to rm the image in question. I can delete it, but it is not getting deleted. It appears to be delted on the CLI but after checking back in the GUI on closing and reopening the CLI it is still there. I have tried to delete "vm-9000-disk-1.qcow2" as well as the linked dm file. Anything besides tranfsering everything to the HDD enclosure and formating the storage?
 
I can't really help you without more information. The output of the commands above as well as the commands you used would be of interest. A picture of the GUI too.
 
Like with every succesful command on Linux there is no output. It is loooking for something that isn't there anymore
 
Please provide:
cat /etc/pve/storage.cfg
pvesm status
mount
lsblk
qm config [id]
pvesm list [storage]

As requested, provide full unredacted commands that you run: rm, ls, etc
Direct and file listing on : vm-9000-disk-1.qcow2 (if that is the disk in question)
qemu-img info vm-9000-disk-1.qcow2


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox