http://chmod666.org/index.php/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

Advertisements