How to delete a zfs image file

Brian Read

Well-Known Member
Jan 4, 2017
120
5
58
74
I can't seem ot find a way of deleting an image (raw) file in a zfs pool. Deleting the associated VM does not seem to delete it and when I select it in the storage/zfs/content view the "Remove" button is greyed out.
 
deleting the guest should delete the associated disks as well (irregardless of storage plugin used, except for stuff which we cannot delete..)

could you post the task log of the "destroy vm" task?
 
thanks for the reply.

Actually i think I mislead you. The one I want to delete was created as a second hard drive for one VM, but then became not needed. Although I also do have another one which I think WAS associated with a deleted VM.

I'd like an answer to how to delete the first one, but also if you point me in the direction of the tak log you mention I'll see if i can find out what happened to the other one, and get back to you.
 
if you just remove the disk from a VM via our tools, it will be added as unused (the image/volume/.. is still there, but the guest does not have access to it anymore). you can then remove the unused disk if you actually want to delete the associated image/volume/..

the task log is available for each node and for each VM, in your case (VM destroyed) you need to go to the node level on the GUI and click "Task History" in the menu. then select the correct entry and double click (or use the "view" button).
 
that is the bit I cannot sort out. when I selected the image, the "remove" button is greyed out.

unused disk at the VM level, not volume on the storage level. this of course only works if you still have a VM. otherwise you have to delete the file/volume/.. yourself on the shell. the remove button in the storage content tab only removes backup files and the like, not guest disk images.
 
unused disk at the VM level, not volume on the storage level. this of course only works if you still have a VM. otherwise you have to delete the file/volume/.. yourself on the shell. the remove button in the storage content tab only removes backup files and the like, not guest disk images.

Ok, I can understand that, can you give me a hint as to what command I should use - is there a proxmox command, or do I need to use a zfs one?
 
Ok, I can understand that, can you give me a hint as to what command I should use - is there a proxmox command, or do I need to use a zfs one?

"pvesm free STORAGEID:VOLUMEID" is the general command to delete a PVE managed volume (note, this does not ask for confirmation, so make sure to pass in the right values)
"zfs destroy name/of/dataset" is the ZFS specific command, you can get the dataset name by looking at the output of "zfs list"
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!