Some New Virtual Disk Techniques

Edit: Changed to the current Power Systems Virtual User Group link as of this writing. The links to the presentation and replay may or may not work depending on the status of the transition from the developerworks site.

Originally posted December 2, 2008 on AIXchange

The AIX Virtual User Group (Central Region, U.S.) recently hosted an informative webinar presented by Janel Barfield. Download the presentation or listen to a replay. The topics covered in the presentation and replay go nicely with some AIXchange blog entries (here and here) I previously wrote.

By listening to the webinar, I learned a few other techniques that we can all benefit from. For instance, in my VIO server, I tried creating a file-backed virtual disk (obviously on this test box I was using rootvg; if this were a production machine I’d create another volume group and use that instead):

mksp -fb fbpool -sp rootvg -size 1G

This added a new file system to my rootvg:

lsvg –lv rootvg

fbpool             jfs2       4       4       1    open/syncd
/var/vio/storagepools/fbpool

In my environment I did an lsmap –all | more and found a client to try this with. I ran:

mkbdsp -sp fbpool 500m -bd test_disk -vadapter vhost2

Here’s the output I saw:

Creating file “test_disk” in storage pool “fbpool”.
Assigning file “test_disk” as a backing device.
vtscsi5 Available
test_disk

I wanted to see what would appear in the file system that I just created, so I ran:

ls -la /var/vio/storagepools/fbpool

total 1024008
drwxr-xr-x   3 root     system          256 Nov 03 15:24 .
drwxr-xr-x   3 root     staff           256 Nov 03 15:18 ..
-rw-r–r–   1 root     staff           206 Nov 03 15:24 .test_disk
drwxr-xr-x   2 root     system          256 Nov 03 15:18 lost+found
-rw-r–r–   1 root     staff     524288000 Nov 03 15:24 test_disk

Interestingly, that .test_disk file contains some XML data describing the disk that I just created:

more /var/vio/storagepools/fbpool/.test_disk

When I look at the mapping that exists after creating the disk, I can see:

 lsmap -vadapter vhost2
SVSA            Physloc                                      Client Partition ID
————— ——————————————– ——————
vhost2          U7998.61X.100BB8A-V1-C15                     0x00000007

VTD                   vtscsi2
Status                Available
LUN                   0x8100000000000000
Backing device        hdisk3
Physloc
U78A5.001.WIH0A68-P1-C6-T1-W5005076801303022-LD000000000000

VTD                   vtscsi5
Status                Available
LUN                   0x8200000000000000
Backing device        /var/vio/storagepools/fbpool/test_disk
Physloc
U78A5.001.WIH0A68-P1-C6-T1-W5005076801303022-LD000000000000

This shows me that now I have the new virtual disk with the backing device being handled by the newly created file. When I run cfgmgr in my partition that uses vhost2, I see a new disk. AIX running in my partition doesn’t differentiate between the file-backed storage or my normal hdisk-backed storage (hdisk1 is my newly created disk in this instance).

# lspv
hdisk0          00004daa45ffe3fd                    rootvg          active
hdisk1          none                                None

# lsdev -Cc disk
hdisk0 Available  Virtual SCSI Disk Drive
hdisk1 Available  Virtual SCSI Disk Drive

I can now use this disk as I would any other on my machine.

On the topic of virtual optical disks, one point brought up in the webinar was that instead of running multiple unloadopt/loadopt commands when using virtual optical disks, you can just use loadopt –f to force the disk image to load, even if a disk image is already loaded. This makes it simpler when using more than one CD to load the OS for instance, as you don’t have to unloadopt before running the loadopt –f command when switching between disk images.

I urge you to take the time to look over the presentation materials as well as listen to the replay to get more information. Also be sure check the Central Region user group archives for some other great webinars.