Understanding the Correct Use of VM Snapshots
A virtual machine (VM) snapshot captures the state and data of a virtual machine at the specific time when the snapshot was taken. It acts pretty much like the usual operating system snapshots. A VM snapshot is an exact copy of the VM and can be used for VM migration or creating multiple instances of the same VM. It can also be used for restoring the VM to the former state at which the snapshot was captured.
What Is a VM Snapshot?
A virtual machine snapshot is just an image of the state and data of a virtual machine, captured and stored at a given point in time. VM power states can be as follows: running, powered-off, unknown, suspended, aborted or paused, and either active or disconnected. A virtual machine’s data includes all files from disk, in memory and on other supported storage devices.
A VM snapshot does not have any impact on the virtual machine itself. However, if you’re working in an environment where you need to repeatedly roll back to a specific state of the VM, a VM snapshot can allow you to do so without having to create multiple VMs. For instance, you can use a VM snapshot as a safe restoration point for performing upgrades or making changes in the existing VM settings and configurations. If something goes wrong, you can revert back to the captured VM snapshot easily. It can also be useful in development and testing environments, where you need several virtual machines with similar configurations for testing purposes. Or, you may be performing and testing several code changes iteratively and need to have a safe rollback point.
What Are the Components of a Snapshot File?
A VM snapshot file consists of all the files stored on the storage devices of a virtual machine. Taking a snapshot creates files with extensions .vmdk, -delta.vmdk, .vmsd, and .vmsn, which are stored with the VM base files. The delta files are stored with the base VMDK file, which is stored in read-only mode to preserve its state. And VMSD and VMSN files are stored in the VM directory.
When you take a snapshot, the original VMDK file with the current disk state is preserved in read-only mode, and the guest OS can no longer make changes to it. Instead, a delta or a child disk file called delta.vmdk is created to which the guest OS can write. It holds the current disk state and the state that existed when the last VM snapshot was taken. The delta disk has two files: a disk descriptor file (with extension .vmsd) that contains information about the VM snapshot—like relationships between snapshots and child disks for each snapshot—and a flat file (called flat.vmdk) with raw data.
Optionally, you can take a memory snapshot which also captures the memory state of the virtual machine. A memory snapshot also includes a memory state file (with extension .vmsn) that holds the memory of the VM at the time of the snapshot capture. The size of the memory file and the time it takes to capture the memory state depends on the configured maximum memory for the original/parent VM.
In a Hyper-V environment, VM snapshots are called checkpoints. Capturing a new checkpoint creates files with extensions .vmcx, .vmrs and .vmgs in the snapshots folder. The file with extension .vmcx is a binary configuration file, the file with extension .vmrs holds the information about the state of running VMs, and the file with extension .vmgx stores the VM guest state. Other files created when a checkpoint is captured include an RCT file for tracking changes between two consecutive backups, MRT files for data resilience in the event of a failed backup operation, and an AVHDX file that is merged with VHDX file once the checkpoint is deleted.
What Are the Limitations of VMware Snapshots?
The biggest problem of VMware snapshots is that they can affect the performance of a virtual machine, because they utilize the same infrastructure and resources as the parent VM. There are several other limitations to keep in mind when capturing VMware snapshots:
- Capturing VMware snapshots of raw disks, raw device mapping (RDM) physical mode disks, and guest OSs with Internet Small Computer Systems Interface (iSCSI) initiator are not supported.
- Snapshots of powered-on or suspended VMs with independent disks are not supported. The VM must be powered off before capturing the snapshot.
- Capturing snapshots of VMs configured for bus sharing or supporting PCI vSphere Direct Path I/O devices is not supported.
- Snapshots are not recommended to be used as a means of backup and recovery because of their huge disk space consumption and effect on VM performance.
- Capturing snapshots of VMs with hard disks larger than 2 TB can take too much time.
How Do Backups Differ from Snapshots?
Using VM snapshots for backups and recovery is against the best practices for using VM snapshots. This is because they do not meet the criteria for effective backups and recovery points. The major difference is that backups are supposed to be completely independent of the original virtual machine that we need to back up. But VM snapshots basically reside on the same disk space as their parent VM. So, if the physical infrastructure of the parent VM fails, the snapshot will be lost along with the parent VM. On the other hand, a backup stored separately will remain unaffected and can be used to restore the base VM files fully.
Snapshots also take up a lot of disk space. So, storing too many snapshots on the same storage infrastructure can result in performance degradation. By nature, snapshots are meant to be deleted after a certain amount of time. You shouldn’t keep them once the need to roll back to the specific point-in-time state is over; for instance, you should delete them after updates have been successfully performed. If snapshots are kept longer than recommended, they can keep growing in size and will ultimately start causing performance issues.
Parallels RAS Offers a Simple Approach to Managing VDI
Parallels® Remote Application Server (RAS) makes it a lot easier and more straightforward to deploy and manage virtual desktop infrastructure (VDI). Parallels RAS enables administrators to deploy VDI desktops through customized templates quickly. They can create a template once and deploy multiple VMs instantly by simply choosing the template and specifying the number of VMs they wish to create. All they have to do is create a virtual desktop and replicate it as needed, even on the fly.
Through linked clones, Parallels RAS enables administrators to replicate the virtual disk of a VM instead of launching another VM. This way, multiple VMs can share a single software installation and save disk space. What’s more, Parallels RAS supports VMs from different hypervisors, such as Hyper-V and ESXi, and hyperconverged infrastructures, —such as Nutanix Acropolis and Scale Computing HC3. It also allows companies to choose between on-premises, hybrid and multi-cloud infrastructures.
Download a 30-day, free trial of Parallels RAS to experience ultimate flexibility and convenience when implementing a VDI.