Deleting a virtual machine

ustim

New Member
Aug 12, 2020
2
0
1
44
1. I created a virtual machine with a system virtual disk.
2. I connected an additional virtual hard disk on which a lot of information is stored.

If now I want to delete the virtual machine, but this additional hard drive is also deleted. Why is this happening?
I tried unplugging this drive but it gets deleted anyway.

Can you help me remove the virtual machine correctly, but leave the additional hard drive in place?
 
Hi,
that's because from PVE's perspective the virtual disk belongs to the VM and thus is deleted when the VM is deleted. PVE is not really designed to have VM-less virtual disks lying around.

If you want to retain the virtual disk, you can either make a copy beforehand or rename/move it. In both cases it's important to choose a name different than vm-<ID>-* or a location that's not one of your configured storages.

Alternatively, you could delete/replace only the system disk.
 
Thank. Now I'll know.
Will have to find the right way to organize the file storage for a particular virtual machine.