Well, it finally happened; now you need to restore a Virtual Machine, Container, or worse yet, the hypervisor host.
It goes without saying, but the easiest way to recover is from a snapshot which you made before you made a change that broke your Virtual Machine or Container — you did take a snapshot, right? The easiest way is to increment or rollback snapshots via the GUI under the Snapshots option for each of them, but if you need to do it by the command line, then you can.
First, obtain a list of your Virtual Machines or Containers in order to obtain their ID:
To make a snapshot:
Virtual Machines allow you to save the state of RAM with a snapshot (
vmstate) on top of their storage and configuration, while as Containers can only snapshot their storage and configuration.
To list the snapshots:
To restore a snapshot:
Suppose that something went awry while I was on Christmas vacation, and I wanted to pave over the changes with the last working state and boot the Virtual Machine or Container after a successful snapshot rollback (
Remember the initial installation process above? Reboot the server into Rescue mode so that you can load Proxmox via QEMU and login with
root and your password:
List the Virtual Machines and/or Containers to get their IDs and turn off auto-booting for each.
Using the ID of
100 as an example for a Virtual Machine or Container, and to disable it from booting, use:
Turn off the Proxmox firewall for the entire cluster if you enabled it:
sed -i \ 's/^enable: .*/enable: 0/' \ /etc/pve/firewall/cluster.fw \ ;
/etc/network/interfaces with the recovery configuration:
cp -va \ /etc/network/config-recovery \ /etc/network/interfaces \ ;
Now you can shut down Proxmox from within QEMU:
shutdown -h now
In the rescue shell, reboot the physical server, which should load into Proxmox: