Updated 28 January 2011
A few notes and clarifications:
What I call the Virtual Media Library is often also called the Virtual Media Repository (VMR). IBM documentation uses both terms.
the syntax for creating the virtual optical device was incorrect. Details within the body of the post below.
You may also be interested in an article of mine in the IBM Systems Magazine on the Virtual Media Library: Media Release - Keep software and OS backups handy with VIOS virtual media library
Using ISO Images Effectively
The VIO server's virtual media library allows you to load ISO images onto the VIO server and share them with VIO clients. It is remarkably quick to set up and learn, and is a simple way of loading software. AIX 6.1 TL 4 introduced the loopmount command which allows you to mount an ISO image without a VIO server VM Library. We'll look at both methods here.
VIO Virtual Media Library
The VIO server's Virtual Media Library is so useful, I know people who say they would be lost without it. It's been called a smart man's NIM. It can be used to clone LPARs, install or update AIX (including migrating to AIX 6.1), as well as for sharing any files which can be put into ISO format. The VIO server version 1.5.2 introduced the Virtual Media Library. To determine your VIO server level log in as
padmin and run the ioslevel command. The latest VIO server updates are available from the IBM Virtual I/O Server Support page.
Clone / upgrade / install via ISO
On AIX the mkdvd (and mkcd) commands allow you to create or convert mksysb backup files in ISO format which can then be shared via the VIO server. This is a great way of cloning LPARs without using NIM and without the need for physical media. This might be a central part of your DR strategy.
You can also use VM Library for upgrading AIX. My compatriot Chris Gibson has an excellent article showing how he did an AIX Migration with File-Backed VIOS Devices. It's also easy to create ISO images on AIX of any directory and share those around by mounting them on the VIO server VMLibrary. I use the
mkisofs command from the AIX Toolbox for Linux, but there are other ways of creating images in ISO format.
Use the HMC GUI ...
If you're using an HMC, and it's at level 7.3.4 SP 2 or later, you may be able to do all of this through the HMC GUI. As we saw in a recent post on AIX Down Under, you can update your HMC remotely. There are some other prerequisites for the VIO server and system firmware, all of which are explained in the Hardware GUI for Virtual I/O Server Commands wiki. There is a movie which covers this on the IBM Wiki Movies page (movie 63 - HMC GUI for VIOS Commands).
... or the VIO Command line
If your configuration is not quite up to date, or your preference is for the command line, using ISO images is very straightforward.
After creating the VMLibrary using mkrep, I like to give each LPAR its own specially named optical device:
Correction: the following line in the original post was incorrect:
mkvdev -vhost0 -fbo -dev lpar1_cd0
Correct syntax is:
mkvdev -vadapter vhost0 -fbo -dev lpar1_cd0
Once you've copied the ISO image into the VM Library, you can easily load the image using loadopt without looking up the virtual optical device name using lsmap:
loadopt -vtd lpar1_cd0 -disk mydvd.iso
You should then be able to see the ISO image on the VIO client, either through SMS menus or (usually) by mounting a CD file system. Unloading the image so you can mount another one is done with the unloadopt command.
Sharing ISOs to several VIO clients
You can set permissions on the ISO image to be read only, using either mkvopt when loading the images into the VM library, or chvopt after they've been loaded. This allows you to load the same ISO image onto other virtual optical devices, making it available to several LPARs at once. That's easier than copying files around or using NFS mounts. More detailed explanations can be found on the VIOLoadISO and VIOS_Optical_Commands wikis.
Loading ISO images on AIX command line
You can now mount ISO images directly onto an AIX LPAR using the
loopmount command. This was introduced into AIX 6.1 TL 4 (use the oslevel -s to check your current level). The man page for loopmount provides this example:
loopmount -i cdrom.iso -o "-V cdrfs -o ro" -m /mnt
Make use of virtualisation
If you don't have access to a VIO server VM Library, and your AIX is not yet at 6.1 TL 4, there is a workaround for loading ISO images. But as Nigel Griffiths explains in the AIXpert blog, it's time to ask Are you up to date with AIX? If you do have the VIO Virtual Media Library, it will make your AIX updates and administration a whole lot easier.