Creating a Virtual Media Repository

The virtual media made available by a virtual media repository (or virtual media library) ultimately exist on the virtual I/O server in the form of files. This means that hard disk space is required on the virtual I/O server. Hard disk space is managed on a virtual I/O server in the form of so-called storage pools (Storage Pools). Therefore, we first display the available storage pools on our virtual I/O server ms12-vio1 with the “vios lssp” command:

$ vios lssp ms12-vio1
POOL       TYPE    SIZE       FREE       ALLOC      BDS
rootvg     LVPOOL  558.00 GB  501.00 GB  512.00 MB  0
diskpool1  LVPOOL   99.88 GB   99.88 GB   64.00 MB  0
diskpool2  LVPOOL   99.88 GB   99.88 GB   64.00 MB  0
$

The storage pool rootvg always exists, it is simply the volume group rootvg that is present on every AIX and Virtual I/O server. In our case there are two more storage pools named diskpool1 and diskpool2.

Before we create a virtual media repository, we use “vios lsrep” to check whether there is already a virtual media repository on our virtual I/O server:

$ vios lsrep ms12-vio1
                 PARENT
SIZE  FREE  POOL  SIZE  FREE
-     -     -     -     -
$

This is obviously not the case!

A Virtual Media Repository must be in a storage pool (which must be of type LVPOOL). When creating a virtual media repository, the desired size must be specified. The command to create a Virtual Media Repository is “vios mkrep“:

$ vios mkrep ms12-vio1 diskpool1 10G
$

Running “vios lsrep” again should now show the newly created Virtual Media Repository:

$ vios lsrep ms12-vio1
                                  PARENT
SIZE       FREE       POOL       SIZE       FREE
  9.96 GB    9.96 GB  diskpool1   99.88 GB   89.88 GB
$

There can only be one Virtual Media Repository per Virtual I/O Server. The attempt to create a second virtual media repository fails accordingly:

$ vios mkrep ms12-vio1 diskpool2 10G
hmc01: viosvrcmd -m ms12 -p ms12-vio1 -c \"mkrep -sp diskpool2 -size 10G\"
ERROR: remote HMC command returned an error (1)
StdErr: HSCL2970 The IOServer command has failed because of the following reason:
StdErr: DVD repository already exists
StdErr:
StdErr: rc=4
$

If the Virtual Media Repository is to be created in the rootvg storage pool, then the storage pool does not need to be specified in the “vios mkrep” command; rootvg is the default storage pool. However, the size must still be specified:

$ vios mkrep ms12-vio1 10G
$ vios lsrep ms12-vio1
                                 PARENT
SIZE       FREE       POOL    SIZE       FREE
  9.96 GB    9.96 GB  rootvg  558.00 GB  491.00 GB
$

When creating a virtual media repository, a logical volume named VMLibrary is created in the specified storage pool. The size of the logical volume corresponds to the size specified in the “vios mkrep” command. The logical volume is then provided with a jfs2 file system and mounted under the mount point /var/vio/VMLibrary. All virtual media are stored in this file system as ordinary files:

ms12-vio1 $ df -g /var/vio/VMLibrary
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/VMLibrary     10.00      9.96    1%        4     1% /var/vio/VMLibrary
ms12-vio1 $