Removing LUNs dynamically from an existing target ID

In this case, a group of LUNs is unmapped from the host HBA ports and an operating system device scan is issued. To add subsequent LUNs seamlessly, perform additional steps to cleanup the operating system device tree.

To remove LUNs dynamically from an existing target ID

  1. Prior to any dynamic reconfiguration, ensure that the dmp_cache_open tunable is set to on. This setting is the default.

    # vxdmpadm gettune dmp_cache_open

    If the tunable is set to off, set the dmp_cache_open tunable to on.

    # vxdmpadm settune dmp_cache_open=on
  2. Identify which LUNs to remove from the host. Do one of the following:

    • Use Storage Array Management to identify the Array Volume ID (AVID) for the LUNs.

    • If the array does not report the AVID, use the LUN index.

  3. For LUNs under VxVM, perform the following steps:

    • Evacuate the data from the LUNs using the vxevac command.

      See the vxevac(1M) online manual page.

      After the data has been evacuated, enter the following command to remove the LUNs from the disk group:

      # vxdg -g diskgroup rmdisk da-name
    • If the data has not been evacuated and the LUN is part of a subdisk or disk group, enter the following command to remove the LUNs from the disk group. If the disk is part of a shared disk group, you must use the -k option to force the removal.

      # vxdg -g diskgroup -k rmdisk da-name
  4. For LUNs using HP-UX LVM over DMP devices, remove the device from the LVM volume group.

    # vgreduce vgname devicepath
  5. Using the AVID or LUN index, use Storage Array Management to unmap or unmask the LUNs you identified in step 2.

  6. Remove the LUNs from the vxdisk list. Enter the following command on all nodes in a cluster:

    # vxdisk rm da-name

    This is a required step. If you do not perform this step, the DMP device tree shows ghost paths.

  7. Clean up the HP-UX 11i v3 SCSI device tree for the devices that you removed in step 6.

    This step is required. You must clean up the operating system SCSI device tree to release the SCSI target ID for reuse if a new LUN is added to the host later.

  8. Scan the operating system device tree.

  9. Use VxVM to perform a device scan. You must perform this operation on all nodes in a cluster. Enter one of the following commands:

    • # vxdctl enable
    • # vxdisk scandisks
  10. Refresh the DMP device name database using the following command:

    # vxddladm assign names
  11. Verify that the LUNs were removed cleanly by answering the following questions:

    • Is the device tree clean?

      Verify that the operating system metanodes are removed from the /dev directory.

    • Were all the appropriate LUNs removed?

      Use the DMP disk reporting tools such as the vxdisk list command output to determine if the LUNs have been cleaned up successfully.

    • Is the vxdisk list output correct?

      Verify that the vxdisk list output shows the correct number of paths and does not include any ghost disks.

    If the answer to any of these questions is "No," return to step 5 and perform the required steps.

    If the answer to all of the questions is "Yes," the LUN remove operation is successful.

More Information

Cleaning up the operating system device tree after removing LUNs

Scanning an operating system device tree after adding or removing LUNs