Friday, October 19, 2012

Masking a LUN from ESX and ESXi using the MASK_PATH plug-in

Caution: This procedure only applies to LUNs that are being managed by the VMwre NMP multipathing service. If you are using 3rd party multipathing plugin such as Powerpath/VE then LUNs must be excluded from the 3rd party multipathing software and put under NMP control before they can be masked again properly.

To mask a LUN from ESX/ESXi 4.x and ESXi 5.0 using the MASK_PATH plug-in:

Note: Any differences in the commands between ESX/ESX 4.x and ESXi 5.0 will be noted with the version of ESX/ESXi before the command.

  1. Log into a console or SSH session on your host. For more information, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.0 (1017910).
  2. Look at the Multipath plug-ins currently installed on your ESX with the command:

    # esxcfg-mpath -G

    The output indicates that there are, at a minimum, 2 plug-ins: The VMware Native Multipath plug-in (NMP) and the MASK_PATH plug-in (ESXi 5.0 will only show the NMP plugin by default), which is used for masking LUNs. There may be other plug-ins if third-party software (such as EMC PowerPath) is installed. For example:

    # esxcfg-mpath -G
    MASK_PATH
    NMP

  3. List all the claimrules currently on the ESX with the command:

    ESXi 5.0# esxcli storage core claimrule list

    ESX/ESXi 4.x# esxcli corestorage claimrule list

    There are two MASK_PATH entries: one of class runtime and the other of class file.

    The runtime is the rules currently running in the PSA. The file is a reference to the rules defined in/etc/vmware/esx.conf. These are identical, but they could be different if you are in the process of modifying the/etc/vmware/esx.conf.

    Note: There is already a rule of vendor=DELL model=Universal Xport. This means that pseudo or management LUNs with these attributes are masked from the ESX.

    The output from the command is 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
    65535 runtime vendor NMP vendor=* model=*

  4. Add a rule to hide the LUN with the command:

    ESXi 5.0# esxcli storage core claimrule add --rule <number> -t location -A <hba_adapter> -C <channel> -T <target> -L <lun> -P MASK_PATH

    ESX/ESXi 4.x# esxcli corestorage claimrule add --rule <number> -t location -A <hba_adapter> -C <channel> -T <target> -L <lun> -P MASK_PATH

    The parameters -A <hba_adapter> -C <channel> -T <target> -L <lun> define a unique path. You can leave some of them unspecified if the LUN is uniquely defined. The value for parameter --rule can be any number between 101 and 200 that does not conflict with a pre-existing rule number from step 3.

    Note: For a detailed command description, see esxcli corestorage Command-Line Options and vSphere Command-Line Interface Installation and Scripting Guide.

    This is a brief example of usage:

    • Find the naa device of the datastore you want to unpresent with the command:

      # esxcfg-scsidevs -m
      naa.600508b1001037383941424344450300:3 /vmfs/devices/disks/naa.600508b1001037383941424344450300:3 4b44572e-8a1c74b2-42d4-00237dde59b8 0 datastore1
      naa.600601604550250018ea2d38073cdf11:1 /vmfs/devices/disks/naa.600601604550250018ea2d38073cdf11:1 4bb21500-dc941493-2904-00237dde59ba 0 DatastoreToMask

    • Check all of the paths that the naa device has:

      # esxcfg-mpath -b -d naa.600601604550250018ea2d38073cdf11
         vmhba33:C0:T3:L0 state:active Local HBA vmhba33 channel 0 target 3
         vmhba33:C0:T2:L0 state:standby Local HBA vmhba33 channel 0 target 2
         vmhba33:C0:T1:L0 state:active Local HBA vmhba33 channel 0 target 1
         vmhba33:C0:T0:L0 state:standby Local HBA vmhba33 channel 0 target 0

    • As you apply the rule -A vmhba33 -C 0 -L 0, verify that there is no other device with those parameters. You can use the wildcard vmhba33:C0.*L0 (. means any character and * means zero or more times).

      # esxcfg-mpath -L | egrep "vmhba33:C0.*L0"
      vmhba33:C0:T3:L0 state:active naa.600601604550250018ea2d38073cdf11 vmhba33 0 3 0 NMP active san iqn.1998-01.com.vmware:cs-tse-h42-17d4ba81 00023d000001,iqn.1992-04.com.emc:cx.ckm00092300229.b2,t,4
      vmhba33:C0:T2:L0 state:standby naa.600601604550250018ea2d38073cdf11 vmhba33 0 2 0 NMP standby san iqn.1998-01.com.vmware:cs-tse-h42-17d4ba81 00023d000001,iqn.1992-04.com.emc:cx.ckm00092300229.a3,t,3
      vmhba33:C0:T1:L0 state:active naa.600601604550250018ea2d38073cdf11 vmhba33 0 1 0 NMP active san iqn.1998-01.com.vmware:cs-tse-h42-17d4ba81 00023d000001,iqn.1992-04.com.emc:cx.ckm00092300229.b3,t,2
      vmhba33:C0:T0:L0 state:standby naa.600601604550250018ea2d38073cdf11 vmhba33 0 0 0 NMP standby san iqn.1998-01.com.vmware:cs-tse-h42-17d4ba81 00023d000001,iqn.1992-04.com.emc:cx.ckm00092300229.a2,t,1

    • Add a rule for this LUN with the command:

      ESXi 5.0# esxcli storage core claimrule add --rule 192 -t location -A vmhba33 -C 0 -T 0 -L 0 -P MASK_PATH

      ESX/ESXi 4.x# esxcli corestorage claimrule add --rule 192 -t location -A vmhba33 -C 0 -T 0 -L 0 -P MASK_PATH

      Notes:
  5. Verify that the rule is in effect with the command:

    ESXi 5.0# esxcli storage core claimrule list
    ESX/ESXi 4.x# esxcli corestorage claimrule list

    The output indicates our new rule. It is only of class file. You must then load it into the PSA.

    For example:

    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=* lun=0
    65535 runtime vendor NMP vendor=* model=*

  6. Reload your claimrules with the command:

    ESXi 5.0# esxcli storage core claimrule load
    ESX/ESXi 4.x# esxcli corestorage claimrule load
  7. Re-examine your claimrules and verify that you can see both the file and runtime class. Run the command:

    ESXi 5.0# esxcli storage core claimrule list
    ESX/ESXi 4.x# esxcli corestorage claimrule list

    For example:

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

  8. Unclaim all paths to a device and then run the loaded claimrules on each of the paths to reclaim them.

    Note: Unclaiming disassociates the paths from a PSA plugin. These paths are currently owned by NMP. You need to dissociate them from NMP and associate them to MASK_PATH.

    Run the command:

    ESXi 5.0# esxcli storage core claiming reclaim -d naa.id
    ESX/ESXi 4.x# esxcli corestorage claiming reclaim -d naa.id

    Where naa.id is the naa ID used in step 3. This device is the LUN being unpresented. This command 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 example:

    ESXi 5.0# esxcli storage core claiming reclaim -d naa.600601604550250018ea2d38073cdf11
    ESX/ESXi 4.x# esxcli corestorage claiming reclaim -d naa.600601604550250018ea2d38073cdf11
  9. Verify that the masked device is no longer used by the ESX host.

    If you are masking a datastore, perform one of these options:

    • Connect the vSphere Client to the host and click Host > Configuration > Storage, then click Refresh. The masked datastore does not appear in the list.
    • Rescan the host by navigating to Host > Configuration > Storage Adapters > Rescan All.
    • Run the command:

      # esxcfg-scsidevs -m

      The masked datastore does not appear in the list.

      To see all the masked LUNs use the command:

      # esxcfg-scsidevs -c

    To verify that a masked LUN is no longer an active device, run the command:

    # esxcfg-mpath -L | grep naa.id

    For example:

    # esxcfg-mpath -L | grep 600601604550250018ea2d38073cdf11

    Empty output indicates that the LUN is not active.

