How vSphere VM Snapshot Works? What are Parent and Child Disks?

1. How do vSphere VM snapshots work?

VMware API allows to perform operations with virtual machines and their snapshots.

Following are common operations that can be performed on virtual machines and snapshots using VMWARE API.

  • Create Snapshot: Creates a new snapshot of a VM or updates the current snapshot if exists.
  • Remove Snapshot: Removes a snapshot from snapshot tree and deletes associated storage.
  • Remove All Snapshots: Remove all snapshots associated with a virtual machine.
  • Revert To Snapshot: Changes the execution state of a virtual machine to the state of this snapshot. This is achieved by Go To option under the Snapshot Manager while using vSphere/VI client GUI.
  • Consolidate: Merges the hierarchy of redo logs. Available in vSphere 5.x only.

2. How Snapshot requests are processed?

 

  • A request to create, remove, or revert a snapshot for a virtual machine is sent from the client to the server using the VMware API.
  • The request is forwarded to the VMware ESX host that is currently hosting the virtual machine in question.

 

Note: This only occurs if the original request was sent to a different server, such as vCenter, which is managing the ESX host.

 

  • If the snapshot includes the memory option, the ESX host writes the memory of the virtual machine to disk.

 

Note :The virtual machine is stunned throughout the duration of time the memory is being written. The length of time of the stun cannot be pre-calculated, and is dependent on the performance of the disk in question and the amount of memory being written. ESX/ESXi 4.x and later have shorter stun times when memory is being written.

 

  • If the snapshot includes the quiesce option, the ESX host requests the guest operating system to quiesce the disks via VMware Tools.

 

Note: Depending on the guest operating system, the quiescing operation can be done by the sync driver, the vmsync module, or Microsoft’s Volume Shadow Copy (VSS) service. For more information on quiescing.

 

  • The ESX host makes the appropriate changes to the virtual machine’s snapshot database (.vmsd file) and the changes are reflected in the snapshot manager of the virtual machine.

 

Note: When removing a snapshot, the snapshot entity in the snapshot manager is removed before the changes are made to the child disks. The snapshot manager does not contain any snapshot entries while the virtual machine continues to run from the child disk.

 

  • The ESX host calls a function similar to the Virtual Disk API functions to make changes to the child disks (-delta.vmdk and .vmdk files) and the disk chain.

 

Note: During a snapshot removal, if the child disks are large in size, the operation may take a long time. This can result in a timeout error message from either VirtualCenter or the VMware Infrastructure Client. For more information about timeout error messages.

3. Snapshot Parent & Child Disks

  • The Parent Disks

Once you create first VM Snapshot, the VM disk becomes as Parent Disk and Sparse disk is created to accommodate delta changes. This Sparse disk is also called as Child. Once you create additional snapshot the last Child disk plays role of Parent disk and so ON.

  • The Child Disks

This is the sparse disk created during vSphere snapshot operation. Sparse disks employ the copy-on-write (COW) mechanism, in which the virtual disk contains no data in places, until copied there by a write. This optimization saves storage space. The grain is the unit of measure in which the sparse disk uses the copy-on-write mechanism. Each grain is a block of sectors containing virtual disk data. The default size is 128 sectors or 64KB.

15+ years of IT experience, MCP, MCTS, MCSA (Win 2012), MCT, PMP, ITIL, Cisco Unity Support, VCP 3/4/5, VCAP-DCD, VCAP-DCA Certified

Posted in Virtualization, Virtualization Environment Backup

Leave a comment

Chetan Pisal, VCP 3/4/5. VTSP, VCAP-DCD, MCT, PMP

Chetan Currently Reading
Chetan Will Read
Blog Stats
  • 54,883 hits