Cannot unmount and detach a LUN when host's swap is configured to use a datastore
search cancel

Cannot unmount and detach a LUN when host's swap is configured to use a datastore

book

Article ID: 384259

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

User is unable to unmount a datastore from single ESXi host. 
Same operation completed successfully for another ESXi host without issues. 

Environment

ESXi 8.0.3, build 24022510

Cause

Issue is caused due to presence of open file handle on the datastore. 
Similar messages can be seen in the logs, indicating volume being in 'opened' state, with ESXi swap file (sysSwap-ds-####.swp) holding the lock:

unmounting opened volume ('UUID' 'Datastore Label') with ref 2 is not allowed.
File sysSwap-ds-####.swp, fhID: , is opened by world: -
Unmount volume  : Busy

Resolution

ESXi swap file holding the lock should be reconfigured to alternate resource in order to allow datastore unmount. 
This can be achieved by navigating to:

ESXi host > Configure > System > System Swap

and editing swap's location to alternate datastore. This should unblock the possibility to unmount and detach previously locked datastore.