Inside PowerVM Virtual Media Library With NFS
IBM Champion Chris Gibson provides a walkthrough of the Power systems storage feature, including a look at the new VIOS 4.1.1.0
The PowerVM virtual media library, or VML as it is known, has been available for many, many years and is a very valuable asset to sysadmins that are responsible for the installation and management of IBM Power servers. If you’ve ever needed to install the AIX operating system into a new logical partition (LPAR) without using the AIX network installation manager (NIM), you’ve no doubt used the VML to perform this task. In short, the VML allows administrators to map ISO images to LPARs and then use the images to perform operations or tasks, like installing a fresh copy of AIX. Consider the example shown in the this IBM Support page.
Virtual Media Library
For the purposes of this article, I’ll assume that you’re already familiar with the VML. However, just in case you need a quick refresher, here are some highlights. The VML is a repository that is created on a Virtual I/O Server (VIOS) and can be used to store and manage optical media ISO images (files). These files can be loaded into virtual optical (vopt) devices and exported to client LPARs. And these vopt devices appear as virtual SCSI CD-ROMs to the operating system in the LPAR. For example, on AIX, these devices will appear with names such cd0 (where 0 is the number of the first instance of a vopt device, see output below).
# lsdev -Cc cdrom
cd0 Available Virtual SCSI Optical Served by VIO Server
The VML for a specific VIOS can be created using the HMC UI or from the VIOS command line using the mkrep command. Refer to this article for detailed steps. Once the repository is created, it appears on your VIOS as the /var/vio/VMLibrary file system. You can then start copying ISO images into the repository. This typically involves using scp/sftp to transfer ISOs over a network to a VIOS, using the VIOS command line. With the ISOs in place, you can then list the images in the repository using the VIOS lsrep command. Below is some sample output from a VIOS showing a VML with ISO images loaded into it (and mapped to several LPARs).
$ lsrep
Size(mb) Free(mb) Parent Pool Parent Size Parent Free
23458 3219 vmlvg 30560 7008
Name File Size Optical Access
RHEL86.iso 9314 an70lp4-cd0 ro
aix73.iso 7971 vtopt0 ro
aix73.iso 7971 cd0 ro
aix73.iso 7971 lpar2-vcd0 ro
aix73.iso 7971 AIX73 ro
$ ls -ltr /var/vio/VMLibrary
total 41444992
drwxr-xr-x 2 root system 256 Feb 22 2023 lost+found
-r--r--r-- 1 root system 8357478400 Feb 22 2023 aix73.iso
-r--r--r-- 1 root staff 9765711872 Sep 26 23:54 RHEL86.iso
To use the images in the VIOS VML, you would then use the mkvopt command to create a new vopt virtual target device (VTD) for an LPAR and then use the loadopt command to load/map an ISO image to the vopt device for a given LPAR. The HMC UI can also be used to perform this task as well. Refer, again to this article for detailed steps.
This works very well. However, there has been one major drawback to this approach over the years. It requires administrators to explicitly and repetitively copy images to each VIOS that needs to serve the multitude of ISO files. This is a tedious and time-consuming task, and when you have multiple VIOS across multiple Power servers, this constant copying of files to individual VIOSs also consumes storage space and adds to overall administration overhead. So, for many years IBM customers have been asking IBM to develop and alternative approach, one which could eliminate the need to copy ISO images around to lots of VIOS and, instead, access the files from a shared location.
With VIOS 4.1.1.0, IBM has done just that!
VIOS 4.1.1.0, VML and NFS
VIOS version 4.1.1.0 introduces the capability to use NFS-mounted ISO images from a VML. This new feature allows administrators to access and load ISO images from a centralized NFS server. This eliminates the need for repeated copying of ISO images across multiple VIOSs. It also saves storage space and time, while also allowing you to maintain consistent images for your entire PowerVM landscape.
The mkvopt command has been enhanced to support a new option, called nfslink, which creates a symbolic link to the specified ISO file on the NFS mount in the VML repository. Shown below is the syntax for the new option.
mkvopt -name <image_name_in_VML_repository> -file /mnt/<mounted_ISO_file.iso> -nfslink -ro
To enable and use this new feature, apart from updating your VIOS to version 4.1.1.0, there are a few prerequisites that you need to meet. The most important is that you must have an NFS server in your environment that can be accessed by the VIOS on your Power servers. So, if there’s a firewall between your VIOS and your NFS server, or you’ve configured the firewall on your VIOS (with the viosecure command), you may need to perform some additional steps to open up communication to allow the VIOS and NFS server to talk (refer to this article for more details). Both NFS version 3 and 4 are supported by this feature.
The following diagram (below) provides a high-level overview of how this new feature works. The blue boxes (connected by the blue lines/arrows) identify the new components for NFS support with the VML. On the righthand side of the diagram there is a blue box (1) showing an NFS server which houses the ISO image to be shared (ISO file2). The next blue box (2) shows the NFS mount on the VIOS (NFS-mounted ISO file2). The third blue box (3) highlights the new command option that creates the link to the NFS-mounted ISO image in the VML. And the fourth blue box (4) shows the NFS-mounted ISO symlink in the VML (Image2 symlink ISO file2, which is the image name used when mapping the ISO to the client LPAR). There’s also a grey box (at the top of the diagram) highlighting that traditional “local” ISO images can still be loaded into the VML and shared with client LPARs using the traditional VML approach. This is also highlighted by the other grey boxes, showing that once the symlink has been created (in the VML), the steps to load the ISO and map it to a virtual adapter are the same as existing steps available with previous versions of the VIOS; that is, using mkvdev and loadopt to create a virtual optical device and map an ISO to it. The diagram also shows that the initial creation of the VML is still performed using the mkrep command.
Please refer to this blog for more information regarding the prerequisites and other considerations for this new capability.
Configuring and Accessing NFS-Mounted ISO Images From a VIOS VML
Before attempting to access an NFS-mounted ISO, you must first ensure your VIOS is running VIOS version 4.1.1.0. Use the ioslevel command to confirm your installed VIOS level.
$ ioslevel
4.1.1.00
Assuming that your NFS server is contactable from your VIOS, let’s review the steps required to configure your VIOS and access the ISO images from the VML. The steps that follow were performed in a development environment. Note that in this example environment, we had already created the VML (with the mkrep command), so the repository file system (/var/vio/VMLibrary) already existed.
$ df | grep VML
/dev/VMLibrary 209715200 191857104 9% 6 1% /var/vio/VMLibrary
First off, we copied an AIX ISO image that we wanted to share over NFS to our NFS server. The NFS server is named lpar1. We confirmed that the directory where the ISO was located was NFS exported from the NFS server (with the showmount command). In this case, the /cg/ISO directory was exported globally.
root@lpar1 /cg/ISO # ls -ltr
total 17006336
-rw-r--r-- 1 root system 8707244032 Jan 07 20:35 AIX7322.iso
root@lpar1 /cg/ISO # showmount -e | grep ISO
/cg/ISO (everyone)
Second, we confirmed that our VIOS could “see” the exported NFS directory on our NFS server, lpar1. From the VIOS padmin account, we ran the showmount command as shown below.
$ showmount lpar1 | grep ISO
/cg/ISO (everyone)
In the third step (again from our VIOS, as the padmin user), we created a new directory mount point (named ISO in /home/padmin) and mounted the NFS share to it. We then confirmed it was mounted correctly. The commands we used are shown below.
$ mkdir ISO
$ mount lpar1:/cg/ISO /home/padmin/ISO
$ df | grep ISO
lpar1:/cg/ISO 429916160 57584104 87% 18677 1% /home/padmin/ISO
The fourth (and final) step required us to use the mkvopt command to create the link from the NFS-mounted ISO image to the VML. The command is shown below:
$ mkvopt -name AIX7322iso -file /home/padmin/ISO/AIX7322.iso -nfslink -ro
The command specifies the name of the image in the VML, AIX7322.iso; the location and name of the NFS mounted image, /home/padmin/ISO/AIX7322.iso; and finally, the -nfslink option, with the -ro flag, to specify that we wanted to create a symbolic link to the specified NFS ISO file as a read-only disk image (DVD-ROM).
With these four steps completed, we could then list the contents of the repository with the lsrep command. It shows that the NFS-mounted ISO (AIX7322iso) was available in the repository.
$ lsrep
Size(mb) Free(mb) Parent Pool Parent Size Parent Free
102400 93680 vmlvg 369664 267264
Name File Size Optical Access
AIX7322iso 8304 None NA
The lsrep -verbose command also showed additional details that helped identify that the image was available over NFS, as the Image= field showed the full path name to the NFS mount location.
$ lsrep -verbose
Name=AIX7322iso,File Size=8304,Optical=None,Access=NA,Target Image=/home/padmin/ISO/AIX7322.iso,State=Active
Note: The -verbose option is new to lsrep with VIOS 4.1.1.0.
Performing a simple directory listing (ls) of the VML directory showed that a symbolic link (->) had been created that pointed to the NFS-mounted ISO image file location.
$ ls -ltr /var/vio/VMLibrary
total 17006336
drwxr-xr-x 2 root system 256 Jun 23 2024 lost+found
lrwxrwxrwx 1 root staff 28 Jan 07 20:55 AIX7322iso -> /home/padmin/ISO/AIX7322.iso
Loading NFS-Mounted ISOs to LPARs
Now that the VML is loaded with an NFS-mounted ISO image, it can now be accessed and loaded by client LPARs using traditional VML/vopt methods—for example, by creating a new virtual optical device (vtopt0) for the LPAR and attaching it to the client’s virtual host adapter (vhost0). See example below.
$ mkvdev -fbo -vadapter vhost0
vtopt0 Available
$ lsmap -vadapter vhost0
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U9009.42A.21D010W-V1-C4 0x00000004
VTD vtopt0
Status Available
LUN 0x8500000000000000
Backing device
Physloc
Mirrored N/A
VTD vtscsi0
Status Available
LUN 0x8100000000000000
Backing device lku1_hdisk1.3d9d3771cb7d1c8bc1ecf1b96c6c2817
Physloc
Mirrored N/A
...
The ISO image could then be loaded into the vopt device (vtopt0). Once loaded, the ISO details appear in the Backing device output for the virtual optical device (shown below).
$ loadopt -vtd vtopt0 -disk AIX7322iso
$ lsmap -vadapter vhost0
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U9009.42A.21D010W-V1-C4 0x00000004
VTD vtopt0
Status Available
LUN 0x8500000000000000
Backing device /var/vio/VMLibrary/AIX7322iso
Physloc
Mirrored N/A
VTD vtscsi0
Status Available
LUN 0x8100000000000000
Backing device lku1_hdisk1.3d9d3771cb7d1c8bc1ecf1b96c6c2817
Physloc
Mirrored N/A
...
Now the lsrep -verbose command shows that the image is mapped (or mounted) to the vtopt0 virtual optical device (refer to the Optical= field in the output below).
$ lsrep -verbose
Name=AIX7322iso,File Size=8304,Optical=vtopt0,Access=NA,Target Image=/home/padmin/ISO/AIX7322.iso,State=Active
At this point, from our client AIX LPAR, we were then able to mount the virtual SCSI CD-ROM device and view the contents of the ISO, as shown in the commands and output below. The ISO image contains the install media for AIX 7.3 TL2 SP2.
aix# lsdev -Cc cdrom
aix# cfgmgr
aix# lsdev -Cc cdrom
cd0 Available Virtual SCSI Optical Served by VIO Server
aix# crfs -v cdrfs -p ro -dcd0 -m/cdrom -Ano
aix# ls -ltr /cdrom
total 0
aix# mount /cdrom
aix# ls -ltr /cdrom
total 96
drwxr-xr-x 3 4000 4000 2048 May 16 2024 root
drwxr-xr-x 3 4000 4000 2048 May 16 2024 ppc
-rw-r--r-- 1 4000 4000 863 May 16 2024 README.aix
drwxr-xr-x 2 4000 4000 2048 May 16 2024 7300-02
drwxr-xr-x 3 4000 4000 2048 May 16 2024 installp
-rw-r--r-- 1 4000 4000 15950 May 16 2024 image.data
-rw-r--r-- 1 4000 4000 6469 May 16 2024 bosinst.data
-rw-r--r-- 1 4000 4000 16 May 16 2024 OSLEVEL
drwxrwxr-x 4 4000 400 2048 May 16 2024 RPMS
drwxr-xr-x 2 4000 4000 4096 May 16 2024 license
drwxr-xr-x 3 4000 4000 2048 May 16 2024 ismp
drwxr-xr-x 10 4000 4000 2048 May 16 2024 usr
-rw-rw-r-- 1 4000 4000 42 May 16 2024 .Version
aix#
If you’ve worked with the VIOS VML before, then the previous set of steps should be very familiar to you, as they are identical.
That pretty much covers the basics of how to get started with NFS-mounted ISOs in your VIOS VML. Before we conclude , a couple of important points. In the current release if you reboot the VIOS later, note that it is the administrator’s responsibility to remount the NFS shares and run the cfgdev command to restore virtual optical mappings to the available state. At the time of writing, this feature is only available through the VIOS command line.
Everyone Wins
This really is a great new feature for the VIOS. It eliminates the need for copying ISO images around to dozens of VIOS repositories and, finally, allows sysadmins to have one central NFS server where they can store their (often large) ISO images for AIX and Linux (for example). It’s a great win for everyone as it helps reduce sysadmin work and reduce disk space required and used, while also helping to increase consistency across your IBM Power server landscape.
I highly recommend readers review the information listed in the references section to learn more about this new capability and the prerequisites. If you’re new to PowerVM and VIOS, then also check out the references section for a list of the official PowerVM training courses available from the IBM Power technical training team.
References
VIOS – NFS Mounted ISOs in Virtual Media Library
What’s new in Virtual I/O Server commands
IBM PowerVM: Implementing Virtualization
IBM PowerVM II: Advanced Management and Performance