Understanding svMotion operation on a VM with snapshots

Prior to vSphere 5.0 it was not possible to storage vMotion a VM that is running with snapshots. With 5.0 VMware has enhanced svMotion and included this feature as lot of customers were demanding for that.

But there is one caveat in this feature which many of us don’t know due to lack of documentation on this. I found one very useful article on VMware Blog and thought of sharing with you.

workingDir parameter

The location of a virtual machine’s snapshot redo log file is defined by the virtual machine .vmx file setting workingDir. By default, the workingDir property is the same as the virtual machine’s home directory. What this means is your snapshot is stored in the same directory where your VM base disks are residing.

if you don’t have enough space on datastore where your VM disk is currently placed and you want to take snapshot on that VM, then by use of workingDir parameter you can store snapshot  to another location/datastore.

This is described in detail in KB article 1002929.

Change in workingDir Parameter property in vSphere 5.0

In vSphere 5.0, the workingDir parameter behaviour has been changed and it is no longer used as a pointer to a location for storing snapshot delta disks. The workingDir setting will now only be used to determine the location for the snapshot data (.vmsn) file. The delta disks are now always stored in the same home folder as the base disk.

Now the question is why Vmware has changed the functionality of this setting in vSphere 5.0? The answer is for sake of Storage DRS. This change means that snapshot delta disks now share the same performance, availability and storage consumption characteristics as parent disks, making Storage DRS work more accurately.

It should also be noted that if you do a Storage vMotion of a VM with snapshots and the VM has the workingDir parameter set, the workingDir setting will be removed from the .vmx & the .vmsn snapshot data file will be moved to the home folder of the VM on the destination datastore. However you will get a warning in the migration wizard about this as shown below.

snapshot

Can this new behaviour be changed?

Yes this behavior can be overridden but there is a catch.

If you really want to keep your snapshots on a different datastore to the base disk in vSphere 5.0, there is a new parameter which you must set along with the workingDir parameter. The new parameter snapshot.redoNotWithParent = “TRUE”, must be placed in the VM’s .vmx file. This means that the workingDir parameter setting will now be used as the location for snapshot redo delta disks, as well as the .vmsn.

However the same caveat described above applies in this case – the workingDir setting will be overridden by a Storage vMotion operation, and all snapshot deltas will get migrated to the same folder as the VM’s base disk on the destination. Also, the workingDir setting will be removed from the .vmx file after the migration.

Therefore, if you use the snapshot.redoNotWithParent = “TRUE” parameter, you should refrain from doing Storage vMotion operations. The following warning will appear when a migration is attempted on a VM that has workingDir set in the .vmx file:

snapshot

In fact, this warning also appears if you have just the workingDir setting in the .vmx file as mentioned earlier.

Conclusion

Storage vMotion and Storage DRS both work fine with Virtual Machines that have snapshots, but we should refrain from doing Storage vMotion operations with VMs that have the workingDir & snapshot.redoNotWithParent parameters set in their .vmx in vSphere 5.0.

Share this post on social media if it is informational to you. Happy Learning !!!!

Leave a Reply