NFS Mounted ISOs in Virtual Media Library
-by Naveen Karthick Chandrasekaran NAVEEN.KARTHICK.CHANDRASEKARAN@ibm.com
Ruchira Chawla ruchirachawla@in.ibm.com
Bhavika Aggarwal Bhavika.Aggarwal@ibm.com
P Dharanikumar P.Dharanikumar@ibm.com
1. Introduction
The Virtual Media Library (VML) repository in VIOS stores and manages optical media ISO image files, that can be loaded into virtual optical devices for export to client partitions. However, this requires explicit and repetitive image copying, consuming storage space and time in data centers with multiple CEC’s and VIOS instances.
NFS Mounted ISOs in Virtual Media Library is a new feature supported from VIOS 4.1.1.0 onwards that allows loading ISO images from a centralized NFS server. This eliminates repeated copying of ISO images across multiple VIOS, saves storage space and time, maintains consistent images, and supports both NFS V3 and V4, allowing multiple images to be linked into the repository.
2. What’s new ?
Below figure details the differences between the existing and new flow while adding ISO images to the Virtual Media Library repository.
The modified workflow in VIOS to host ISO images to be consumed by clients will be as follows:
· Create a Virtual Media Library repository (mkrep)
· Mount NFS server share into VIOS (mount NFS V3/V4)
· Create a soft link in the repository pointing to the specified ISO image in the mount point (mkvopt – is enhanced for the link creation)
· Create Virtual Optical Drive on the virtual adapter mapped to client(mkvdev)
· Load ISO image to Virtual Optical Drive (loadopt)
· Client LPARs will see the ISO image as an optical device
3. Prerequisites
· NFS server must be up and accessible.
· Following daemons: nfsrgyd, rpc.statd, rpc.lockd must be Active on the VIOS in-order to access the NFS server.
· User should provide adequate file permissions to the VIOS padmin user in-order to access the target iso images on the NFS server.
· If VIOS is rebooted, it is the user’s responsibility to remount the NFS shares and run the ‘cfgdev’ command to restore virtual optical mappings to available state.
· If the VIOS is under firewall ( verify using : ‘viosecure -firewall view’). In-order to mount the NFS share on VIOS the user needs to open the required dynamic remote ports of the NFS server.
NFS v4
|
NFS v3
|
Remote Port: 2049
|
Remote ports: 2049, 111
dynamic ports for mountd, status, nlockmgr
|
Local port: mcm
|
Local port: N/A
|
Use rpcinfo -p command to get the info of the remote dynamic ports as below. Only a subset of the output is presented below as example.
$ rpcinfo -p < nfsserver> | grep -e mountd -e status -e nlockmgr
…
100005 1 tcp 32768 mountd
100005 1 udp 32787 mountd
100021 1 udp 32789 nlockmgr
100024 1 tcp 32771 status
100024 1 udp 32792 status
100021 1 tcp 32769 nlockmgr
…
$ viosecure -firewall allow -port 2049 -remote
$ viosecure -firewall allow -port 111 -remote
Repeat below for each port number listed in the output of rpcinfo command.
$ viosecure -firewall allow -port 32768 -remote
$ viosecure -firewall allow -port 32787 -remote
…
$ viosecure -firewall allow -port <32789/32771/32792/32769> -remote
4. Example steps
Step 1 : Mounting NFS server ISO image path to VIO server.
$ mount <NFS server>:<NFS Share> <mount point>
Example:
· NFS V3
$ mount <IP xx.xx.xx.xx>:/mnt/nfs_v3 /mnt
· NFS V4
$mkdir /my_mount
$ mount -nfsvers 4 <IP xx.xx.xx.xx>:/mnt/nfs_v4 /my_mount
Step 2: Create or modify the media repository
Example:
$ mkvg -vg opticalvg hdisk6
hdisk6 changed
opticalvg
0516-1254 mkvg: Changing the PVID in the ODM.
$ mkrep -sp opticalvg -size 4G
Virtual Media Repository Created
Repository created within "VMLibrary" logical volume
NOTE: The repository size can be increased using ‘chrep -size <size>’, however, to reduce the size, the repository needs to be removed and re-created.
Step 3: Create the virtual media disk
From VIOS 4.1.1.0, mkvopt is enhanced to support new option –nfslink which creates a symbolic link to the specified NFS ISO file, in the repository.
$ mkvopt -name <image_name_in_VML_repository> -file /mnt/<mounted_ISO_file.iso> -nfslink -ro
NOTE : -ro will not impact the permission of mounted ISO file if –nfslink is used
Step 4: Verify that the virtual media disk is part of the repository
The lsrep command lists information about the repository. A new option -verbose provides additional information about the repository.
$ lsrep
Size(mb) Free(mb) Parent Pool Parent Size Parent Free
6144 2178 opticalvg 20384 14240
Name File Size Optical Access
…
<image_name_in_VML_repository> 3941 None NA
$ lsrep -verbose
…
Name=<image_name_in_VML_repository>,File Size=3941,Optical=None,Access=NA, Target Image=/mnt/<mounted_ISO_file.iso>,State=Active
NOTE : In the above lsrep output, access to some virtual media disk is NA which means Not Available as they are link to the mounted NFS ISO file.
Step 5: Create the file backed optical device and map it to Client.
$mkvdev -fbo -vadapter vhost0
vtopt0 Available
$ lsmap -vadapter vhost0
SVSA Physloc Client Partition ID
--------------- --------------------------------------- -----------------
vhost0 U9043.MRX.7802FBY-V3-C3 0x00000000
VTD vtopt0
Status Available
LUN 0x8100000000000000
Backing device
Physloc
Mirrored N/A
Step 6: Load the virtual media disk to the virtual optical device:
$ loadopt -vtd vtopt0 -disk <image_name_in_VML_repository>
Verify that the vtopt# backing device is the virtual media disk location.
$ lsmap -vadapter vhost0
SVSA Physloc Client Partition ID
--------------- --------------------------------------- ------------------
vhost0 U9043.MRX.7802FBY-V3-C3 0x00000000
VTD vtopt0
Status Available
LUN 0x8100000000000000
Backing device /var/vio/VMLibrary/<image_name_in_VML_repository>
Physloc
Mirrored N/A
$ lsrep
Size(mb) Free(mb) Parent Pool Parent Size Parent Free
6144 2178 opticalvg 20384 14240
Name File Size Optical Access
…
<image_name_in_VML_repository> 3941 vtopt0 NA
$ lsrep -verbose
…
Name=<image_name_in_VML_repository>,File Size=3941,Optical=vtopt0, Access=NA, Target Image=/mnt/<mounted_ISO_file.iso>,State=Active
5. VIOS Backup/Restore & Upgrade
viosbr backup, restore and view has been enhanced, the backup file would have the information about the NFS mount points and the NFS backed virtual optical mappings.
viosbr restore would skip the restore of NFS backed virtual optical mappings if the backed-up mount point is not available on VIOS.
Similarly for viosupgrade, the restore of NFS backed virtual optical mappings will be skipped on successful upgrade completion. Once the mount is made available the user should execute viosupgrade -o rerun to restore the NFS backed virtual optical mappings.
6. Limitations
· This feature is available only through VIOS CLI.
· After viosupgrade the nfsgryd daemon doesn’t start automatically. The domain needs to be set (using chnfsdom <domain_name>) before starting the nfsgryd daemon. This is limited to NFS v4 only.
· ISO images with read-write permission cannot be mapped to multiple clients.
· If the VMLibrary repository is created on rootvg it will not be available once the system is re-installed or upgraded.
7. Supported Levels
· Supported from VIOS 4.1.1.0 onwards.
8. Contacting the PowerVM Team
Have questions for the PowerVM team or want to learn more? Follow our discussion group on LinkedIn IBM PowerVM or IBM Community Discussions