Stale Virtual Machine Swapfile location in ESXi

While attempting to configure Virtual Machine Swapfile location in ESXi, I get an error
The object has already been deleted or has not been completely created“.

In vCenter, after navigating to Configuration-> Virtual Machine Swapfile location, the “Edit” is greyed out disallowing me to configure the swapfile location.

The problem is, it was pointing to a datastore that is no longer mounted.
Ssh to the host:

~ # grep -i HostLocalSwapDir  /etc/vmware/esx.conf
/adv/Mem/HostLocalSwapDir = "/vmfs/volumes/0391a5b2-65784bc7"
/adv/Mem/HostLocalSwapDirEnabled = "1"
~ # ls -l /vmfs/volumes/0391a5b2-65784bc7
ls: /vmfs/volumes/0391a5b2-65784bc7: No such file or directory

The host has been re-purposed from a different cluster and its datastores had been unmounted, including the swap datastore. To fix this

1) vi /etc/vmware/esx.conf and I replaced the stale datastore with the new swap datastore. This did not resolve the issue

2) Next I restarted hostd “/etc/init.d/hostd restart” after which I could configure the swapfile location from the vCenter GUI.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s