ahautomation
Contributor
Contributor

ESXi 6.5, 6.7 issue?!? Swap datastore not used

Dear VMWare community,

Before in version 5.5 i have no issue, but now in 6.5 and also 6.7 my swap datastore is not used by the VM's.

I got this issue with an new installation at a customer, so i created a test setup, where i also have the same issue.

My Hypervisor is stand-alone. HPE Customized Image ESXi 6.7.0 version 670.10.3.5 released on September 2018 and based on ESXi 6.7.0 Vmkernel Release Build 9484548.

I have 2 datastores, one for the VM, one for the swapping.

VM name = WinSrv with 4GB RAM.

Below: Host \ Manage \ System \ Swap \ Edit Settings, i have set the following settings:

Enabled: Yes

Datastore: datastoreSwap

Host cache: Yes

Local swap: Yes

(VM is restarted)

On the datastoreSwap there is only the sysSwap.........swp

The WinSrv.....vswp of the VM is still at the datastore of the VM.

At the settings of the VM, when u go to VM Options. below at Advanced.

The settings is set to: Default (Use the setting of the cluster or host containing the virtual machine)

It does not matter if i change this to: Datastore specified by host.

I also couldn't find any errors that the datastoreSwap could not be used or anything.

allot of documentation is or old or for vCenter, because i dont have the following "buttons"

The following doc says its for 6.5 but this version does not have vSphere Web Client navigator anymore...Configure System Swap

The following doc says its for 6.7 but this version does not have cSphere Client anymore... Configure Virtual Machine Swapfile Properties for the Host

hopefully someone can help me.

6 Replies
ahautomation
Contributor
Contributor

I found a work-around by following this KB: VMware Knowledge Base

1. I unregistered the VM.

2. I downloaded the .vmx and added the following line:

sched.swap.dir = /vmfs/volumes/datastore_name/dir_name

also created the 'dir_name' otherwise u receive a 'monitor loop' error.

3. uploaded the .vmx backup and registered the VM.

The Swap file is now on the datastoreSwap, the right location as i had already configured in the global swap location.

I am under the impression that this is a bug and that this has to be solved by VMware!

ahautomation
Contributor
Contributor

It is also possible to just edit the parameters.

Edit Settings \ VM Option \ Advanced \ Configuration Parameters - Edit Configuration

add the parameter:

Key: sched.swap.dir

value: /vmfs/volumes/datastore_name/dir_name

ldehaan9
Contributor
Contributor

Thanks a bunch, ahautomation. Worked perfectly for me.

Seems somewhat confusing to have the swap file location be only configurable from the base GUI pages for the host. Perhaps it would be nice if one could designate a swap file location during host setup, or maybe guest setup. Not familiar with true enterprise deployment though. vCenter server or one of its colleagues might make this trivial.

0 Kudos
scottm264
Contributor
Contributor

This also fixed my issue, as all of the built in configurations will not resolve this on a standalone ESXi 6.5 Update 3 host.

I couldn't expand my Memory on this VM until I was able to relocate the swap to a Datastore with more Free space.

Thank you!!!

0 Kudos
erickrog28
Contributor
Contributor

I had the same problem with generating the SWAP file, add the line to the configuration file and it was solved, I have the version of ESXi 6.7.0 (Build 8169922) and the official KB of VMware does not work, I hope to solve the problem in versions most recent

0 Kudos
motaba
Contributor
Contributor

Actually you need both :

 

sched.swap.dir = /vmfs/volumes/ds-swap-256g-ssd
sched.swap.vmxSwapDir = /vmfs/volumes/ds-swap-256g-ssd

 

Best,

motaba

0 Kudos