I have recently studied the snapshot-related knowledge of VMware and made a record and share it here.
First, we will briefly introduce the snapshots.
A snapshot preserves the state and data of a virtual machine at a special point in time.
1) the snapshot stores the power state of the VM at a specific time point;
2) there is data. For example, the memory information, so when you make a memory snapshot, the size of the snapshot file. vmsn is almost the same as the memory size you allocated to the virtual machine.
After you take a snapshot, VMWare will create a child disk (sparse disk). After that, the data changes of the virtual machine will be written in this child disk, and the base disk will become read-only.
The base disk and the snapshot file. vmsn can restore the status of the snapshot.
The following is a snapshot configuration file written by a foreigner.
VMware records snapshot information about the current VM in. vmsd file. this file is located with the rest of the virtual machine configuration and vmdk files on the datastore. the file is normally called. vmsd. this file will contain information, even if
Your VM has no snapshots in place.
It is possible that in some cases, ESX fails to properly clean up after previous snapshots were removed. the information for previous snapshots may still be recorded in. vmsd file. the file may indicate that you still have snapshots in pace, although all
Previous snapshots were removed and the dalta files have been merged. when you then try to create a snapshot,. vmsd file will inform the ESX host that there is a delta file in place and that it has to create a second or third delta file. when the ESX host
Interigates the vmfs file system, it's unable to find the snapshot Delta Files specified in the. vmsd file and therefore errors with "An invalid snapshot configuration was detected ."
We need to clear the contents of the. vmsd file in order to create new snapshots.
How to fix the issue
Create a backup copy of the current. vmsd file. then create a new file called. vmsd. this can be done with a single command from the VMware esx cli (service console) once you have browsed to the datastore where the VM resides:
CD/vmfs/volumes ///
MV./. vmsd./. vmsd. Old & touch./. vmsd
Let's just have a look at the commands above
MV: This renames the. vmsd file.
&: This basically tells the CLI that if the "mv" command was executed and completed successfully, only then execute the next part of the command which is "Touch ".
Touch: "Touch" is a Linux Command that simply creates an empty file.
So, with a single line we have renamed (created a backup) our original file and created a new file that has the original file's name.
After the new. vmsd file has been created, it need to be initialised. in order to do so, use the VI client to create a snapshot. once the new snapshot has been created, go ahead and delete the new snapshots again. this will write some information to. vmsd
File:
. Encoding = "UTF-8"
Snapshot. lastuid = "2"
Snapshot. numsnapshots = "0"
Snapshot. Current = "0"
Snapshot0.uid = "2"
Snapshot0.filename = "-snapshot2.vmsn"
Snapshot0.displayname = "maid"
Snapshot0.description = "helper snapshot for online snapshot lidate ."
Snapshot0.createtimehigh = "290676"
Snapshot0.createtimelow = "861410424"
Snapshot0.numdisks = "2"
Snapshot0.disk0. filename = ". vmdk"
Snapshot0.disk0. node = "scsi0: 0"
Snapshot0.disk1. filename = "_ 1. vmdk"
Snapshot0.disk1. node = "scsi0: 1"
Snapshot. need1_lidate = "false"
The issue shoshould now be resolved and snapshots shoshould work as expected.
The Snapshot-related information in VMware is stored in the. vmsd file. Even if no snapshot is created, the file still exists, but there are only two simple lines in the content:
. Encoding = "UTF-8"
Snapshot. lastuid = "2"
VMware uses this file to locate snapshots. Therefore, even if you create n or more snapshots and modify the file again, you may not be able to find these snapshots. Or you do not have a snapshot at all, but the information in this file shows that there is a snapshot, then VMware will still display a snapshot, but when you operate on the snapshot, A message such as "snapshot file configuration error" is displayed.