Vmware Snapshot

0 views
Skip to first unread message

Smacka Shock

unread,
Aug 3, 2024, 4:27:13 PM8/3/24
to inacypen

A virtual machine provides several operations for creating and managing snapshots and snapshot chains. These operations let you create snapshots, revert to any snapshot in the chain, and remove snapshots. You can create extensive snapshot trees.

Configuring VMware vCenter Server to send alarms when virtual machines are running from snapshots (1018029).

vSphere informs you via the UI if the consolidation part of a Delete Snapshot or Delete All Snapshots operation has failed. The option Consolidate, is available via the Snapshot menu to consolidate the snapshots. For more information about Consolidating/Committing Snapshots in ESXi (1002310)

For more information about Configuring vCenter Server to send alarms when virtual machines are running from snapshots (1018029)

Generally, when you create a snapshot for the first time, the first child disk is created from the parent disk. Successive snapshots generate new child disks from the last child disk on the chain. The relationship can change if you have multiple branches in the snapshot chain.

A VMware snapshot is a copy of a virtual machine (VM) in a VMware environment taken at a specific point in time. Snapshots are useful for restoring a VM to a certain point in the event of a system failure or error. They are not useful for taking VM backups.

A VM snapshot is a point-in-time image of the state and data of a VM. The state refers to whether the VM is powered on, powered off or suspended. A snapshot of the VM can be taken in any of these states. The VM's data includes all its files, components and devices, such as its memory, disks and virtual network interface cards (NICs). When the VM's memory state is captured in a snapshot, the snapshot takes longer to complete and network response might also slow.

To create a backup, a VM can be quiesced -- meaning the VM file system's on-disk data is brought into a state suitable for backups. The operation pauses or alters the state of running processes on the VM. Snapshots alone should not be considered as backup for any virtual disks associated with one or more VMs. Also, running a VM on a snapshot for an extended period might result in system instability and/or data losses.

VMware vSphere is a server virtualization and enterprise workload platform for on-premises and cloud apps that provides users with a centralized management platform for their VMs. The solution includes numerous products, including the following:

The VMware snapshot feature is available on standalone ESXi hosts, vCenter Server and in VMware Workstation. In the vSphere environment, the entire state of the VM is captured when the snapshot is taken. As noted earlier, snapshots can be taken when the VM is on, off or suspended. If the VM is in suspended state, however, VMware advises that the snapshot should be taken only after the suspend operation is complete.

When the VMware snapshot is taken, all writable data on the VM becomes read-only. VMware administrators can take multiple VM snapshots to create multiple possible point-in-time restore points. When a VM reverts to a snapshot, its current disk and memory states are deleted, and the snapshot becomes the new parent snapshot for that VM. The snapshot file cannot exceed the size of the original disk file, and it also requires some overhead disk space. Snapshots will grow rapidly with high disk-write activity volume.

As with VM snapshots in general, vSphere snapshots can be used for development and testing. They also provide a useful failsafe mechanism that enables easy system rollbacks during development, testing, patching or configuration changes.

Taking a VM snapshot is useful for VM development and testing where multiple VMs with similar configurations might be required. Snapshots are also beneficial in development and testing environments where code changes are done iteratively, and a safe rollback point is required to undo mistakes.

Furthermore, a snapshot provides a quick failsafe to roll back to a specific VM state without having to create multiple VMs. This makes snapshots particularly useful in environments where repeated rollbacks might be necessary. Example of this include performing upgrades and making changes to VM settings or configurations. In both cases, the snapshot provides a safe restoration point if changes need to be undone.

VMware Tools refers to a set of services and modules that simplify the management of guest operating systems (guest OSes) and user interactions in vCenter Server and other VMware products. For example, VMware Tools can be used to customize a guest OS, run scripts to automate guest OS operations, and synchronize the system time of a guest OS with the host OS.

VMware Tools can also help with the creation of snapshots via quiescing the file system in the VM. The operation will pause any operation running on the VM, including processes that might modify the VM disk during a revert operation. To quiesce the VM files, the VM must be powered on and have VMware Tools pre-installed. Also, the user creating the snapshot must have VM snapshot management privileges on that VM.

The vSphere Web Client can be used to take new snapshots, remove snapshots and revert to the latest snapshot. The snapshot manager feature can be accessed by right-clicking on the VM in the vSphere client and selecting Snapshots from the VM's Actions drop-down menu.

