What is Quiescing for VMware vSphere VMs?
When creating a snapshot in a VMware vSphere environment, there are two different methods you can follow: taking a memory state snapshot or quiescing the guest file system.
This blog post provides a brief overview of snapshots in VMware vSphere, a comparison between memory state snapshots and quiesced snapshots, and a look at the different functions of quiescing.
Snapshots in VMware vSphere
Taking snapshots of a VM in vSphere enables you to capture the VM’s memory state, disk state, and configuration settings at specific points in time.
VMware snapshots allow you to preserve the state of a VM at a specific point in time. Snapshots capture a VM’s configuration settings, memory state and disk state. With the help of snapshots, you have the ability to restore a VM to the state it was right before a snapshot was taken. For example, if you have just installed an operating system on your VM, you can take a snapshot before applying any changes such as installing updates. Then, after installing updates, if you are dissatisfied with the changes you can revert back to the state when the snapshot was taken.
The process of taking a snapshot is affected by the ongoing activities on a VM. This may cause problems when reverting to a specific previous state. Therefore, snapshots are best taken when a VMis not running I/O-intensive tasks or programs that are constantly communicating with other machines. When a VMvirtual machine communicates with another computer during a snapshot, the risk for error is high. For instance, if a snapshot is taken during the transfer of a file from a server to a VM the file in question appears to be corrupted when you revert back to that snapshot.
Memory State Snapshots vs Quiesced Snapshots
Snapshots preserve the state and data of a VM and create a child disk for the guest operating system to write to. In VMware vSphere, you have the choice to create a memory snapshot to capture the state of a VM or create quiesced snapshots to perform operations on a VM that require a consistent state.
Memory state snapshots
As the default option for taking snapshots in VMware vSphere, a memory state snapshot captures and retains the active state of a virtual machine. With memory snapshots, a running VM can be reverted to the state it was when the snapshot was taken. Memory snapshots are ideally used when you need to save the state of running applications.
During a memory state snapshot capture, the VM is stunned to serialize the VM’s state to disk and close the running disk. To avoid technical complications and failure, it is recommended to steer clear of using memory snapshots in place of true backups.You also have the option to create a snapshot that does not include memory. If you revert to a non-memory snapshot, you are basically doing a hard powering off a VM. For example, if you create a non-memory snapshot while working in a Word document and haven’t saved the file, you lose the content when you revert back to that screenshot.
Memory snapshots take longer to create than non-memory snapshots. The time it takes the host to write the memory to disk is directly related to the amount of memory the VM is configured to use.
Quiescing the guest file system is the process of getting the data on a VM into a state suitable for backups. Backup solutions use VM snapshots to copy data from a VM. The operation of quiescing a VM ensures that a snapshot represents a consistent view of the guest file system state at a specific point in time. A quiesced snapshot suspends or alters the state of ongoing processes on a VM, especially if a particular process may modify stored data during a backup. Quiesced snapshots are best used when you configure a VM for regular backups.
To create a quiesced snapshot in your VMware vSphere environment, you need to have VMware Tools installed and running on the VM.
Here is how vSphere prepares your VM for a quiesced snapshot:
- VMware Tools, using the VMware Snapshot Provider function, creates a new Volume Snapshot Service (VSS) snapshot inside the guest operating system.
- VSS writers prepare active applications for backup.
- Transactions are written from the memory to the disk.
- VSS writers report the completion of the writing process to the VMware Tools Service.
- The system is now all set to take a quiesced snapshot.
Quiescing and Consistency
When backing up a virtual machine, you need to make sure that the file system and application data are brought to a consistent state. This consistency is achieved by quiescing a VM. There are two types of consistency to consider when you are quiescing a VM: file-system consistent and application consistent.
- File-system consistent: A quiesced snapshot is file-system consistent when pending data and file-system changes are written to the disk prior to creating the snapshot. This method helps prevent file-system corruption.
- Application consistent: A quiesced snapshot is application consistent when active applications complete all their tasks and flush their buffers to disk prior to creating the snapshot. This method is ideally used for backing up database applications such as Oracle and SQL.
How to create a Quiesced Snapshot in vSphere
You can create a quiesced snapshot in vSphere 7.0 directly from vCenter by following these steps:
- Select a VM from the inventory. Make sure that it’s powered on.
- Right-click on the display name of the VM, and under Snapshots click Take Snapshot.
- At the bottom of the Take Snapshot screen, Include virtual machine’s memory is selected by default. That’s the option for creating a memory state snapshot. Note that the option for quiescing is greyed out because memory state snapshots and quiesced snapshots can’t be taken simultaneously.
- Deselect Include virtual machine’s memory and check Quiesce guest file system. Click Create.
- Once the snapshot is created, you can see it in the Snapshots tab in the VM’s dashboard. From there, you can revert to that snapshot, edit it, or delete it.
Quiescing your VM guest file system assures that the data in the snapshot is consistent and suitable for backup or replication practices. That said, snapshots by themselves should not be used as backups as they are not meant to be retained for extended periods of time. Also, snapshots are not protected in the case of hardware failure.
Check out our blog post for more information about VM snapshots vs backup.
To backup virtual machine data, you should use a robust third-party solution like NAKIVO Backup & Replication. The solution allows you to perform consistent image-based backups of your VMware vSphere VMs.