VMware Cloud Community
SJDewar
Contributor
Contributor
Jump to solution

Cluster Settings - Swapfile Location

Hi,

Running vSphere 5.5.

Just now the 'Swapfile Location' setting for our Cluster is 'Store the swapfile in the datastore specified by the host'.  Can this be changed to 'Store the swpafile in the same directory as the virtual machine' without affecting the running virtual machines or bringing everything crashing down?

Cheers,

Scott.

1 Solution

Accepted Solutions
rcporto
Leadership
Leadership
Jump to solution

You can change the swap location without impact, but take in mind that you may need power off and power on the virtual machine to changes take effect.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto

View solution in original post

Reply
0 Kudos
4 Replies
rcporto
Leadership
Leadership
Jump to solution

You can change the swap location without impact, but take in mind that you may need power off and power on the virtual machine to changes take effect.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
Reply
0 Kudos
SJDewar
Contributor
Contributor
Jump to solution

Thanks for the info Smiley Happy

Reply
0 Kudos
SavkoorSuhas
Expert
Expert
Jump to solution

Scott,

As far as I am aware, a reboot of VMs is not required.

Suhas

If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points.

Don't Backup. Go Forward!
Rubrik

Reply
0 Kudos
rcporto
Leadership
Leadership
Jump to solution

To make the change is not required reboot the VMs, but to change takes effect is necessary power of and power on the virtual machine, since the .swap files are created when virtual machine is powered on. Restart the virtual machine at the guest OS level is not sufficient.

The KB VMware KB: Storing a virtual machine swap file in a location other than the default in ESX/ESXi talks about this, see:

To edit the virtual machine swap file location in ESXi/ESX 3.5, 4.x, and ESXi 5.x:

  1. Connect directly to your host or to your vCenter Server using the VMware Infrastructure/vSphere Client.
  2. Click the Configuration tab for the ESXi/ESX host.
  3. Click Virtual Machine Swapfile Location and click Edit.
  4. Specify the datastore where you want to store the virtual machine swap files.
  5. To complete the action the virtual machine will need to be powered off, then powered on.
  6. Ensure the swap file is located on the specified host datastore.

Another reference: Specify a Nonreplicated Datastore for Swap Files

Procedure

1 In the vSphere Client, right-click an ESXi cluster and click Edit Settings.

2 In the Settings page for the cluster, click Swapfile Location, select Store the swapfile in the datastore specified by the host, and click OK.

3 For each host in the cluster, select a nonreplicated datastore.

a Select a host and click the Configuration tab.

b In the Software panel, click Virtual Machine Swapfile Location, and click Edit at the top right of the main panel.

c On the Virtual Machine Swapfile Location page, select a nonreplicated datastore and click OK.

4 For standalone hosts that are not part of a cluster, select the host and click the Configuration tab.

5 In the Software panel, click Virtual Machine Swapfile Location, and click Edit at the top right of the main panel.

6 Select Store the swapfile in a swapfile datastore selected below, select the datastore, and click OK.

7 Power off and power on all of the virtual machines in the cluster.

  Resetting the guest operating system is not sufficient. The change of swapfile location takes effect after you power off then power on the virtual machines.

8 Browse the datastore that you selected for swapfiles and verify that VSWP files are present for the virtual machines in the cluster.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto