An Example of using unlink - Remove virtual disks

princeo

New Member
Jun 9, 2012
5
0
1
I want to remove old virtual disks that are clogging up my system. They are from an old install.

Ive tried the following and it doesnt work
qm unlink 104 vm-101-disk-2
and this doesnt work, I get an error Can't use string ("vm-101-disk-2") as an ARRAY ref while "strict refs" in use at /usr/share/perl5/PVE/JSONSchema.pm line 977. (I guess this is perl)

can some one please show an example of doing this. Or what is the best way to remove virtual disks that are no longer required.
 
I want to remove old virtual disks that are clogging up my system. They are from an old install.

Ive tried the following and it doesnt work
qm unlink 104 vm-101-disk-2
and this doesnt work, I get an error Can't use string ("vm-101-disk-2") as an ARRAY ref while "strict refs" in use at /usr/share/perl5/PVE/JSONSchema.pm line 977. (I guess this is perl)

can some one please show an example of doing this. Or what is the best way to remove virtual disks that are no longer required.
Hi,
if the disks are inside an vm-config simply remove with the gui (select VM -> Hardware, select harddisk -> Remove).
If the config are gone, use "lvremove" (look with lvs or lvdisplay for the names).

Udo
 
Thanks Worked a treat. Used lvs to get the content listed, then I run lvremove vm-101-disk-2 and the file was gone. I eventually removed about 200gig from my 1tb hard drive.
 
a little bit late reply ;) - but that should have been :

qm unlink 104 --idlist scsiX (where scsiX is the device string/name where vm-101-disk-2 is attached to)

in my configuration it looks like this
scsi2: Disk2:vm-104-disk-0,backup=0,iothread=1,size=768G

you could also just manually edit 104.conf and delete that line with vi
 

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!