Unable to detach a LUN which was previously used as ESXi boot device
search cancel

Unable to detach a LUN which was previously used as ESXi boot device

book

Article ID: 415420

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • After changing ESXi boot LUNs from Dell SAN to NetApp the original boot LUN is unable to be detached from the ESXi hosts, with an error that it is in use.
  • ESXi host filesystem command #esxcli storage filesystem list shows Bootbank 1 and 2 active from the old LUN.
  • In the UI the old LUN appears under storage devices with Datastore "Not Consumed" and Operational State as "Detached".

Environment

ESXi (all versions) booting from SAN

Cause

ESXi hosts retained references to old boot LUNs in their storage configuration. Occasionally ESXi may retain previous storage device configuration until explicitly instructed to remove.

Resolution

  1. Identify the naa. identifier of the old boot LUNs to remove

  2. List the filesystem on the LUN 
    esxcli storage vmfs extent list | grep naa.identifier
  3. Unmount the filesystem 
    esxcli storage filesystem unmount --volume-label=<datastore name from previous command output>
  4. Disable the LUN with the command:

    esxcli storage core device set --state=off -d <naa of LUN to detach>
  5. Remove the LUN from the host configuration with the command:
    esxcli storage core device remove -d <naa of LUN to detach>
  6. Unpresent the LUN from the storage array and delete

  7. Rescan and Refresh storage from host with the commands:
    esxcli storage core adapter rescan --all 
  8. Verify no reference to the LUN remains on the host

    Note: If the LUN is already unmapped from the array side before following the above steps, reboot the host to clear the references. Refer Pre-unmount/detach checklist 

Additional Information