Virtual Insider

Blog archive

How To Properly Un-Present a LUN in ESXi 5

I have recently been working with a customer that was having an issue with ESXi 5, the problem was that the client unpresented a physical LUN to ESXi 5 by simply deleting the datastore and physically removing the LUN from the storage array software. That led to the condition knows as APD (All paths Down).

What happened is while the datastore was deleted, ESXi continued to try and access that device and since ESXi uses hostd to access devices and also uses hostd for ESXi to vCenter communications, that led to a slew of issues. In this blog, I want to focus on the correct way to delete and unpresent a LUN in ESXi 5. Here are the steps:

  1. Unregister all objects from the datastore including VMs and templates.
  2. Ensure that Storage DRS and Storage I/O are not configured to use this device.
  3. Detach the device from ESXi host, which will also initiate an automatic unmount. To do this click on Configuration, and then Storage, find the datastore you wish to unmounts, right-click it and select unmount.
  4. To avoid doing this to every ESXi host, from vCenter do a Ctrl+Shift+D to switch your view to Datastore clusters view. Execute unmounts and choose which hosts you want to unmount this from.
  5. Now, while still under the Storage node, switch your view to Devices, right-click the NAA ID of the device and click on Detach. For more info on finding the NAA ID look up VMware KB2004605.
  6. Now double check that the LUN has been properly unmounted by checking the operational status of the device which should read unmounted.
  7. Physically unpresent the LUN from the storage array controller software.
  8. Perform a rescan of the ESXi host.

Now if you are trying to unmount an RDM, first delete the RDM from the virtual machine and delete from disk, then follow steps 5 to 8.

Posted by Elias Khnaser on 01/25/2012 at 12:49 PM


Subscribe on YouTube