In this tutorial, we’re going to look at how to delete a Virtual Machine in Proxmox. After you set up virtual machines (VMs) in Proxmox, you might need to delete a few of them over time, but you must ensure that you reclaim the storage space that they’ve used.
The process is extremely simple, but you want to ensure that you delete everything so that you can reclaim the space that the VM is using.
Risks of Deleting a Virtual Machine
There are several things you must take into consideration before deleting a virtual machine (VM) in Proxmox. First is the risk of data loss – when a VM is deleted, all the data contained in it (operating system, application data, configurations, etc) will be gone.
Without proper backups, this information will be lost. Besides the actual data, there’s also the concern of downtime, assuming the VM is responsible for specific services or applications. The VM deletion will lead to potential downtime until a solution is in place.
Another significant concern is the loss of custom configurations. Over time, VMs can be tailored to specific needs (unique network settings, software setups, and security measures). Deleting the VM erases these configurations, making recreation not only time-intensive but also potentially challenging to replicate.
Overall, the main point is that you need to be absolutely certain that you want to delete the VM before actually deleting the VM.
Why Delete a VM in Proxmox?
Ultimately, the main reason is to reclaim space on your Proxmox hypervisor. This could be from retiring an old server, restoring it on new hardware (and wanting to remove the old version), or just about anything in between.
The main point is that deleting the VM must be done in the correct order to ensure that the VM, its backups, and anything else related are removed so that the Proxmox hypervisor reclaims all of the available space.
Prerequisites Before Proceeding
Before we proceed, please remember that this will delete the entire VM and its backups! If you do not want to delete the backups, you can move them to a separate server to keep them available, and can always restore the backup if needed!
However, from a functionality perspective, it generally makes sense to delete the Proxmox backups as they’ll take up unnecessary space in the event that the VM is no longer needed.
Manually Deleting Backups and Snapshots
Before completing the steps below in Proxmox, we will first ensure that all prior backups and snapshots are deleted so that they don’t claim space on other servers.
Deleting Backups in Proxmox
1. Select the Virtual Machine that you’d like to remove and select Backup.
2. Select each backup and then select Remove.
3. Select Yes to remove the backup file. Please keep in mind that you’ll have to do this for each backup that you have.
NOTE: If you can access the backup location on the destination server, you can delete the backups from there as well. Just make sure that you’re deleting the correct files. If you’d like to be safe, remove them from the Proxmox side to ensure that they’re removed for the correct VM.
Deleting Snapshots in Proxmox
As mentioned above, the backups and snapshots will be deleted as well. If you’d like to manually check the snapshots that exist for any specific virtual machine, you can do that by following the instructions below.
1. Select the VM, then select Snapshots.
2. From here, you can select each snapshot and edit it (to see the details) and/or remove it. Please keep in mind that if you plan on migrating the virtual machine to a separate device, I’d suggest doing it with a backup and restore.
How to Delete a Virtual Machine in Proxmox
1. After each backup has been removed, you can move on to the next step of removing the virtual machine. Select the Virtual Machine on the left-hand side of Proxmox.
2. In the top right corner, select More and then Remove.
NOTE: Ensure that you are on the correct virtual machine!
3. Double-check that you’re deleting the correct virtual machine by checking the ID. If it’s correct, enter the ID.
4. Select both options to purge from job configurations and destroy unreferenced disks owned by guest. This will ensure that the jobs and disks owned by the virtual machine will be deleted.
NOTE: If you receive an error due to the fact that storage was available and is no longer available (as the screenshot shows below), you’ll have to get the storage online or remove it.
To remove the storage, select Datacenter, then Storage, select the storage location, then remove it (as long as it’s not being used). You can then delete the virtual machine!
Conclusion & Final Thoughts
The actual process of deleting a VM in Proxmox is extremely simple, however, it’s a good idea to ensure that you’ve removed all backups first.
This will ensure that the data that’s written to any other location is also removed. Please keep in mind that this ensures you do not want the backups either, as you will have no way of restoring this virtual machine after following this process.