new1234.jpg
Home > VMware > VMware: Creating snapshots in a different location than default virtual machine directory (1002929)

VMware: Creating snapshots in a different location than default virtual machine directory (1002929)

All snapshots are created in the default virtual machine directory. Even if the vmdk disk file is located on different datastore than the virtual machine, the delta files are created in the default virtual machine directory.

This article provides instructions to change the default location.

Changing the location of where the delta files are created is helpful if you need to:

  • Create a snapshot but do not have enough space on the VMFS volume
  • Power on a virtual machine but there is not enough space to create a swap file on the VMFS volume
    To change the default location:
  1. Power off the virtual machine.
  2. Add the following line to the VMX configuration file for the virtual machine:
    workingDir="<new_path_location>"
    For example:
    workingDir="/vmfs/volumes/46f1225f-552b0069-e03b-00145e808070/vm-snapshots"
  3. To reload virtual machine configuration, run the command:
    # vimsh -ne "vmsvc/reload <VmId>"
    When you power on the virtual machine, snapshot files and VSWP files are created in the new location.

Note: If you do not want to redirect the virtual machine’s swap file, add the following line to the VMX configuration file, then reload the configuration:
sched.swap.dir="<path_to_vm_directory>"

When you power on the virtual machine, the swap file is created in the same directory as virtual machine.

Source: 1002929
Categories: VMware Tags: , , , ,
  1. Ludovic
    June 17th, 2009  (Quote) at 09:25  (Quote) | #1

    Hello,

    Thanks it’s work find,

    It’s possible to set this parameter for all cluster,
    I can set the SwpaFile location, but i don’t know if the snapshot dir fowlow the swapfile dir.
    Thanks

    Ludovic

  2. Alberto
    July 21st, 2011  (Quote) at 11:10  (Quote) | #2

    i have the problem of primary datastore space
    and i try to set snapshot path in other datastore
    i have only a nas configured in nfs mode as second datastore and i have changed the path of snapshot in /nfs/nasdatastore/snapshot ( folder snapshot created for do this)

    can i use also this path as datastore path ?

    i can i view if is work correct ?

    Thanks Alberto

  1. No trackbacks yet.