Modifying a logical unit mapping using the CLI

You can modify a logical unit (LU) mapping by using the command-line interface (CLI). The LUN ID and unique identifier (UID) are linked and cannot be changed dynamically when Lenovo Storage V series is managing the MDisk.

To modify an LU mapping, complete the following steps:

  1. Migrate all of the data from the managed disk (MDisk):
    1. If the MDisk is in managed mode or image mode and the volume must be kept online, issue the following CLI command and then proceed to step 2:
       rmmdisk -mdisk MDisk number -force storage pool number

      where MDisk number is the number of the MDisk that you want to modify and storage pool number is the number of the storage pool for which you want to remove the MDisk.

      Note:
      • The volume becomes a striped MDisk, not an image-mode volume.
      • All data that is stored on this MDisk is migrated to the other MDisks in the storage pool.
      • This CLI command can fail if there are not enough free extents in the storage pool.
    2. If the MDisk is in image mode and you do not want to convert the volume to a striped volume, stop all I/O to the image mode volume.
    3. Issue the following CLI command to remove the host mapping and any SCSI reservation that the host has on the volume:
      rmvdiskhostmap -host host namevirtual disk name
      Where host name is the name of the host for which you want to remove the volume mapping, and virtual disk name is the name of the volume for which you want to remove mapping.
      Note: If volume protection is enabled and the volume that is being unmapped received I/O within the defined volume protection interval, then the command fails.
    4. Issue the following command to delete the volume:
      rmvdisk virtual disk name

      Where virtual disk name is the name of the volume that you want to delete.

  2. Remove the LU mapping on the storage system so that the LUN is not visible to the Lenovo Storage V series system.
  3. Important:
    Issue the following CLI command to clear all error counters on the MDisk:
    includemdisk MDisk number

    Where MDisk number is the number of the MDisk that was removed.

  4. Issue the following CLI command to rescan the Fibre Channel network and detect that the LU is no longer there.
    detectmdisk 
    The MDisk is no longer visible on the system.
  5. Issue the following CLI command to verify that the MDisk is removed:
    lsmdisk MDisk number

    Where MDisk number is the number of the MDisk that was removed.

    If the MDisk is still displayed, repeat steps 3 and 4.

  6. Configure the mapping of the LU to the new LUN on the storage system.
  7. Issue the following CLI command:
    detectmdisk 
  8. Issue the following CLI command to check that the MDisk now has the correct LUN:
    lsmdisk

The MDisk has the correct LUN.