EXAMPLE. A Smart Admin's NIM - using mkcd and creating a bootable ISO image from mksysb images.

 

- Create an ISO image of bxaix85 from an existing mksysb file. I had already created a mksysb file of bxaix85 in /usr/sap/put/bxaix85-mksysb.

 

root@bxaix85 /usr/sap/put # mkcd -L -S -I /usr/sap/put/image -m /usr/sap/put/bxaix85-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: /usr/sap/put/image/cd_image_712892

Running mkisofs ...

....

mkrr_fs was successful.

 

Making the CD or DVD image bootable...

 

 

Removing temporary file system: /mkcd/cd_fs...

 

root@bxaix85 /usr/sap/put # ls -ltr

total 4369112

drwxr-xr-x    2 root     system          256 Aug 20 10:31 lost+found

-rw-r--r--    1 root     system   2236979200 Dec 10 09:16 bxaix85-mksysb

drwxr-xr-x    2 root     system          256 Dec 10 09:23 image

 

 

- Confirm the ISO image has been created.

 

root@bxaix85 /usr/sap/put # cd image

root@bxaix85 /usr/sap/put/image # ls -ltr

total 4483256

-rw-r--r--    1 root     system   2295425024 Dec 10 09:24 cd_image_712892

 

- Copy the image to the VIOS virtual media library directory.

 

# df -m .

Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on

/dev/VMLibrary_LV   7168.00   2768.93   62%        6     1% /var/vio/VMLibrary

 

# scp 10.3.29.160:/usr/sap/put/image/cd_image_712892 .

root@10.3.29.160's password:

cd_image_712892                               100% 2189MB  40.5MB/s   00:54

 

# ls -ltr

total 13432312

drwxr-xr-x    2 root     system          256 Dec 03 11:08 lost+found

-rw-r--r--    1 root     staff    3857645568 Dec 04 08:53 AIX61_DVD_1.iso

-rw-r--r--    1 root     staff     724271104 Dec 04 10:09 AIX61_DVD_2.iso

-rw-r--r--    1 root     staff    2295425024 Dec 10 09:33 cd_image_712892

 

- Rename the image to a more meaningful name.

 

# mv cd_image_712892 bxaix85_mksysb.iso

 

# ls -ltr

total 13432312

drwxr-xr-x    2 root     system          256 Dec 03 11:08 lost+found

-rw-r--r--    1 root     staff    3857645568 Dec 04 08:53 AIX61_DVD_1.iso

-rw-r--r--    1 root     staff     724271104 Dec 04 10:09 AIX61_DVD_2.iso

-rw-r--r--    1 root     staff    2295425024 Dec 10 09:33 bxaix85_mksysb.iso

 

- Map a virtual optical device to the client LPAR.

 

$ lsmapvadapter vhost1

SVSA            Physloc                                      Client Partition ID

--------------- -------------------------------------------- ------------------

vhost1          U7998.61X.10071DA-V1-C13                     0x00000000

 

VTD                   vtscsi3

Status                Available

LUN                   0x8100000000000000

Backing device        lp2vd1

Physloc

 

$ mkvdev -fbo -vadapter vhost1

vtopt0 Available

 

$ lsmapvadapter vhost1

SVSA            Physloc                                      Client Partition ID

--------------- -------------------------------------------- ------------------

vhost1          U7998.61X.10071DA-V1-C13                     0x00000000

 

VTD                   vtopt0

Status                Available

LUN                   0x8200000000000000

Backing device

Physloc

 

VTD                   vtscsi3

Status                Available

LUN                   0x8100000000000000

Backing device        lp2vd1

Physloc

 

$ lsrep

Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free

    7139      579 rootvg                   139776            57344

 

Name                                    File Size Optical         Access

AIX61_DVD_1.iso                              3679 None            rw

AIX61_DVD_2.iso                               691 None            rw

bxaix85_mksysb.iso                           2190 None            rw

 

$ loadopt -f -vtd vtopt0 -disk bxaix85_mksysb.iso

 

$ lsmap -vadapter vhost1

SVSA            Physloc                                      Client Partition ID

--------------- -------------------------------------------- ------------------

vhost1          U7998.61X.10071DA-V1-C13                     0x00000000

 

VTD                   vtopt0

Status                Available

LUN                   0x8200000000000000

Backing device        /var/vio/VMLibrary/bxaix85_mksysb.iso

Physloc

 

VTD                   vtscsi3

Status                Available

LUN                   0x8100000000000000

Backing device        lp2vd1

Physloc

 

- Boot the LPAR from the virtual ÒSCSI CDÓ and install the image as ÒnormalÓ.

 

 

 

 

 

- On the VIOS you will see the fbdisk_io process.

 

 

regards,

 

Chris Gibson

AIX Specialist

Australia Post

 

 

Subject:                    A Smart Admin's NIM - using mkcd and creating a bootable ISO image from mksysb images.

 

A Smart Admin's NIM

In last week's AIXchange entry, I wrote about Janel Barfield's presentation on file-backed virtual disks. The end of the slides from her presentation included a statement about using mkcd and creating a bootable ISO image from mksysb images. This allows you to use a virtual optical device as a "smart man's" NIM. I've been using base OS install media with virtual optical devices, so using mksysb files with virtual optical devices looked like another great idea. This would allow me to bypass setting up a NIM server and worrying about network speeds and settings. I'd just install my operating systems directly over the hypervisor.

I took a spare mksysb image and ran the mkcd command. By doing so, I immediately discovered that the operating system of the machine upon which you're running the mkcd command had better not be down-level compared to the OS of the machine from which you take it. Once I reran the command on a machine with the same OS level, it was fine.

From the man page: "The mkcd command creates a system backup image (mksysb) to CD-Recordable (CD-R) or DVD-Recordable (DVD-R, DVD-RAM) from the system rootvg or from a previously created mksysb."

Here's the command I used. (If you have a better suggestion on how to run it, please post it in comments.)

mkcd -L -S -I /testfs -m /home/guest/mksysbfile

Learn more about the flags from the man page for mkcd:

á      -L creates final CD images that are DVD sized (up to 4.38 GB).

á      -S stops mkcd before writing to the CD-R, DVD-R or DVD-RAM without removing the final CD images.

á      -I cd_image_dir specifies the directory or file system where the final CD images are stored before writing to the CD-R, DVD-R or DVD-RAM device.

á      -m mksysb_image specifies a previously created mksysb image.


In this case I wanted to use an existing mksysb image, but you could also use mkcd from cron to create your mksysb image from scratch.

When the command finished processing, my ISO image resided in /testfs and I moved the resultant image to my VIO server's /var/vio/VMLibrary directory.

I was then able to use this image to boot my LPAR. The installation was fast, and I quickly had a clone of my source machine without having to set up any resources on my NIM server or set any network settings on my client machine.

Although restoring mksysb images from NIM is a great way to ensure you have bootable backups in a DR situation, using ISO images and virtual optical disks is yet another method that you can use to bare metal restore your AIX machines.