The first LPAR that I normally build post VIOS installation is a NIM LPAR. Once you have your NIM server setup, building the rest of your LPAR’s becomes a much simpler task. However, what do you do when there isn’t an existing NIM environment, or you don’t have access to the physical servers to insert a disc to perform the AIX install? This is where the Virtual Media Library comes to the rescue. The Virtual Media Library is a feature of the Virtual I/O Server which allows you to present an ISO image to underlying LPAR’s. The best thing about the Virtual Media Library is that it’s very quick and simple to set up.
From here on out, I’ll be referring to the Virtual Media Library as VML.
Getting right into it, we first want to define the VML. Now you can create a new volume group for the VML, or simply use rootvg. If you do decide to use rootvg, just be sure to exclude the filesystem when you do your VIO mksysb backups. The other paramater that we need to specify is the size of the VML. Make it big enough to cater for all your ISO volumes that you wish to present to underlying LPAR’s. In the example below, I’ve gone with 10G.
$ mkrep -sp rootvg -size 10G Virtual Media Repository Created Repository created within "VMLibrary" logical volume
We’ve now created an empty VML repository which backs onto the /var/vio/VMLibrary filesystem. You can view the VML repository by running the lsrep command.
Now it’s time to upload your ISO images over to the VIOS. At this stage, I’ll bring up a root shell in the VIOS and change the root password. This will allow me to SCP across the ISO images into the /var/vio/VMLibrary folder.
$ oem_setup_env # passwd
Upload your ISO images into /var/vio/VMLibrary
# ls -l /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso -r-------- 1 root system 4236148736 Apr 06 18:07 /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso
Check the VML repository to see the new image available for use.
$ lsrep Size(mb) Free(mb) Parent Pool Parent Size Parent Free 10198 6158 rootvg 279552 236288 Name File Size Optical Access AIX-6100-06-01-Disk1.iso 4040 None ro
Great, so we now have some media in the VML library ready to be used. What we need to do from here is create a File Backed Optical Device for the particular LPAR you want cd0 to appear on.
$ mkvdev -fbo -vadapter vhost1 vtopt0 Available
Now let’s load the image from the VML into vtopt0.
$ loadopt -vtd vtopt0 -disk AIX-6100-06-01-Disk1.iso $ lsmap -vadapter vhost1 SVSA Physloc Client Partition ID --------------- -------------------------------------------- ------------------ vhost1 U9133.55A.066EB4H-V1-C34 0x00000000 VTD vtopt0 Status Available LUN 0x8200000000000000 Backing device /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso Physloc Mirrored N/A
Now you can boot the LPAR off CD/DVD and perform the AIX install.
Two other useful commands to know:
To unload the image.
$ unloadopt -vtd vtopt0
If you’re prompted for another disk (for example, disc 2 during the AIX install).
$ loadopt -f -vtd vtopt0 -disk AIX-6100-06-01-Disk2.iso
There you have it, a quick and simple way of getting AIX installed onto a LPAR if you don’t have any other method of installation. Another thing to take note of, is that you can load any ISO image into the VML, it doesn’t have to be an AIX installation image. Quite useful for when you have to install any bit of software and all you have is the ISO image.
On that note though, the loopmount command was added in AIX 6.1 TL4. This allows you to mount ISO images directly from AIX without using the VML.
# loopmount -i image.iso -o "-V cdrfs -o ro" -m /mountpoint
Good luck, enjoy, and any questions can be popped into the comments below.