Categories
VMware

unable to create a swap file. the value of ‘sched.swap.dir’

 

For the official recommended one from VMware pls follow this link

Storing a virtual machine swap file in a location other than the default in ESX/ESXi (1004082

Issue:

After Storage migration. VM still pointing vswp file in old datastore and unable to power on and issue a following error.

Error : unable to create a swap file. the value of ‘sched.swap.dir’

Solution:

To change the swap file location for a single virtual machine:

  1. Power off the virtual machine.
  2. Unregister the virtual machine. Right-click the virtual machine in the Inventory and choose Remove from Inventory.
  3. Connect to the host using SSH
  4. browse the datastore where virtual machine is resided;
  5. Change directory to the folder where the virtual machine resides:

    cd /vmfs/volumes/datastore_name/virtual_machine_folder/

  6. Edit the virtual machine’s configuration file with a text editor.
  7. Edit vi using commands:
    1. Esc :i
    2. replace the following;
      1. sched.swap.dir = /vmfs/volumes/old_datastore_name/dir_name
      2. sched.swap.dir = /vmfs/volumes/new_datastore_name/dir_name
  8. save the vi file using command “:wq
  9. Register the virtual machine again.
  10. PowerON VM without any error.

 

Note:- Resolve issue for ESXi 6 as well.

It works :).

 

Thanks,

Kabeer Siddiqui