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. The device scan recognizes the LUNs and adds them to DMP control. To add subsequent LUNs seamlessly, perform additional steps to cleanup the operating system device tree.

The high-level procedure and the VxVm commands are generic. However, the operating system commands may vary depending on the Linux version. For example, the following procedure uses Linux Suse10.

To remove LUNs dynamically from an existing target ID

  1. 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.

  2. Evacuate the data from the LUNs from the Volume Manager.

    See the vxevac(1M) online manual page.

  3. Remove the LUNs from the disk group. Do one of the following:

    • If the data has been evacuated, enter the following command:

      # vxdg -g diskgroup rmdisk da-name
    • If the data has not been evacuated and the LUN is part of a subdisk or diskgroup, enter the following command. 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. Using the AVID or LUN index, use Storage Array Management to unmap or unmask the LUNs you identified in step 1.

  5. Remove the LUNs from the vdisk 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.

  6. Clean up the Linux SCSI device tree for the devices that you removed in step 5.

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

  7. Scan the operating system device tree.

  8. Use Volume Manager 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
  9. 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 /sys/block 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 4 and perform the required steps.

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

More Information

Reconfiguring a LUN online that is under DMP control

Cleaning up the operating system device tree after removing LUNs

Scanning an operating system device tree after adding or removing LUNs