Configure a swapfile location for the host to determine the default location for virtual machine swapfiles in the vSphere Client.

By default, swapfiles for a virtual machine are located on a datastore in the folder that contains the other virtual machine files. However, you can configure your host to place virtual machine swapfiles on an alternative datastore.

You can use this option to place virtual machine swapfiles on lower-cost or higher-performance storage. You can also override this host-level setting for individual virtual machines.

Setting an alternative swapfile location might cause migrations with vMotion to complete more slowly. For best vMotion performance, store the virtual machine on a local datastore rather than in the same directory as the virtual machine swapfiles. If the virtual machine is stored on a local datastore, storing the swapfile with the other virtual machine files will not improve vMotion.

Prerequisites

Required privilege: Host machine.Configuration.Storage partition configuration

Procedure

  1. Browse to the host in the vSphere Client.
  2. Click Configure.
  3. Under Virtual Machines, click Swap file location.

    The selected swapfile location is displayed. If configuration of the swapfile location is not supported on the selected host, the tab indicates that the feature is not supported.

    If the host is part of a cluster, and the cluster settings specify that swapfiles are to be stored in the same directory as the virtual machine, you cannot edit the swapfile location from the host under Configure. To change the swapfile location for such a host, edit the cluster settings.

  4. Click Edit.
  5. Select where to store the swapfile.
    Option Description
    Virtual machine directory Stores the swapfile in the same directory as the virtual machine configuration file.
    Use a specific datastore Stores the swapfile in the location you specify.

    If the swapfile cannot be stored on the datastore that the host specifies, the swapfile is stored in the same folder as the virtual machine.

  6. (Optional) If you select Use a specific datastore, select a datastore from the list.
  7. Click OK.

Results

The virtual machine swapfile is stored in the location you selected.