>>- svctask -- -- mkvdiskhostmap -- ----------------------------> >-- -host --+- host_id ---+-- --+-------------------------+-----> '- host_name -' '- -scsi -- scsi_num_arg -' >-- --+----------+-- --+- vdisk_name -+------------------------>< '- -force -' '- vdisk_id ---'
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 executed 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 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, given any mappings that already exist with that host.
Some HBA device drivers will stop when they find a gap in the SCSI LUN IDs. For example:
When the device driver scans the HBA, it must stop after discovering virtual disks 1 and 2, because there is no SCSI LUN mapped with ID 3. You should, therefore, ensure that the SCSI LUN ID allocation is contiguous.
You can create multiple Vdisk assignments. Normally, multiple vdisk to host assignments should not be used, as corruption is likely to occur if more than one host can access a disk. However, in certain multiple path environments, such as that found in IBM's SAN File System (SFS), a vdisk must be mapped to more than one host. To do this you must use the command line interface and use the -force flag. For example:
svctask mkvdiskhostmap -host -host1 force 4 or,
svctask mkvdiskhostmap -host host2 -force 4
The above will create two host to vdisk mappings for vdisk 4, that map to host1 and host2. Note that omitting the -force flag will cause the mapping to fail if that vdisk is already mapped to a host.
An invocation example
svctask mkvdiskhostmap -host host1 -scsi 1 5
The resulting output
Virtual Disk to Host map, id [1], successfully created