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

To unpresent a LUN containing a datastore from an ESX 4 host:

1. Ensure that there is no I/O operations being done to the LUN.

The best method of doing this is:

· Ensure there are no virtual machines running on a datastore located on the LUN in question.

· Ensure there are no 3rd party scripts or utilities running on service console which could access the LUN in question.

2. Log into the ESX host as a root user via the console or via SSH.

For more ESX information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).For more ESXi information, see vSphere Command-Line Interface Documentation.

3. To list the existing claimrules, run the command:

esxcli corestorage claimrule list

The output appears similar to:

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=*

4. Run the command:

esxcli corestorage claimrule add –rule 192 -t location -A –C –T –L -P MASK_PATH

For more information about the adapter, target, and LUN values, see Identifying disks when working with VMware ESX (1014953).

Note: The number used in the –rule 192 portion can be any number between 101 and 200 that does not conflict with a pre-existing rule number from step 3.

5. To list the existing claimrules, run the command:

esxcli corestorage claimrule list

The output appears similar to:

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 file location MASK_PATH adapter=vmhba33 channel=0 target=0 lun=25
65535 runtime vendor NMP vendor=* model=*

Note: In the above example, the line beginning with 192 indicates that Adapter 33, Channel 0, Target 0, and LUN 25 has been masked from the ESX host.

6. To reload the claim rules, run the command:

esxcli corestorage claimrule load

7. Run the command:

esxcli corestorage claiming reclaim -d

The field represents the LUN being unpresented. This attempts to unclaim all paths to a device and runs the loaded claimrules on each of the paths unclaimed to attempt to reclaim them. For more information about the NAA identifier, see Identifying disks when working with VMware ESX (1014953).

8. Repeat steps 1 to 7 for any host which also has visibility to the LUN in question.

9. Unpresent the LUN using the suggested method from your storage array vendor.

10. Perform a rescan on all of the ESX hosts which had visibility to the LUN in question.

11. To remove the rule from the ESX host, run the command:

esxcli corestorage claimrule delete –rule 192

Note: Refer to the rule number created in step 4.

12. Run the following command to list the existing claimrules. Compare with the output from step 5.

esxcli corestorage claimrule list

Note: The rule created in step 4 is no longer visible.

13. To reload the claim rules, run the command:

esxcli corestorage claimrule load

14. Repeat steps 11 and 13 on all of the ESX hosts that also have visibility to the LUN in question.

Note: The operation must be done using the VMware ESX service console or the vSphere command line.This operation cannot be done using the Manage Paths dialog within the vSphere Client.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1015084

Advertisements

Leave a comment

Filed under VMware

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s