Migrating virtual machine swap (.vswp) files from one datastore to another
search cancel

Migrating virtual machine swap (.vswp) files from one datastore to another


Article ID: 304593


Updated On:


VMware vSphere ESXi


This article provides steps to migrate the .vswp files without having to power off the virtual machines.

  • By default, if the virtual machine swap files (.vswp) are stored in a ESX/ESXi host swapfile datastore, Storage vMotion does not move these files.
  • Storage vMotion fails to migrate the .vswp files.


To migrate the .vswp file to the same location as the virtual machine:
  1. Ensure that a new datastore is available to all your ESX/ESXi in your cluster.
  2. Configure your ESX/ESXi host to use the destination datastore for the .vswp files of their virtual machines. (To add the Swapfile location for all the hosts in a cluster, you can right-click the cluster, select Edit Settings, select Swapfile location, select Store the swap file in the datastore specified by the host. And at the host level you can select configuration, and select the virtual machine Swapfile location link).
    For more information, see Enable Host-Local Swap for a DRS Cluster in the vSphere Resource Management Guide.
  3. vMotion the virtual machines to another ESX/ESXi host in your cluster. This recreates the .vswp files on the destination datastore.
  4. Optionally, vMotion your Virtual Machines back to the original ESX/ESXi host.

Additional Information

To migrate .vswp file from a datastore containing all the .vswp files to each of the respective VM's working directories:
  1. Change cluster settings to Store swapfile in the same directory as the Virtual Machine.
  2. Confirm in each host's Configuration -> Virtual Machine Swapfile Location set to Virtual Machine directory.
  3. Right click the VM -> Power -> Shutdown guest (do not Reboot the guest or restart from within the Guest OS), and then power back on.
  4. Now the .vswp file is removed from the original vswp datastore and re-created in the VM's working directory.
将虚拟机交换 (.vswp) 文件从一个数据存储迁移到另一个数据存储
データストアの仮想マシン スワップ (.vswp) ファイルを別のデータストアに移行する
Migração de arquivos de permuta de máquinas virtuais (.vswp) de um datastore para outro