In previous post, we discussed about VMware Snapshots.
Every time we create a snapshot, it creates multiple files which are stored in a virtual machine directory for which the snapshot have been taken. We can store the snapshot files in a different directory than VM directory if desired. These files can be viewed in Datastore Browser after navigating to a VM’s folder and from ESXi command line.
In this post, let's have a quick look at the snapshot files.
A Take Snapshot operation creates .vmdk, -delta.vmdk, .vmsd, and .vmsn files.
Delta disk files (--delta.vmdk)
A .vmdk file to which the guest operating system can write. The delta disk represents the difference between the current state of the virtual disk and the state that existed at the time that the previous snapshot was taken. When you take a snapshot, the state of the virtual disk is preserved, the guest operating system stops writing to it, and a delta or child disk is created.
A delta disk has two files. One is a small descriptor file that contains information about the virtual disk, such as geometry and child-parent relationship information. The other one is a corresponding file that contains the raw data.
The files that make up the delta disk are called child disks or redo logs.
Descriptor file
.vmdk are the descriptor file and it defines the structure of the –flat.vmdk disks (where the data live). As mentioned above, in case of snapshot, each delta disk has one descriptor file associated with it which contains all the information about snapshot delta file.
A collection of .vmdk and -delta.vmdk files for each virtual disk is connected to the virtual machine at the time of the snapshot. These files are usually referred to as child disks or delta links. These child disks can later be considered parent disks for future child disks. From the original parent disk, each child constitutes a delta pointing back from the present state of the virtual disk, one step at a time, to the original.
Prior to vSphere 6.5, if the virtual disk is larger than 2TB in size, the delta file is of --sesparse.vmdk format.
However with VMFS6 all snapshots will be sesparse regardless of the size. SEsparse format has some enhancement as compared to VMFSsparse. It is space efficient and supports space reclamation. With support from VMware Tools running in the guest operating system, blocks that are deleted by the guest file system are marked and commands are issued to the SEsparse layer in the hypervisor to unmap those blocks. This helps to reclaim space allocated by SEsparse once the guest operating system has deleted that data.
As you can see in the above image, when I created the Snapshot on a Virtual machine 'TestVM' which is running on ESXi 6.7 and VMFS 6, the delta disk format is 'TestVM-000001-sesparse.vmdk' and not 'TestVM-000001-delta.vmdk'.
Flat file
A -flat.vmdk file that is one of two files that comprises the base disk. The flat disk contains the raw data for the base disk. This file does not appear as a separate file in the Datastore Browser.
Database file
A .vmsd file that contains the virtual machine's snapshot information and is the primary source of information for the Snapshot Manager. This file contains line entries, which define the relationships between snapshots and between child disks for each snapshot.
Memory file
A .vmsn file that includes the active state of the virtual machine. Capturing the memory state of the virtual machine lets you revert to a turned on virtual machine state. With nonmemory snapshots, you can only revert to a turned off virtual machine state. Memory snapshots take longer to create than nonmemory snapshots. The time the ESXi host takes to write the memory onto the disk depends on the amount of memory the virtual machine is configured to use.
A .vmsn file is created each time you take a snapshot, regardless of the memory selection. A .vmsn file without memory is much smaller than one with memory.
It is important to note that if a virtual machine is running on a snapshot, it is making changes to a child disk. The more write operations made to this disk, the larger it grows, to an upper limit of the size of the base disk plus a small amount of overhead. These child disks are known to grow large enough to fill an entire datastore and hence it's a best practice to limit the number of snapshot to 2-3 on a single VM.
Further details regarding snapshot files can be found here.
That's it for now.
Thank you for reading!
*** Explore | Share | Grow ***
Comments