By default, the swap file is created in the same location as the virtual machine's configuration file, which may either be on a VMFS datastore, a vSAN datastore or a VMware vSphere® Virtual VolumesTM datastore. On a vSAN datastore or a vVols datastore, the swap file is created as a separate vSAN or vVols object.

The ESXi host creates a swap file when a virtual machine is powered on. If this file cannot be created, the virtual machine cannot power on. Instead of accepting the default, you can also:

  • Use per-virtual machine configuration options to change the datastore to another shared storage location.
  • Use host-local swap, which allows you to specify a datastore stored locally on the host. This allows you to swap at a per-host level, saving space on the SAN. However, it can lead to a slight degradation in performance for vSphere vMotion because pages swapped to a local swap file on the source host must be transferred across the network to the destination host. Currently vSAN and vVols datastores cannot be specified for host-local swap.