qm-destroy
Delete virtual machines and containers
TLDR
Destroy a specific virtual machine
Destroy all disks that are not explicitly referenced in a specific virtual machine's configuration
Destroy a virtual machine and remove from all locations (inventory, backup jobs, high availability managers, etc.)
Destroy a specific virtual machine ignoring locks and forcing destroy
SYNOPSIS
qm destroy <vmid> [OPTIONS]
<vmid>: The unique numerical identifier for the virtual machine or container to destroy. This is a mandatory argument.
PARAMETERS
--force
Use --force 1 to forcibly destroy the VM/CT even if it is running. Without this, the command will fail if the VM/CT is still active. Defaults to 0 (false).
--purge
Use --purge 1 to remove all backups and log entries associated with the VM/CT. Defaults to 0 (false).
--skiplog
Use --skiplog 1 to prevent the creation of a log entry for this destroy operation. Defaults to 0 (false).
DESCRIPTION
qm-destroy is a command-line utility used within the Proxmox VE (Virtual Environment) ecosystem to permanently delete a virtual machine (VM) or container (CT). When executed, it removes the VM/CT's configuration file, all associated virtual disk images, and any snapshots. This operation is irreversible and results in complete data loss for the specified VM or container.
It's a critical management tool for freeing up resources and decluttering the Proxmox host. Users must be cautious when using this command due to its destructive nature, always ensuring that critical data has been backed up before proceeding.
CAVEATS
This command performs an irreversible operation. All data associated with the specified VM or container, including its configuration, virtual disks, and snapshots, will be permanently deleted.
Ensure you have backed up any critical data before using qm-destroy.
Using --force on a running VM can lead to data corruption if the guest OS is not properly shut down beforehand. It is always recommended to stop the VM gracefully (e.g., using qm stop) before destroying it.
VMID SIGNIFICANCE
The vmid is a crucial identifier in Proxmox VE. It must be unique across all VMs and containers on a Proxmox host. It's used in almost all qm and pct commands to specify the target VM or container.
DATA LOCATION
When qm-destroy is executed, it removes configuration files typically located in /etc/pve/qemu-server/ (for KVM VMs) or /etc/pve/lxc/ (for LXC containers), and also deletes associated disk images from the configured storage.
HISTORY
qm-destroy is an integral part of the Proxmox Virtual Environment (PVE), an open-source server virtualization management solution. Proxmox VE was first released in 2007, building upon Debian Linux and integrating KVM for virtual machines and LXC for containers. The qm utility suite, including qm-destroy, has been a core component of PVE's command-line interface from its early days, providing robust control over the lifecycle of VMs and containers. Its design reflects the need for powerful and efficient management of virtualized environments.