Snapshots allow us to save state of virtual machine. Snapshot is not backup. Snapshot can be used when we need to make changes to virtual machines in our environment. We can save a particular state of VM and later we can either revert back to saved state or merge changes to new state. Snapshots should be taken properly, if not I will cause risk not for itself but to other machine in environment also.
There are various stages in snapshot process. To begin with user clicks on VM and click on create snapshot. During this creation phase snapshot list file is updated, state file is created which contains information regarding settings and memory of VM, new delta disk is created for that machine which will store the changes to be made on VM and freeze original virtual disk to prevent corruption and any other damage to original files. After this all the changes made on VM are stored in delta disk. After all the changes to virtual machine are complete we either revert or commit changes to VM using vSphere snapshot manager.
Whenever snapshot is created, there are four files which comes to focus. Files are vmsn, delta.vmdk, vmdk disk descriptor and vmsd file also known as snapshot list file. The current state of VM post snapshot is taken contains different components. These are original VMDK file which is frozen, snapshot list file with various information regarding current state of virtual machine. Vmsn file which contains all the settings of VM and delta. Vmdk which contains all the data post snapshot.
The .vmsd file instructs vSphere as well as snapshot environment. The file contains:
• The name of .vmsn file.
• The snapshot name
• The snapshot description
• Subsequent snapshot files(if exist)
The actual snap shot file is .vmsn file. Vmsn file has all the settings of VM when snapshot was taken. Delta vmdk file has all the changes made post snapshot. If one wants to snapshot the memory of VM then that must be done at the time when snapshot is taken.
There is some issue which could be caused if snapshots are not handled carefully:
• They can absolutely wreck performance in a production environment.
• They are most certainly not backups and should never be used that way.
• They can bloat the size of your VMs, eating up precious SAN space.
Snapshots should be deleted as soon as possible. For database servers the issue could be drastic, as system tries to write multiple files. One should not try to defrag large size systems, it may never end. Snapshots should not be used as backups; one little corruption can damage multiple disks.
Snapshots should be deleted in off hours. Big file systems can take longer time and they can freeze VM for longer time.