qm-rollback
Revert a virtual machine to a snapshot
TLDR
Rollback the state of a specific VM to a specified snapshot
SYNOPSIS
qm rollback <vmid> <snapname>
PARAMETERS
<vmid>
The unique numerical ID of the virtual machine to be rolled back. This ID identifies the specific VM within the Proxmox VE environment.
<snapname>
The name of the existing snapshot to which the virtual machine should be reverted. This snapshot must have been created previously using qm snapshot.
DESCRIPTION
The qm-rollback command in Proxmox VE is used to revert a QEMU/KVM virtual machine to a previously created snapshot state. This command is a critical part of Proxmox's VM management toolkit, allowing administrators to undo changes made since a specific point in time. When executed, qm-rollback restores the VM's disk images and configuration to precisely how they were when the designated snapshot was taken.
Before initiating a rollback, the target virtual machine must be powered off. It is crucial to understand that this is a destructive operation: all data, configurations, and changes made to the VM *after* the snapshot was created will be permanently lost and cannot be recovered. Therefore, it should be used with extreme caution and only after verifying the desired state.
This functionality is invaluable for quick recovery from erroneous system updates, failed software installations, or undesirable configuration changes during testing environments. While powerful for immediate recovery, qm-rollback is not a substitute for a comprehensive backup strategy, as snapshots are typically stored on the same storage as the VM itself.
CAVEATS
- The virtual machine must be stopped (powered off) before a rollback operation can be performed.
- A rollback is a destructive operation; all changes, data, and configurations made to the VM after the selected snapshot was taken will be permanently lost and are unrecoverable.
- The rollback operation affects all disk images associated with the VM and included in the snapshot.
- The VM's configuration (e.g., RAM, CPU settings, network interfaces) will also be reverted to the state it was in at the time the snapshot was created.
- Snapshots are typically stored on the same storage as the VM's disks, so they do not protect against storage failures. They are not a substitute for proper backups.
VM STATE REQUIREMENT
For qm-rollback to execute successfully, the target virtual machine must be in a stopped or powered-off state. Attempting to roll back a running VM will result in an error.
IRREVERSIBLE DATA LOSS
Users are strongly advised to understand that rolling back a VM will permanently delete all data and configuration changes made since the chosen snapshot. There is no undo functionality for this operation.
HISTORY
The qm-rollback command is an integral part of the Proxmox Virtual Environment (PVE) management toolset, specifically designed for QEMU/KVM virtual machines. Its functionality has been available since early versions of Proxmox VE, evolving alongside the platform's robust snapshot capabilities. It leverages QEMU's underlying snapshot mechanisms, abstracting them into an easy-to-use command-line interface for administrators. Its core purpose – to quickly revert a VM to a known good state – has remained consistent, making it a staple for development, testing, and recovery scenarios within Proxmox environments.