Note: You may still see a single path to the LUN on one or more storage adapters after following the steps in this article. This disappears after the ESX host is rebooted. As long as the datastore is no longer visible, no issues are being reported in the logs, and rescans are completing in a timely fashion, the residual path can be safely ignored.

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

vSphere 5.1 Release Notes !

vSphere 5.1 is there now:-

This is really great to a have quick look on vSphere 5.1 Release Notes, I took few product support notes from:-


Product Support Notices

  • vSphere Client. In vSphere 5.1, all new vSphere features are available only through the vSphere Web Client. The traditional vSphere Client will continue to operate, supporting the same feature set as vSphere 5.0, but not exposing any of the new features in vSphere 5.1.
    vSphere 5.1 and its subsequent update and patch releases are the last releases to include the traditional vSphere Client. Future major releases of VMware vSphere will include only the vSphere Web Client.
    For vSphere 5.1, bug fixes for the traditional vSphere Client are limited to security or critical issues. Critical bugs are deviations from specified product functionality that cause data corruption, data loss, system crash, or significant customer application down time where no workaround is available that can be implemented.
  • VMware Toolbox. vSphere 5.1 is the last release to include support for the VMware Tools graphical user interface, VMware Toolbox. VMware will continue to update and support the Toolbox command-line interface (CLI) to perform all VMware Tools functions.
  • VMI Paravirtualization. vSphere 4.1 was the last release to support the VMI guest operating system paravirtualization interface. For information about migrating virtual machines that are enabled for VMI so that they can run on later vSphere releases, see Knowledge Base article 1013842.
  • Windows Guest Operating System Customization. vSphere 5.1 is the last release to support customization for Windows 2000 guest operating systems. VMware will continue to support customization for newer versions of Windows guests.
  • VMCI Sockets. Guest-to-guest communications (virtual machine to virtual machine) are deprecated in the vSphere 5.1 release. This functionality will be removed in the next major release. VMware will continue support for host to guest communications.