To change the default virtual machine working directory location for snapshots:
- Power off the virtual machine
- Open the virtual machine's .vmx configuration file in a text editor. For more information, see Tips for editing a .vmx file (1714)
- Add a line to the .vmx configuration file for the virtual machine, specifying a full path for the workingDir option:
workingDir = "new_path_location"
workingDir = "/vmfs/volumes/46f1225f-552b0069-e03b-00145e808070/vm-snapshots"
This ensures that subsequently created snapshots will cause new virtual disk redolog (-delta.vmdk) files to be created in the defined directory.
- (Optional) If the virtual machine has not been powered on previously, a new swap file is created in the virtual machine's working directory or the host's when the virtual machine is powered on. If the virtual machine writes its swap file in the same directory as the virtual machine's .vmxconfiguration file, add this line to the .vmx configuration file:
sched.swap.dir = "path_to_vm_directory"
This ensures that the swap file is created in the same directory as the virtual machine's .vmx configuration file instead of in the virtual machine's working directory.
- Save the changes and close the virtual machine's .vmx configuration file.
Note: If you are using ESXi 5.0 or 5.1 you will also need to specify that the redolog (-delta.vmdk) file are not placed on the parent disk of the VM as they normally would be. Follow below steps.
To specify snapshot delta files should be kept in the same directory as the location specified in the workingDir parameter, you must add the new parameter snapshot.redoNotWithParentto the virtual machine's configuration file.
To modify the snapshot storage location:
1. Ensure that the virtual machine is powered off.
2. Right-click the virtual machine and click Edit Settings.
3. Click the Options tab.
4. In the Advanced Options, click General.
5. Click Configuration Parameters.
6. Click Add Row.
7. In the Name field, type snapshot.redoNotWithParent.
8. In the Value field, type true.
9. Find the workingDir field in the list. If it does not exist, create it.
10. In the Value field, verify and ensure that you have a valid datastore path. This value usually starts with /vmfs/volumes/.
11. Click OK to save the configuration parameters.
12. Click OK to save the virtual machine settings.
13. Power on the virtual machine.
Note: If you are performing a storage vMotion or storage migration of a virtual machine that has its working folder set to a location other than the virtual machine directory, this change is not maintained and you must reconfigure it as necessary.
Reload the virtual machine configuration by unregistering and re-registering it in the inventory. For more information, see Registering or adding a virtual machine to the inventory (1006160).
Power on the virtual machine.