8.6.2. Creation of Backing Devices

A storage pool allows to create backing devices for client LPARs quickly and easily. As long as a storage pool still has free capacity, backing devices can be created and assigned to client LPARs at any time (VSCSI mapping).

To create a backing device in a storage pool, there is the command “vios mkbdsp” (make backing device in storage pool). In addition to the storage pool, a name must be specified for the backing device to be created, as well as the desired size:

$ vios mkbdsp ms05-vio1 testpool bd001 1g
$

In the overview of the storage pools of the virtual I/O server, the number of backing devices for the storage pool testpool has increased from 0 to 1:

$ vios lssp ms05-vio1
POOL      TYPE    SIZE       FREE       ALLOC      BDS
rootvg    LVPOOL  558.00 GB   68.00 GB  512.00 MB  0
testpool  LVPOOL    9.93 GB    8.93 GB    8.00 MB  1
$

Of course, the backing devices of a storage pool can also be listed, for this purpose there is the command “vios lsbdsp” (list backing devices of storage pool):

$ vios lsbdsp ms05-vio1 testpool
BDNAME  SIZE     VTD   SVSA
bd001   1.00 GB  None  None
$

The backing device that has just been created is listed. It has not yet been assigned to a vhost adapter (VSCSI mapping). In order to be able to assign the backing device to a client LPAR, you need the vhost adapter belonging to the client LPAR. With the command “vios lsvscsi” all vhost adapters of a virtual I/O server can be listed:

$ vios lsvscsi ms05-vio1
SVSA    SLOT  CLIENT              LUNS
vhost0  C25   lpar1(3)            2
vhost1  C28   lpar2(4)            2
vhost2  C31   lpar3(5)            2
$

The output shows the virtual slot number on the virtual I/O server for each vhost adapter (SVSA column), as well as the client LPAR and the number of assigned backing devices (LUNS column).

To assign the backing device that has just been created, e.g. to the client LPAR lpar1 (vhost0), the command “vios mkbdsp” can be used again. The backing device that has already been created and the vhost adapter to which the backing device is to be assigned must be specified:

$ vios mkbdsp ms05-vio1 testpool bd001 vhost0
$

Instead of the command “vios mkbdsp”, the command “vios map” can also be used, it is slightly shorter:

$ vios map ms05-vio1 bd001 vhost0
$

A check of the vhost adapter shows that the number of LUNs (backing devices) for the adapter vhost0 has increased to 3 backing devices:

$ vios lsvscsi ms05-vio1
SVSA    SLOT  CLIENT              LUNS
vhost0  C25   lpar1(3)            3
vhost1  C28   lpar2(4)            2
vhost2  C31   lpar3(5)            2
$

If you want to see the LUNs (backing devices) in detail, you must specify the vhost adapter:

$ vios lsvscsi ms05-vio1 vhost0
VTD      STATUS     BACKING                             BDPHYSLOC  MIRRORED  LUN
vtopt0   Available  /var/vio/VMLibrary/AIX710506_2.iso  -          N/A       0x8100000000000000
vtscsi0  Available  lpar1_hd00                          -          N/A       0x8200000000000000
vtscsi5  Available  bd001                               -          N/A       0x8300000000000000
$

A virtual AIX installation CD (AIX710506_2.iso) is still available from the installation of the LPAR and the virtual target device vtscsi0 (backing device lpar1_hd00) is probably the boot disk of the LPAR lpar1. The newly assigned backing device bd001 is mapped as device vtscsi5.

The backing device bd001 is now assigned to an LPAR, as can be seen from the output of “vios lsbdsp“:

$ vios lsbdsp ms05-vio1 testpool
BDNAME  SIZE     VTD      SVSA
bd001   1.00 GB  vtscsi5  vhost0
$

The assignment of a backing device to a client LPAR cannot be seen directly from the output, only the corresponding vhost adapter can be identified. To make the assignment visually easier for the administrator, many administrators use the option of specifying the name for the virtual target device (default vtscsiN). This is shown briefly below.

First we need another backing device:

$ vios mkbdsp ms05-vio1 testpool bd002 1g
$

When mapping, the desired name for the virtual target device can be specified as the last (optional) argument:

$ vios mkbdsp ms05-vio1 testpool bd002 vhost0 lpar1_hd02
$

Or using “vios map“:

$ vios map ms05-vio1 bd002 vhost0 lpar1_hd02
$

The user-defined name for the virtual target device then appears accordingly in the output of the corresponding commands, like „vios lsbdsp“ here:

$ vios lsbdsp ms05-vio1 testpool
BDNAME  SIZE     VTD      SVSA
bd001   1.00 GB  vtscsi5  vhost0
bd002   1.00 GB  lpar1_hd02  vhost0
$

The first part of the name, lpar1, of the virtual target device now indicates the associated client LPAR. This can be of great help, when a large number of backing devices are used in an environment.

In order that the mapped backing devices are visible in the client LPAR after mapping, the config manager cfgmgr must be run under AIX:

lpar1 # lspv
hdisk0          00fbabe641e13592                    rootvg          active     
lpar1 #
lpar1 # cfgmgr -l vio0
lpar1 #
lpar1 # lspv
hdisk0          00fbabe641e13592                    rootvg          active     
hdisk1          none                                None                       
hdisk2          none                                None                       
lpar1 #

The mapped backing devices appear in the list as physical volumes only after the config manager has run. The physical location code of the physical volumes can be displayed using the AIX lscfg command:

lpar1 # lscfg -l hdisk*
  hdisk0           U8205.E6C.05E4E5Q-V3-C5-T1-L8200000000000000  Virtual SCSI Disk Drive
  hdisk1           U8205.E6C.05E4E5Q-V3-C5-T1-L8300000000000000  Virtual SCSI Disk Drive
  hdisk2           U8205.E6C.05E4E5Q-V3-C5-T1-L8400000000000000  Virtual SCSI Disk Drive
lpar1 #

Using the LUN-ID from the physical location code (e.g. L8400000000000000) from the output above, the corresponding backing device and virtual target device can be identified from the list of the mappings for the vhost adapter (“vios lsvscsi“). The connection is the LUN-ID found in the column LUN of the output:

$ vios lsvscsi ms05-vio1 vhost0
VTD      STATUS     BACKING                             BDPHYSLOC  MIRRORED  LUN
vtopt0   Available  /var/vio/VMLibrary/AIX710506_2.iso  -          N/A       0x8100000000000000
vtscsi0  Available  lpar1_hd00                          -          N/A       0x8200000000000000
vtscsi5  Available  bd001                               -          N/A       0x8300000000000000
lpar1_hd02  Available  bd002                            -          N/A       0x8400000000000000
$

The physical volume hdisk2 of the LPAR lpar1, for example, has the LUN-ID 8400000000000000 according to lscfg. This LUN-ID can be found in the output of “vios lsvscsi” in the last line of the backing device bd002 (the LUN column is relevant here).

The new physical volumes can be used on the client LPAR like any other physical volume, e.g. to create a volume group:

lpar1 # mkvg -S hdisk1
0516-1254 mkvg: Changing the PVID in the ODM.
vg00
lpar1 #

In the previous examples, the backing device was always created first (command “vios mkbdsp”) and was then assigned to a vhost adapter in a second step (commands “vios mkbdsp” or “vios map”). The command “vios mkbdsp” allows both steps to be carried out within one operation. In addition to the size of the backing device, the required vhost adapter has simply to be specified. Optionally, a name can be specified for the virtual target device to be created:

$ vios mkbdsp ms05-vio1 testpool bd003 1g vhost0 lpar1_hd03
$

This is of course a little faster than with 2 separate commands.