Instead of right-clicking, the above snapshot operations can also be performed by highlighting the VM name, clicking on the Snapshots tab, and selecting the required task from the All Actions menu.

Since snapshots use the same resources as the parent VM, taking too many of them can affect VM performance. VMware does not support application-consistent quiescing for VMs with integrated development environment or Serial Advanced Technology Attachment (SATA) disks. Snapshots for raw disks, raw device mapping (RDM) physical mode disks, and guest OSes with iSCSI initiators are also not allowed.

In vSphere environments, the size of the VM disk cannot be increased while the VM is running a snapshot during powered on/off status. Also, increasing the disk size or virtual RDM disks when snapshots are available can corrupt snapshots and result in data loss.

VMware recommends deleting snapshots within 24 hours because they take up space as their numbers grow. It is best to keep a single snapshot for less than 72 hours and to limit a snapshot chain to three snapshots, although up to 32 snapshots are supported in a chain. If the chain is to be modified, VMware does not recommend manual modifications as it might compromise the chain and result in data loss.

During the restoration of I/O-intensive VMs with rapid data changes, significant data inconsistencies might occur. For such VMs, it is not advisable to rely on snapshots as a failsafe or backup. For backups, it is best to use a backup software offering in the data center. When using a third-party backup offering, VMware recommends deleting snapshots after a successful backup.

Another good practice is to refrain from using snapshot on production VMs. Snapshots in production environments can result in performance degradation due to CPU overheads and changes in the VM and its guest OS.

Finally, in VMware vSphere environments, the snapshot manager is best for creating, detecting and managing snapshots for individual VMs only. To manage snapshots for multiple VMs, the snapshot manager might not be suitable and third-party snapshot management offerings might be a better choice. However, the snapshots taken by these offerings might not appear in the VMware snapshot manager, so it is important to check for snapshots through the command line.

Many years ago we discovered the hard way that if a VM has a VMware snapshot on it, the NetApp snapshot for the datastore that VM resides on will not include that VM in the backup. This state will persist until the VMware snapshot is removed.

We are now in a situation where someone unfortunately left a VMware snapshot in place during the entirety of our NetApp snapshot retention period, and needed to revert to the VMware snapshot. And worse, the VMware snapshot revert didn't go well. We ended up finding a way to clean up the restored VM but this all got me to thinking.

Maybe things have changed? I noticed the SnapCenter wizard actually includes the VM in it's restore options, just like any other VM. Has the limitation been removed? Can restores be done with any VM, regardless of whether there's a VMware snapshot attached or not? Can anyone provide insight on this topic? Thanks in advance!

I am not sure why you had issues in the past. A NetApp volume snapshot is a point in time copy of the volume. All the blocks that are in use are locked. It does not matter if the snapshot was created with an application or a scheduled snapshot. While there could be issues with backup applications. The snapshot will contain any VM in a crash consistent state. We can recover a VM from a volume manually. Please let me know if you have questions. Below are KBs that will help with manual recovery.

Thank you @NetApp_SR . I've done the manual restore process in the past when SnapCenter (or VSC previously) wouldn't work for some reason (ours is an NFSv3 environment). However I'm pretty sure we were explicitly told by NetApp Support back in 2014 - 2015 or so that the reason we couldn't recover a VM one particular time was the existence of a VMware snapshot on that VM. We established a policy as a result that we don't retain VMware snapshots beyond a couple of hours if we use them, but obviously that information got lost with some newer folks. I'm also pretty sure that I raised the question again a few years later and it was confirmed that this was still the case. Maybe it is not the case anymore? Or maybe both parties previously missed something and this was not the issue all along??

I'm looking for a script that can give a report of all snapshots that have been created and removed in the past 48 hours on all datastores. Basiclly what I'm trying to do is set up time line of our backups for when snapshots are created on each VM and what datastore the snapshot was created on and the size of the snapshot. The issue we have is our datastores are grossly over provissioned (setup before I started here) and no budget for additional storage at this time. We have been having issue with datastores filling up during backups due to snapshots. I'm looking at changing the location of where the snapshots are created to a dedicated LUN different from the default Virtual Machine folder. I want to get a idea of when the snapshots are being created, Size of the snapshot, when removed, in a 48 hour window.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages