Restoring mksysb image without nim using virtual optical disk and mkcd command

Sometimes, it can be very usefull to restore an lpar through CD/DVD. For example, your LPAR cannot access any known VLAN, or you don’t have any nim server. PowerVM virtualisation provides the ability to store images into repositories and to load them on Virtual Optic Devices. LPAR can be restored very easy with this method.

Creating image repository

First of all you need to create a Repository to store virtual media cd, use mkrep command create this Repository.
This Repository has to be created on an Storage Pool, by default, rootvg Storage Pool exists.

# lssp
Pool   Size(mb) Free(mb) Alloc Size(mb) BDs Type
rootvg 279552   201216         256      0 LVPOOL
# mkrep -sp rootvg -size 20G
Virtual Media Repository Created
Repository created within "VMLibrary" logical volume
# lsrep
Size(mb) Free(mb) Parent Pool Parent Size Parent Free
  20396    20396  rootvg           279552      201216

Adding virtual scsi adapter on LPAR and on VIO Server

On client LPAR

On lpar, create a new Client SCSI Adapter device as described below :
As you can see on image below (you can choose whatever you want) :

  • Client Vscsi adapter ID is set to 100.
  • Server Vscsi adapter ID is set to 100.

On VIO Server

On VIO Server, create a new Server SCSI Adapter device as described below :

As you can see on image below, Client Vscsi adapter ID (100) and Server Vscsi adapter ID are matching :

Post cheks on VIO Server

On VIO Server check that Virtual SCSI adapter is here, and is matching with our ID (100) :

# lsdev -type adapter | grep vhost0
vhost0           Available   Virtual SCSI Server Adapter
# lsdev -slots | grep vhost0
U9119.FHB.84F55B6-V3-C100    Virtual I/O Slot  vhost0

Creating a DVD mksysb form an AIX Lpar

On the host you want to restore create an mksysb image with mksysb command :

# mksysb -i /mksysb_images/my_node.mksysb
[..]

You now have to convert this mksysb into CD/DVDs, unfortunatly it’s not possible to create a big iso file and you’ll have to choose CD or DVD format. Use the mkcd command to convert mksysb file into bootable CD/DVDs. In our example we’ll create DVD sized iso files.

# mkcd -L -S -I /mksysb_images/mkcd -m /mksysb_images/my_node.mksysb
Initializing mkcd log: /var/adm/ras/mkcd.log...
Verifying command parameters...
Creating temporary file system: /mkcd/cd_fs...
Populating the CD or DVD file system...
Building chrp boot image...
Copying backup to the CD or DVD file system...
......
Creating Rock Ridge format image: /mksysb_images/mkcd/cd_image_11010246.vol1
Running mkisofs ...
.......
mkrr_fs was successful.

Making the CD or DVD image bootable...

Copying the remainder of the backup to the CD or DVD file system...
Creating Rock Ridge format image: /mksysb_images/mkcd/cd_image_11010246.vol2
Running mkisofs ...
.......
mkrr_fs was successful.

Copying the remainder of the backup to the CD or DVD file system...
Creating Rock Ridge format image: /mksysb_images/mkcd/cd_image_11010246.vol3
Running mkisofs ...
...
mkrr_fs was successful.
  • -L : this option is used to create DVD sized iso images.
  • -S : this option is used to keep image file, and avoid writing it on a real DVD.
  • -I : specify the directory where images will be stored.
  • -m : mksysb image file to convert into DVDs.

mkcd command as created three DVD files :

# ls -l
total 53815784
-rw-r--r--    1 root     system   4274950144 Apr 30 13:09 cd_image_22872126.vol1
-rw-r--r--    1 root     system   4293890048 Apr 30 13:12 cd_image_22872126.vol2
-rw-r--r--    1 root     system   4293890048 Apr 30 13:14 cd_image_22872126.vol3

Adding images to VIO Server repository

After creating DVDs files from an mksysb file you’ll have to put them on VIO Server repository, transfer it via scp or NFS, and add it into repository :

# mkvopt -name cd_image_22872126.vol1 -file ./cd_image_22872126.vol1
# mkvopt -name cd_image_22872126.vol2 -file ./cd_image_22872126.vol2
# mkvopt -name cd_image_22872126.vol3 -file ./cd_image_22872126.vol3
# lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
   20397     7208 rootvg                   279552           201216

Name                                    File Size Optical         Access
cd_image_22872126.vol1                       4077 None            rw
cd_image_22872126.vol2                       4095 None            rw
cd_image_22872126.vol3                       4095 None            rw

Create Virtual Optic Device on VIO Server

On VIO Server create a Virtual Optic Device on Server Virtual SCSI Adapter with mkvdev command

# mkvdev -fbo -vadapter vhost0 -dev lpar_cdrom0
lpar_cdrom0 Available

Loading and Unloading Optic Device

You just have finished, load first DVD on Virtual Optic Device, boot the client on LPAR on Virtual SCSI Adapter and start you restore, then load DVDs one by one :

# loadopt -disk cd_image_22872126.vol1 -vtd lpar_cdrom0 -release
# lsrep
lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
   20397     7208 rootvg                   279552           201216

Name                                    File Size Optical         Access
cd_image_22872126.vol1                       4077 lpar_cdrom0     rw
cd_image_22872126.vol2                       4095 None            rw
cd_image_22872126.vol3                       4095 None            rw
# unloadopt -release -vtd lpar_cdrom0
# loadopt -disk cd_image_22872126.vol2 -vtd lpar_cdrom0 -release
lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
   20397     7208 rootvg                   279552           201216

Name                                    File Size Optical         Access
cd_image_22872126.vol1                       4077 None            rw
cd_image_22872126.vol2                       4095 lpar_cdrom0     rw
cd_image_22872126.vol3                       4095 None            rw

You’re done.

3 thoughts on “Restoring mksysb image without nim using virtual optical disk and mkcd command

  1. First! Thanks for the fantastic write up! I am building these servers from mksysb images, and even IBM support could not help me. You’ve saved my hide.

    Here are a few other speed bumps I’ve run into:

    1) Space on the IVM instance. Pitifully small, and I could have easily run out of disk space on my first attempt with this procedure. (under 200mb free when the mkcd completed.) Watch your headroom.
    2) Converting to DVDs – You must use the same OS version which created the mksysb image to convert it into bootable DVDs. You can’t use a 6.1 host to convert a 7.1 mksysb image into a bootable disk. The mkcd fails at the building chrp boot image… I’ve had to install an AIX71 partition/LPAR/virtual machine and create the DVDs on that system. Which also caused #3 to be done.
    3) Implement an NFS shared volume between the 7.1 instance and the IVM instance. Why? because IVM won’t let you upload images into the Media Library/Repository that are larger than 2GB, unless the disk is logically “local”. Yes you could SCP/FTP the files over, but for the time it’d take for the copy, plus the lack of disk space on the IVM image, versus the one minute or less to configure an NFS client mount, it’s a no brainer.
    4) Lastly, the installer for AIX doesn’t have proper terminal formatting, so please inform people F1 is equal to pressing ESC+1 (use ESC key like a shift key) and F10=ESC+0.

  2. Pingback: Restoring mksysb image without nim using virtual optical disk and mkcd command – Technical Blog for System Administrator

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>