Knowledge Base

The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
 
Search the VMware Knowledge Base (KB)   View by Article ID
 

Unpresenting a LUN containing a datastore from ESX 4.x and ESXi 4.x

Purpose

This article provides steps for unpresenting a LUN containing a datastore from an ESX 4.x or ESXi 4.x host without removing the contents of the datastore.
 
Note: The way ESX rescans storage has changed with patch ESX400-200912401-BG. For more information, see:

Resolution

To unpresent a LUN containing a datastore from an ESX 4 host:
 
Note: These steps must be performed using the VMware ESX service console or the vSphere command line. These steps cannot be performed using the Manage Paths dialog in vSphere Client.
  1. Stop using the datastore:
    1. Unregister all objects (such as virtual machines and templates) stored on the datastore from the inventory.
    2. Ensure there are no 3rd party scripts or utilities running on service console which could access the LUN in question.
       
  2. Follow the steps in Masking a LUN from ESX and ESXi 4.x using the MASK_PATH plug-in (1009449) for every host that has visibility to the datastore.
  3. When the LUN is masked from all the hosts, unpresent the LUN. For more information, contact your storage array vendor.

    Note: Ensure that the correct LUN is unpresented by verifying the naa id on the host and the array.

  4. Perform a rescan on all of the ESX hosts that had visibility to the LUN. If all of the hosts are in a cluster, right-click on the cluster and click Rescan for Datastores.
  5. Perform the following steps for every host that had visibility to the LUN:
    1. Remove the rule created in step 2 with the command:

      # esxcli corestorage claimrule delete --rule 192
        
    2. Run the following command to list the existing claimrules:

      # esxcli corestorage claimrule list

      For example:

      # esxcli corestorage claimrule list
      Rule Class Type Plugin Matches
      0 runtime transport NMP transport=usb
      1 runtime transport NMP transport=sata
      2 runtime transport NMP transport=ide
      3 runtime transport NMP transport=block
      4 runtime transport NMP transport=unknown
      101 runtime vendor MASK_PATH vendor=DELL model=Universal Xport
      101 file vendor MASK_PATH vendor=DELL model=Universal Xport
      192 runtime location MASK_PATH adapter=vmhba33 channel=0 target=* lun=0
      65535 runtime vendor NMP vendor=* model=*

       
    3. Reload the claim rules with the command:

      # esxcli corestorage claimrule load
       
    4. Verify that the created rule is totally deleted.

      # esxcli corestorage claimrule list

      For example:

      # esxcli corestorage claimrule list
      Rule Class Type Plugin Matches
      0 runtime transport NMP transport=usb
      1 runtime transport NMP transport=sata
      2 runtime transport NMP transport=ide
      3 runtime transport NMP transport=block
      4 runtime transport NMP transport=unknown
      101 runtime vendor MASK_PATH vendor=DELL model=Universal Xport
      101 file vendor MASK_PATH vendor=DELL model=Universal Xport
      65535 runtime vendor NMP vendor=* model=*

    5. Run this command to unclaim each path to the masked device:

      # esxcli corestorage claiming unclaim -t location -A vmhba0 -C 0 -T 0 -L 2

      This ensures that all paths to the device are unclaimed successfully before running the claim. Update vmhba, controller, target and LUN number as required.

      Note: The esxcli corestorage claiming unclaim --type location vmhba1 command to unclaim paths might result in issues if the unclaim for one of the paths times out. Therefore, VMware recommends you to use the esxcli corestorage claiming unclaim --type plugin --plugin MASK_PATH command to unclaim paths.

    6. Perform a rescan on all of the ESX hosts that had visibility to the LUN. If all of the hosts are in a cluster, right-click the cluster and click Rescan for Datastores. Previously masked LUNs should now be accessible to the ESX host.

Tags

LUN-masking-MASK_PATH

See Also

Update History

13/04/2011 - Updated Steps. 03/06/2010 - Updated steps. 11/08/2010 - Added 4.1 products to KB 10/17/2011 - Added note in Step 3 to ensure that the correct LUN is unpresented

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback


Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (4000 or fewer characters)
Actions