mkvdiskhostmap

The mkvdiskhostmap command creates a new mapping between a virtual disk and a host, which makes the virtual disk accessible for I/O operations to the specified host.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- svctask -- -- mkvdiskhostmap -- --+----------+-- ----------->
                                      '- -force -'      

>-- -host --+- host_id ---+-- --+-------------------------+----->
            '- host_name -'     '- -scsi -- scsi_num_arg -'   

>-- --+- vdisk_name -+-----------------------------------------><
      '- vdisk_id ---'   

Parameters

-force
(Optional) Allows multiple VDisk-to-host assignments, which are not normally allowed.
-host host_id | host_name
(Required) Specifies the host to map the virtual disk to, either by ID or by name.
-scsi scsi_num_arg
(Optional) Specifies the SCSI LUN ID to assign to this virtual disk on the given host. The scsi_num_arg parameter contains the SCSI LUN ID that is assigned to the VDisk on the given host. You must check your host system for the next available SCSI LUN ID on the given HBA. If you do not specify the -scsi parameter, the next available SCSI LUN ID is provided to the host.
vdisk_name | vdisk_id
(Required) Specifies the name of the virtual disk that you want to map to the host, either by ID or by name.

Description

This command creates a new mapping between the virtual disk and the specified host. The virtual disk is presented to the host as if the disk is directly attached to the host. It is only after this command is processed, that the host can perform I/O transactions to the virtual disk.

Optionally, you can assign a SCSI LUN ID to the mapping. When the HBA in the host scans for devices that are attached to it, it discovers all virtual disks that are mapped to its fibre-channel ports. When the devices are found, each one is allocated an identifier (SCSI LUN ID). For example, the first disk found is usually SCSI LUN 1, and so on. You can control the order in which the HBA discovers virtual disks by assigning the SCSI LUN ID, as required. If you do not specify a SCSI LUN ID, the cluster automatically assigns the next available SCSI LUN ID, if any mappings already exist with that host. When you issue the mkvdiskhostmap command, the assigned SCSI LUN ID number is returned.

Some HBA device drivers will stop when they find a gap in the SCSI LUN IDs. For example:
  • Virtual Disk 1 is mapped to Host 1 with SCSI LUN ID 1
  • Virtual Disk 2 is mapped to Host 1 with SCSI LUN ID 2
  • Virtual Disk 3 is mapped to Host 1 with SCSI LUN ID 4

When the device driver scans the HBA, it must stop after identifying virtual disks 1 and 2, because no SCSI LUN is mapped with ID 3. For optimal performance, ensure that the SCSI LUN ID allocation is contiguous.

You can create multiple VDisk assignments. Normally, multiple VDisk-to-host assignments are not used because corruption is likely to occur if more than one host can access a disk. However, in certain multiple path environments, such as in the IBM® SAN File System, a VDisk must be mapped to more than one host. To map to more than one host, you must use the mkvdiskhostmap command with the force parameter. For example:
svctask mkvdiskhostmap -host host1 -force 4
svctask mkvdiskhostmap -host host2 -force 4

These commands create two host-to-VDisk mappings for VDisk 4 that map to host1 and host2. Omitting the force parameter causes the mapping to fail if that VDisk is already mapped to a host.

The command also fails if the host object (to which this mapping is being made) is not associated with the I/O group containing the VDisk.

An invocation example

svctask mkvdiskhostmap -host host1 -scsi 1 5

The resulting output

Virtual Disk to Host map, id [1], successfully created
Library | Support | Terms of use | Feedback
© Copyright IBM Corporation 2003, 2009. All Rights Reserved.