Mask Paths

<

|

You can prevent the host from accessing storage devices or LUNs or from using individual paths to a LUN. Use the esxcli commands to mask the paths. When you mask paths, you create claim rules that assign the MASK_PATH plug-in to the specified paths.

About this task

In the procedure, --server=server_name specifies the target server. The specified target server prompts you for a user name and password. Other connection options, such as a configuration file or session file, are supported. For a list of connection options, see Getting Started with vSphere Command-Line Interfaces.

Prerequisites

Install vCLI or deploy the vSphere Management Assistant (vMA) virtual machine. See Getting Started with vSphere Command-Line Interfaces. For troubleshooting, run esxcli commands in the ESXi Shell.

Procedure

Check what the next available rule ID is.

esxcli --server=server_name storage core 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.

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

esxcli --server=server_name storage core claimrule add -P MASK_PATH

Load the MASK_PATH claim rule into your system.

esxcli --server=server_name storage core claimrule load

Verify that the MASK_PATH claim rule was added correctly.

esxcli --server=server_name storage core claimrule list

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

esxcli --server=server_name storage core claiming unclaim

Run the path claiming rules.

esxcli --server=server_name storage core claimrule run

Results

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.

Masking a LUN

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