keepcalculator

06 Numbers and Powers

Proxmox Delete VM: Steps and Common Pitfalls

Card No. 06·57338 · Updated · Standard formula, shown below

To delete a virtual machine (VM) in Proxmox VE, select the VM in the left sidebar, click the “More” button (or right-click), choose “Remove”, and confirm. This permanently erases the VM’s configuration and, if you select the option, its disk images.

What Deleting a VM Actually Does

When you remove a VM in Proxmox, the hypervisor deletes the VM’s configuration file (stored under /etc/pve/qemu-server/ for QEMU VMs) and, if you check the box, all associated disk images. The VM’s snapshots, backups, and templates are not automatically removed—those live in separate storage locations. Importantly, deletion is immediate and irreversible unless you have a backup, so always verify which VM you are removing, especially in clusters with many similarly named guests.

How to Delete a VM in the Web Interface

  1. Log in to the Proxmox web interface and select the VM from the left-hand tree.
  2. Click the “More” button (the one with three dots) in the top-right corner of the VM’s summary page, then choose “Remove”.
  3. In the confirmation dialog, decide whether to check “Destroy unreferenced disks owned by guest”. This removes the VM’s virtual disks. If you leave it unchecked, the disk files remain in storage but become orphaned.
  4. Click “Yes” to confirm. The VM disappears from the list immediately.

If you prefer the command line, use qm destroy . To also remove disks, add --purge (which removes the VM from any backup jobs and replication) and --destroy-unreferenced-disks 1 to delete orphaned disk images. For example: qm destroy 100 --purge --destroy-unreferenced-disks 1.

Deleting a VM from the Command Line

The qm command is the standard tool for QEMU VMs. The basic syntax is qm destroy . You can find the VMID from the web interface or by running qm list. If you want to remove the VM from all backup jobs and replication, add --purge. To delete any disk images that are not referenced by other VMs, add --destroy-unreferenced-disks 1. For example, to completely remove VM 101 with all its disks and cleanup, run:

qm destroy 101 --purge --destroy-unreferenced-disks 1

Be careful: this command does not ask for confirmation. Double-check the VMID before pressing Enter.

What Happens to the VM’s Disks?

By default, the web interface asks whether to destroy unreferenced disks. If you uncheck that box, the VM’s disk images (e.g., vm-100-disk-0.qcow2) remain in the storage directory. They become “orphaned”—not attached to any VM. You can later reattach them to a new VM or delete them manually. To find orphaned disks, go to the storage in the web interface (Datacenter → Storage → select the storage) and look for “unused” disk images. You can also use the command qm rescan to make Proxmox recognize them again, but that is only needed if you are trying to reattach.

Common Mistakes and How to Avoid Them

  • Deleting the wrong VM: Always check the VMID and name. In a cluster, VMs can have similar names. Use the search function or sort by VMID.
  • Forgetting to remove backups: Deleting a VM does not delete its backups. Backups are stored separately and can consume significant space. Check the backup storage and remove old backups if you no longer need them.
  • Not removing the VM from backup jobs: If the VM is part of a backup job, the job will fail or skip the missing VM. Use --purge to clean up these references.
  • Deleting a VM that is still running: Proxmox will ask for confirmation, but you can force stop it first. It is safer to shut down the VM gracefully before deletion to avoid data corruption, though deletion itself does not touch the guest OS.

Deleting a VM vs. Removing a Disk

Sometimes you only want to remove a disk, not the whole VM. In the web interface, go to the VM’s Hardware tab, select the disk you want to remove, and click “Remove”. This detaches the disk from the VM. You can then choose to delete the disk image or keep it. This is useful when you want to replace a disk or move storage. It does not delete the VM itself.

Frequently Asked Questions

Can I recover a deleted VM?

No, unless you have a backup. Proxmox does not have a recycle bin. If you have a backup, you can restore the VM from the backup storage. If you did not delete the disks (unchecked the box), you might be able to reattach the orphaned disk to a new VM, but the VM configuration is gone.

Why is the “Destroy unreferenced disks” checkbox grayed out?

This happens when the VM has no disks, or when the disks are shared or referenced by another VM (e.g., a cloud-init disk that is used by multiple VMs). In that case, you cannot delete them via the checkbox. You would need to remove them manually from the storage if you are sure they are not in use.

What is the difference between “Remove” and “Stop”?

“Stop” shuts down the VM (like pulling the power plug). The VM remains in your list and can be started again. “Remove” deletes the VM configuration permanently. Stopping is reversible; removing is not.

How do I delete a VM from a Proxmox cluster?

Deleting a VM in a cluster works the same as on a single node. Select the VM in the web interface and remove it. The VM’s configuration is stored on the cluster filesystem, so it is removed from all nodes. Ensure you have the correct VMID, as cluster-wide names can be confusing.

Does deleting a VM free up space immediately?

Yes, if you delete the disk images. The space is freed on the underlying storage. However, if you have snapshots, those are stored as separate disk images and are not removed unless you delete them first. Also, if you use thin provisioning, the space is freed but may not be immediately visible until the storage reaps it.

Can I delete a VM while it is running?

Yes, Proxmox allows it, but it will stop the VM abruptly. It is better to shut down the guest OS first to avoid data corruption. If you delete a running VM, Proxmox will stop it and then remove it.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →