Device Mapping on IBM i

Edit: Link still works.

Originally posted April 15, 2014 on AIXchange

More and more IBM i administrators who once relied exclusively on internal disks are now getting their disks from VIOS using vSCSI or NPIV. These administrators need a handy way to determine which SAN LUNs correspond to which individual virtual disks in IBM i. If your SAN administrator wants to know which LUN is DD001 on the IBM i client, how do you respond?

In disparate computing environments, it’s a question that’s bound to come up. Maybe the SAN admin is making some changes and wants to take back a LUN, and the IBM i admin needs to be able to determine which LUN is allocated to which virtual disk in the IBM i environment. Maybe the administrator temporarily used an internal hdisk and is now migrating to a SAN LUN. Whatever the reason, there are certainly times when you want to know which backing device is being used in an IBM i environment.

Luckily, this document is available to help with the cross-referencing.

Problem (Abstract)

This document describes how to cross-reference (device mapping) IBM i disk units with VIOS disk units.

Resolving the problem

At some point, you may need to know the physical location of the virtual disk units. This information might be needed for performance measurements or service, or you might need to be able to translate to and from IBM i to VIOS to the physical devices (including an external disk, if relevant). This document describes how to map the i drives to the VIOS drives and then to the physical disks.

These scenarios are presented in this document:

1) Check device mapping from the HMC — With HMC version 7.3.4 SP2 or later you can see the device mapping from the HMC if the server is HMC Managed.

2) Find the device mapping in a single adapter client partition — Another way to do this mapping is by calculating the LUN from the Controller number. Back on the Display Disk Unit Details screen, we know that DD001 is on Controller 3. You should convert the controller number from decimal to hex and then add 0x80. In this case, Decimal 3 = 0x03 + 0x80 = 0x83. Looking at the lsmap, we can see the LUN 0x083 is hdisk9.

Mapping the i drive to the correct hdisk becomes important if you ever want to remove disk units from the partition. After you have removed the disk unit from the ASP, you must be able to determine which hdisk to remove from the partition profile.

3) Multiple adapter client partition — If you need to identify disks, you will need to know which virtual adapter (vhost) has the correct mapping. In this case, we need to look at the SYS Card identifier. This number identifies the client adapter ID in the partition you are working with. In a multiple adapter environment, the controller number is not unique. Therefore, you also need to determine which adapter you are looking at. To do this, you need to use the Sys Card Number from the Display Disk Unit details above. You may use either HMC or IVM to view the partition properties. Partition ID 4 has two client adapters. They connect to server adapters 401 and 403, respectively. View the server partition properties/virtual adapters tab to see the information.

4) vios command line interface on VIOS 2.1.2.X and IBM I R6.1.1 or later — If this is an IVM environment with multiple SCSI adapters you can use the following command to map the disks.

Use this command to get the system name:
lssyscfg -r sys -F name

Use the system name as input into the following command:
lshwres -m -r virtualio –rsubtype scsi –level lpar -F topology

5) The system card number explained — Above in the multiple adapter example disk unit’s details showed that the Sys Card field was 145 for 16 of the drives, and 147 for the remaining 15. Why is the sys card field a different number than the HMC or IVM adapter ID? The Sys Card field wraps at 256. So if you add 145 and 256, you get 401. Likewise, if you add 147 and 256, you get 403. We also need to keep in mind that it is possible to have more than one Sys Card of the same number because customers can configure the adapter ID. For example, looking at an IBM i partition disk unit details there are 62 disk units in various ASPs. There are two Sys Card 33s listed in the details.

Looking at the partition properties, you see the following:

TypeAdapter IDConnecting PartitionConnecting Adapter
Server SCSI801LPAR1801
Server SCSI33LPAR433

U9117.MMA.1007E34-V1-C801 = vhost1
U9117.MMA.1007E34-V1-C33 = vhost2

256 + 256 + 256 + 33 = 801
33 = 33

Have you had to map LUNs back to IBM i disks? What methods did you use?