More on Virtual Optical Devices

Edit: This is still something I use all the time. An oldie but a goodie.

Originally posted January 8, 2008 on AIXchange

The more I use virtual optical devices with the IBM Virtual I/O Server (VIO server) and AIX, the more I like them. I wrote about virtual optical devices with the Integrated Virtualization Manager (IVM) in this post.

After getting an optical media library working with IVM, I wanted to try it on my VIO server using the HMC. I couldn’t find anything in the HMC GUI. I was going to poke around the command line on my own, but as luck would have it, someone forwarded a presentation with the information I was looking for. Now I’ll share this information with you.

You can see the virtual optical commands that are available in your VIO server by running:

help | more

Virtual Media Commands

chrep
chvopt
loadopt
lsrep
lsvopt
mkrep
mkvopt
rmrep
rmvopt
unloadopt

You can then run help , where is name of the command you’re seeking information about.

First I log into my vio server as padmin. I run:

mkrep -sp datavg -size 16G

Virtual Media Repository Created
Repository created within “VMLibrary_LV” logical volume

This basically creates my optical library logical volume, as you can see:

$ oem_setup_env
# df
Filesystem 512-blocks Free %Used Iused %Iused Mounted
on
/dev/hd4 524288 458656 13% 2666 5% /
/dev/hd2 7340032 612624 92% 61350 46% /usr
/dev/hd9var 1310720 1223608 7% 447 1% /var
/dev/hd3 4718592 4302464 9% 48 1% /tmp
/dev/hd1 20971520 17088808 19% 60 1% /home
/proc – – – – – /proc
/dev/hd10opt 1572864 647912 59% 10655 13% /opt
/dev/VMLibrary_LV 33554432 33417600 1% 4 1%
/var/vio/VMLibrary

Then I copy my .iso files (which can be created from CD if you don’t have them) to /var/vio/VMLibrary. If you don’t have .iso images, you can insert a CD (after assigning the CD-ROM to your VIO partition) and run:

mkvopt -name .iso -dev cd0 -ro

where is what you want to call the file.

After the .iso file is in your /var/vio/VMLibrary directory, run:

mkvdev -fbo -vadapter vhost4
vtopt0 Available

(Obviously you’ll replace vhost4 with whatever vhost adapter you plan to use in your VIO server.)

This mkvdev command creates your virtual optical device. Now run loadopt and it loads your CD image as if it were located in the CD device. This was a great solution for the situation I faced, where I wanted to load AIX 6 even though my Network Installation Management (NIM) server hadn’t been updated to AIX 6.

I ran:

loadopt -vtd vtopt0 -disk
cd.AIX_6_OpenBeta.0737.V1.ISO

After the loadopt command, I could run lsmap on the vadapter I’d assigned to my vtopt device earlier in the mkvdev command.

lsmap -vadapter vhost4

SVSA            Physloc                                      Client Partition ID
————— ——————————————– ——————
vhost4          U9131.52A.0649DDG-V5-C7                      0x00000000

VTD                   vtopt0
Status                Available
LUN                   0x8100000000000000
Backing device        /var/vio/VMLibrary/cd.AIX_6_OpenBeta.0737.V1.ISO
Physloc

From here I just booted my partition from this virtual CD and loaded the OS onto it.

When the first CD finished, I was prompted to remove CD1, insert CD2 and click Enter. So I went back to my vio server and ran:

unloadopt -vtd vtopt0

then I ran:

loadopt -vtd vtopt0 -disk
cd.AIX_6_OpenBeta.0737.V2.ISO

and selected Enter in my terminal window. The install continued as if I’d moved physical media around.

I obviously did the same when prompted to load CD3.

As IVM is running VIO server, there’s no reason you can’t use these same commands on either your IVM or HMC managed machines using the command line.