DIFFERENCE BETWEEN Destroy & Purge VM

Abhijit Roy

Well-Known Member
Jul 23, 2019
58
4
48
42
Hi All,

Can anybody tell that what is the exact difference between Destroy(With VM ID) and Purge(Small Checkbox) while removing any VM, thanks
 
hi,

"destroy" option will remove the VM.

if you select the "purge" checkbox it will also remove the VMID from backup jobs and so forth. you can hover over the option with your mouse to see the explanation. see my screenshot :)
 

Attachments

  • 2021-12-07-122317_774x337_scrot.png
    2021-12-07-122317_774x337_scrot.png
    765.8 KB · Views: 87
Hi all!
#pveversion
pve-manager/7.1-7/df5740ad (running kernel: 5.13.19-2-pve)
Menu - More - Remove

I" m need remove vm and need save disks vm on storage.

I not select checkbox (Destroy unreferenced disks owned by guest) , but vm disks from storage got deleted.
Why?
 
Hi,
Hi all!
#pveversion
pve-manager/7.1-7/df5740ad (running kernel: 5.13.19-2-pve)
Menu - More - Remove

I" m need remove vm and need save disks vm on storage.
that is (currently) only possible by manually removing the configuration file.

I not select checkbox (Destroy unreferenced disks owned by guest) , but vm disks from storage got deleted.
Why?
If the disk is referenced in the config, it will be deleted even without checking that checkbox. I sent a patch to add a note to make that clear.
 
Destroy unreferenced disks owned by guest
----
meaning any disk that does not belong to the VM ID will be destroy?
can u give me the sample screenshot that show "unreferenced disks owned by guest" ?
 
if i check "Destroy unreferenced disks owned by guest"
it means any VM disks that does not have VM ID (VM ID not exist but VM Disks ID still exist), it will be deleted as well?
 
Hi,
Destroy unreferenced disks owned by guest
----
meaning any disk that does not belong to the VM ID will be destroy?
can u give me the sample screenshot that show "unreferenced disks owned by guest" ?
if i check "Destroy unreferenced disks owned by guest"
it means any VM disks that does not have VM ID (VM ID not exist but VM Disks ID still exist), it will be deleted as well?
no, only those disks with the same ID as the VM you are currently deleting. The difference is that all storages will be scanned for disks with that ID. By default, only those disks actually present in the configuration will be removed.
 
Let say vm id 999
There are 1 disk attached and 1 disk deattach under vm 999.

If we check “destroy unreferenced disks” , it means both disks will be destroyed?
If we dont check, means only 1 attached disk will be destroyed?
 
Let say vm id 999
There are 1 disk attached and 1 disk deattach under vm 999.

If we check “destroy unreferenced disks” , it means both disks will be destroyed?
If we dont check, means only 1 attached disk will be destroyed?
Unused disks are still referenced, so always both will be destroyed. If you have a third disk that's not part of the configuration at all, the option makes a difference. Such disks can be present if an operation is cancelled in the middle or if there is a bug or if manually allocating.
 
Unused disks are still referenced, so always both will be destroyed. If you have a third disk that's not part of the configuration at all, the option makes a difference. Such disks can be present if an operation is cancelled in the middle or if there is a bug or if manually allocating.
how to replicate this case.. i want to see the difference between that.. u said about manual allocating.. can u show me how do we create a new VM disk (manually) without create a new VM.. then i can try to remove another VM with checked "destroy unreferenced disk".. and see the result.. expected manual allocated VM disk will be deleted as well.
 
how to replicate this case.. i want to see the difference between that.. u said about manual allocating.. can u show me how do we create a new VM disk (manually) without create a new VM.. then i can try to remove another VM with checked "destroy unreferenced disk".. and see the result.. expected manual allocated VM disk will be deleted as well.
As said in my first reply, only unreferenced disks with the same ID as the VM will be deleted. E.g. if you do pvesm alloc local-lvm 106 vm-106-disk-9 1G --format raw to allocate a disk that won't be in the configuration and then remove VM 106:
  • without the destroy unreferenced disks option, the disk will still be there afterwards
  • with the destroy unreferenced disks option, the disk will be removed
 

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!