VMware Cloud Community
cfox1
Contributor
Contributor
Jump to solution

Unpresenting A LUN In ESXi 5

I know that the proper procedure for removing a LUN from ESXi 5 is to unmount the datastore (which I can do for all hosts in the cluster at the same time) and then to detach the actual SCSI device in the host Storage Adapter panel.  My question is, as VMware's doc doesn't even mention this - is do I need to follow the detach procedure on ALL of my hosts in that cluster, or just one and done?  If all of them (which would seem pointless that VMware includes a way to unmount from all but not detatch from all) is there a good way to script this?

Thanks!

Chris fox

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Hi cfox,

You're correct, to unpresent a LUN from a ESXi 5 host(s), you need to first unmount and then head over to the storage adapter and detach the appropriate device. Unfortunately the actual detach process is on a per host level, which means you need to do this for each and every single host before unpresenting the device via the vSphre Client if you choose to go through the UI. My understanding is that the KB article will be updated to clarify the procedure. There's definitely a way to script this as it can be tedious if you need to unpresent a LUN from several dozen hosts, I hope to be able to share the script I've written very soon using vSphere SDK for Perl to help automate this process and a PowerCLI equivalent will also be available.

View solution in original post

0 Kudos
8 Replies
PUREJOY
Enthusiast
Enthusiast
Jump to solution

Unlike ESX 4.x, unmount just works for removing lun access to ESX server or cluster.

I usually do this from Inventory --> Datastore, find the volume in the list, right click and unmount.

It will do a check to see if there are any VMs that are still active and fail the operation if there is a VM active.

So you do it once and it will gone on the cluster. One click operation.

You can also script it as always.

Architect @ Pure Storage || www.purestorage.com || http://www.purestorage.com/blog/ || http://twitter.com/#!/purestorage ||@ravivenk || VCAP-DCA5, VCP 4, VCP 5
0 Kudos
cfox1
Contributor
Contributor
Jump to solution

Thank you for the reponse, I do know that the unmounting can be done all at the same time (thankfully!).  My question, though, was in regards to the process of detaching the SCSI device under the Storage Adapter.  Per VMware, this needs to be done as well, not just an unmount (though their regular documentation does not state this, a KB article they directed me to after I had an APD event take down some hosts when simply unmounting and nothing else) and I was not sure if that had to happen on all hosts or just one.  Anyone?

Thanks!

Chris

0 Kudos
scottyyyc
Enthusiast
Enthusiast
Jump to solution

After you've unmounted the datastore, you should be able to disconnect the iSCSI connections. You could either do this from the storage adaptor side, or the SAN side. I would probably just remove it from the SAN side, re-scan the controllers in ESXi, and then you'll see the volume is gone completely.

0 Kudos
cfox1
Contributor
Contributor
Jump to solution

Thank you for the response.  I do understand that, however, I was referring to the SCSI device, not an iSCSI connection.  Per VMware, you cannot just unmount the store and remove from the SAN connection/mapping and rescan, it can still cause an APD (and I have experienced that first hand, unfortunately).  Please refer to article 2004605 (why it's not in their main documentation is beyond me, but not all too suprising).  As you can see, you need to detach the SCSI device from teh host, my question really is, do I need to "detach" the device from all hosts in the cluster or just from one.  Their KB article fails to clarify, and I am just looking for someone who can confirm this either way.

Thanks,

Chris

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Hi cfox,

You're correct, to unpresent a LUN from a ESXi 5 host(s), you need to first unmount and then head over to the storage adapter and detach the appropriate device. Unfortunately the actual detach process is on a per host level, which means you need to do this for each and every single host before unpresenting the device via the vSphre Client if you choose to go through the UI. My understanding is that the KB article will be updated to clarify the procedure. There's definitely a way to script this as it can be tedious if you need to unpresent a LUN from several dozen hosts, I hope to be able to share the script I've written very soon using vSphere SDK for Perl to help automate this process and a PowerCLI equivalent will also be available.

0 Kudos
cfox1
Contributor
Contributor
Jump to solution

lawm,

     Thank you, that was the answer I was expecting, I just wanted to make sure before I did any scripting as well unneccessarily.  (and secretly I was hoping someone would say each host was not necessary!).

Thanks again,

Chris

0 Kudos
BrendanMarmont
Enthusiast
Enthusiast
Jump to solution

Are you able to help me, I have removed a lun without umounting it from the Host first. Now I have unresponsive Hosts with live VMs.

Thanks for your help

Brendan

0 Kudos
cfox1
Contributor
Contributor
Jump to solution

Thank you for your message. I will be out of the office from Monday, August 26, 2012 through Thursday, August 30, 2012. I will have limited access to e-mail.

If you need assistance with a technical issue, please contact Ideal Service Desk at 412-349-6678.

For non-technical matters, please contact Al Stasko at astasko@idealintegrations.net or 412-349-6680.

Thank you,

0 Kudos