How To Create and Restore VM Snapshot on Proxmox VE

A snapshot can be defined as a view of a virtual machine’s operating system and applications on any or all available disks at a given point in time. In production environment setups, it is critical to take a snapshot of a virtual machine before you start making changes to it that may have unintended consequences. A snapshot enables you to return a virtual machine to a previous clean or healthy state.

Creating Virtual Machine (VM) Snapshot on Proxmox VE

We shall consider two options of performing this operation:

1. Creating Proxmox VM Snapshot from Web Interface

Login to Proxmox Web Console and click Server ViewServer Name. The click a virtual machine’s name to access details view.

Click the Snapshots tab and then Take Snapshot.

Give it a name and optionally enter a description for the snapshot.

Click Take Snapshot.

2. Creating Proxmox VM Snapshot from CLI

Login to Proxmox server over SSH or tty console.

ssh root@pvenodeip

List Virtual Machines:

$ qm list
      VMID NAME                 STATUS     MEM(MB)    BOOTDISK(GB) PID
       100 debian-11-lab        running    4096              50.00 4034698
       101 Fedora-36-lab        running    8192              50.00 1935060
       102 Ubuntu-22-lab        stopped    8192              50.00 0
       103 netbsd-lab           stopped    4096              32.00 0
       104 CentOS-8-Stream-lab  stopped    4096              50.00 0
       105 FreeBSD-13-lab       stopped    4096              50.00 0
       106 Oracle-Linux-9       stopped    8096              50.00 0
       107 Alma-Linux-8-lab     stopped    4096              50.00 0
       108 windows-2022-server  stopped    8096              60.00 0
       109 rocky-linux-9-lab    stopped    8096              50.00 0
       110 Linux-Mint-20        stopped    4096              50.00 0
       111 Linux-Mint-Josphat   running    2048              32.00 1105802

To create snapshot using qm command line tool, use the syntax:

qm snapshot <vmid> <snapname> [OPTIONS]

Let’s first list the snapshots in Virtual Machine (Linux-Mint-Josphat) with ID 111.

$ qm listsnapshot 111
`-> Snap1                       2022-09-22 13:06:13     no-description
 `-> current                                            You are here!

Let’s stop the instance:

qm stop 111

Confirm the current VM status:

$ qm status 111
status: stopped

We’ll then create another snapshot named Snap2

$ qm snapshot 111 Snap2
snapshotting 'drive-scsi0' (local:111/vm-111-disk-0.qcow2)

List available snapshots to confirm this was created.

$ qm listsnapshot 111
`-> Snap1                       2022-09-22 13:06:13     no-description
 `-> Snap2                      2022-09-22 13:26:21     no-description
  `-> current                                           You are here!

The same can be confirmed from the Proxmox VE Web dashboard.

Restoring Virtual Machine(VM) Snapshots on Proxmox VE

A snapshot can be used to restore a virtual machine to its previous state. Consider two methods of restoring Virtual Machine Snapshots on Proxmox Virtual Environment.

1. Restore Proxmox VM Snapshot from Web Interface

Click the virtual machine’s name to go to the details view, then Snapshots tab to list the available snapshots.

Select a snapshot to restore. Click on “Rollback” to restore the Virtual Machine to the old snapshot state.

Confirm that you want to begin rollback process:

2. Restore Proxmox VM Snapshot from CLI

List Snapshots in Virtual Machine:

$ qm listsnapshot 111
`-> Snap1                       2022-09-22 13:06:13     no-description
 `-> Snap2                      2022-09-22 13:26:21     no-description
  `-> current                                           You are here!

To restore to an older snapshot use command syntax:

qm rollback <vmid> <snapname>

In the example below we’ll rollback Virtual Machine with ID 111 to Snapshot Snap1

qm rollback 111 Snap1

Confirm VM information after restoration:

$ qm config 111
boot: order=scsi0;ide2;net0
cores: 1
ide2: none,media=cdrom
memory: 2048
meta: creation-qemu=6.2.0,ctime=1663849758
name: Linux-Mint-Josphat
net0: virtio=82:DF:80:F0:6A:12,bridge=vmbr1,firewall=1
numa: 0
ostype: l26
parent: Snap1
scsi0: local:111/vm-111-disk-0.qcow2,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=4db9ddac-6f2c-44df-8cc0-c6f16fbae60a
sockets: 1
vmgenid: 0964d172-d1b1-4eeb-b3c2-c9bfab4852c3

Remove / Delete VM Snapshots on Proxmox VE

A Virtual Machine snapshot can be deleted and permanently removed from Proxmox Virtualization environment.

Delete Proxmox VM Snapshot from Web Interface

Click the virtual machine’s name and go to Snapshots tab to list the snapshots for that virtual machine. From here you can select the snapshot to remove.

Click Remove and confirm deletion.

Delete Proxmox VM Snapshot from CLI

List snapshots:

$ qm listsnapshot 111
`-> Snap1                       2022-09-22 13:06:13     no-description
 `-> Snap2                      2022-09-22 13:26:21     no-description
  `-> current                                           You are here!

The command syntax for Snapshot deletion is:

qm delsnapshot <vmid> <snapname> [OPTIONS]

In this example we delete snapshot Snap2 in Virtual Machine 111:

qm delsnapshot 111 Snap2

Confirm that the Snapshot was deleted:

$ qm listsnapshot 111
`-> Snap1                       2022-09-22 13:06:13     no-description
 `-> current                                            You are here!

Conclusion

In this blog post we looked at the procedure of creating, rolling back to snapshot, and deleting a snapshot in Proxmox Virtual Environment. VM snapshot is an exact copy of the Virtual Machine and it is usable for creating multiple instances of the same VM, or when performing VM migration operations. A snapshot, as demonstrated in this article can also be used for restoring the VM to its former state at which the snapshot was captured.

More guides to check out on Virtualization:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

GNS3 community is the world’s largest community of network professionals who love building better networks, sharing ideas and making connections […]

In this article we describe how you can remove a Storage Repository (SR) on XenServer / XCP-ng host when the […]

In this guide we will perform an installation of XCP-ng VM or guest tools on Ubuntu | Debian Linux system. […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.