You can prevent the ESX/ESXi host from accessing storage devices or LUNs or from using individual paths to a LUN. Use the vSphere CLI commands to mask the paths.

When you mask paths, you create claim rules that assign the MASK_PATH plug-in to the specified paths.

1

Check what the next available rule ID is.

esxcli corestorage claimrule list

The claim rules that you use to mask paths should have rule IDs in the range of 101 – 200. If this command shows that rule 101 and 102 already exist, you can specify 103 for the rule to add.

2

Assign the MASK_PATH plug-in to a path by creating a new claim rule for the plug-in.

esxcli corestorage claimrule add -P MASK_PATH

For information on command-line options, see esxcli corestorage claimrule Options.

3

Load the MASK_PATH claim rule into your system.

esxcli corestorage claimrule load

4

Verify that the MASK_PATH claim rule was added correctly.

esxcli corestorage claimrule list

5

If a claim rule for the masked path exists, remove the rule.

esxcli corestorage claiming unclaim

6

Run the path claiming rules.

esxcli corestorage claimrule run

After you assign the MASK_PATH plug-in to a path, the path state becomes irrelevant and is no longer maintained by the host. As a result, commands that display the masked path's information might show the path state as dead.

In this example, you mask the LUN 20 on targets T1 and T2 accessed through storage adapters vmhba2 and vmhba3.

1
#esxcli corestorage claimrule list
2
#esxcli corestorage claimrule add -P MASK_PATH -r 109 -t location -A vmhba2 -C 0 -T 1 -L 20 
#esxcli corestorage claimrule add -P MASK_PATH -r 110 -t location -A vmhba3 -C 0 -T 1 -L 20 
#esxcli corestorage claimrule add -P MASK_PATH -r 111 -t location -A vmhba2 -C 0 -T 2 -L 20 
#esxcli corestorage claimrule add -P MASK_PATH -r 112 -t location -A vmhba3 -C 0 -T 2 -L 20
3
#esxcli corestorage claimrule load
4
#esxcli corestorage claimrule list
5
#esxcli corestorage claiming unclaim -t location -A vmhba2 
#esxcli corestorage claiming unclaim -t location -A vmhba3
6
# esxcli corestorage claimrule run