Vous êtes sur la page 1sur 17

NIM Master and Client Management

Author: Pierre Garon

Audience..............................................................................................................................3
Environments.......................................................................................................................3
Requirements.......................................................................................................................3
Mksysb backup management by NIM master.....................................................................3
Resource management.....................................................................................................4
Restrictions......................................................................................................................4
Recovery prodecure.............................................................................................................4
#1:................................................................................................................................4
#2:................................................................................................................................5
#3:................................................................................................................................5
#4:................................................................................................................................6
#5:................................................................................................................................8
NOTE Restore by rebooting in SMS........................................................................8
Script for mksysbs..............................................................................................................14
Boot standalone or lpar in maintenance mode via NIM....................................................15

Audience
This document is intended to the AIX system administrators that manage servers on the
Air Canada account, Tivoli on Demand and SDM-NewScale environment (IBM Internal).
In this document you will read on the usage of a NIM Master to backup AIX images,
manage these backup resources withing the NIM environment and various recovery
methods (mksysb restores or boot in maintenance mode to recover the standalone server
or LPAR).

Environments
The environments consist of two NIM servers:
Air Canada: NIM resides on a LPAR acsgyul00010 on a P-550
ToD/SDM-NewScale: NIM resides on a LPAR camtqbr000todxa on P-570
These two lpars are strictly using virtual devices managed by VIO servers on their
respective frame.

Requirements
The requirements for this process to be fully functional are:
1. Proper NIM server installed and configured (in the two environments it is already
done).
2. Proper disk space. This is decided upon contractual obligations or negociated
understandings. On the Air Canada account, there is a need to keep X versions
and in the ToD/SDM-NewScale environment two versions are to be kept.
3. Backup location file system to be exported to all registered NIM clients.
4. Proper NIM client communication with the master.

Mksysb backup management by NIM master


To backup an AIX OS image by the NIM master, the client has to be registered and
communication allowed with the master. Take note that if the NIM client was installed
via a NIM installation, the requirements should be met.
To manage the mksysb images via the NIM master the following command is to be used
and will produce the following output:
nim -o define -t mksysb -a server=master -a source=testlpar -a mk_image=yes -a
location=/export/backups/mksysb/testlpar testlpar_mksysb_test
+---------------------------------------------------------------------+
System Backup Image Space Information
(Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+
Required = 1117553 (1092 MB) Available = 10671176 (10422 MB)
Creating information file (/image.data) for rootvg..
Creating list of files to back up ..
Backing up 29300 files..............................
17531 of 29300 files backed up (59%)...................
29300 of 29300 files backed up (100%)
0512-038 savevg: Backup Completed Successfully.

Resource management
Once the backup is completed, a new resource was created at the NIM master level. To
view the resource type the following command:
# lsnim -t mksysb
5300-03master_sysb
resources
mksysb
testlpar_mksysb_1430160407
resources
mksysb
acsgyul00002_mksysb_1713140407 resources
mksysb
testlpar_mksysb_1430170407
resources
mksysb
acsgyul00005_mksysb_1725140407 resources
mksysb

In the above output, all the mksysb resources managed by the NIM master are listed.
Via smitty, the deletion of the resource is done via command:
nim o remove imagename where image name is the resource listed from the list
mksysb resources (lsnim t mksysb). There is an additional parameter that can be
passed along which is delete the image file (yes or no).
More information will be made available in this document as this process is going to be
managed more and more and situations will be encountered.

Restrictions
If mksysb backups are to be triggered and managed by the NIM master, only one backup
can be running at a specific time therefore, serial backups have to be done. A quick
recommendation would be to create a script that will run all the required mksysb backups
in sequence.

Recovery prodecure
This test case will demonstrate a recovery of server/lpar using a mksysb image resource.
The scenario will use NIM server on lpar acsgyul00010 and a test LPAR named testlpar.
The steps that this test case will demonstrate are:
1. creation of a dummy file for proof of proper recovery.
2. mksysb backup taken from the NIM.
3. setup of NIM master to allow recovery of the test lpar.
4. recovery steps from a standalone server or LPAR. In this case, it will be LPAR.
5. verification of the recovered lpar.

#1:
# hostname
testlpar
# cd /tmp
# ls
.all_media_efix_packages.295166 299108.mnt0
dpi_socket
.ctinst.log
Spmi_shm_hook
lost+found
.oslevel.datafiles
_nim_299108.err
rc.net.out
.sr_migrate.log
_nim_319626
rc.net.serial.out
.strload.mutex
_nim_dir_299108
vgdata
.toc
bos
# touch TOCONFIRMMKSYSBBACKEDUPTHISFILE

# ls
.all_media_efix_packages.295166 299108.mnt0
bos
.ctinst.log
Spmi_shm_hook
dpi_socket
.oslevel.datafiles
TOCONFIRMMKSYSBBACKEDUPTHISFILE lost+found
.sr_migrate.log
_nim_299108.err
rc.net.out
.strload.mutex
_nim_319626
rc.net.serial.out
.toc
_nim_dir_299108
vgdata

The file was created.

#2:
Backup command and status:
root@acsgyul00010:/export/backups/mksysb/testlpar#
nim -o define -t mksysb -a server=master -a source=testlpar -a mk_image=yes -a
location=/export/backups/mksysb/testlpar_mksysb_test testlpar_mksysb_test
<
+---------------------------------------------------------------------+
System Backup Image Space Information
(Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+
Required = 1119825 (1094 MB)

Available = 6634224 (6479 MB)

Creating information file (/image.data) for rootvg..


Creating list of files to back up .
Backing up 29324 files..............................
17552 of 29324 files backed up (59%)...................
29324 of 29324 files backed up (100%)
0512-038 savevg: Backup Completed Successfully.

Backup completed.

#3:
Deletion of the created test file (TOCONFIRMMKSYSBBACKEDUPTHISFILE):
# ls
.all_media_efix_packages.295166 299108.mnt0
bos
.ctinst.log
Spmi_shm_hook
dpi_socket
.oslevel.datafiles
TOCONFIRMMKSYSBBACKEDUPTHISFILE lost+found
.sr_migrate.log
_nim_299108.err
rc.net.out
.strload.mutex
_nim_319626
rc.net.serial.out
.toc
_nim_dir_299108
vgdata
# rm TOCONFIRMMKSYSBBACKEDUPTHISFILE
# ls
.all_media_efix_packages.295166 299108.mnt0
dpi_socket
.ctinst.log
Spmi_shm_hook
lost+found
.oslevel.datafiles
_nim_299108.err
rc.net.out
.sr_migrate.log
_nim_319626
rc.net.serial.out
.strload.mutex
_nim_dir_299108
vgdata
.toc
bos

#4:
Setup of the NIM master to allow recovery from its client:
root@acsgyul00010:/export/backups/mksysb/testlpar#
smitty nim_bosinst

Select the machine resource that you need:

Select the type of install you want to perform. In this case its a mksysb restoral:

In our test we created mksysb_testlpar_test resource so were selecting this one:

Select the following SPOT:

Use the default settings in the next screen and press enter.

Leaving all the option to default will trigger the NIM master to shutdown the standalone
server or lpar and will start the restore on its own.
To avoid this scenario, you need to change to no the following option in smitty:

Initiate reboot and installation now?

[yes] <<--- Change to no

To verify if the NIM master is ready to accept the client, do the following:
lsnim -l testlpar
testlpar:
class
= machines
type
= standalone
connect
= shell
comments
= test lpar for a nim install
platform
= chrp
netboot_kernel = mp
if1
= master_net testlpar 0
cable_type1 = tp
Cstate
= BOS installation has been enabled
prev_state = ready for a NIM operation
Mstate
= currently running
boot
= boot
mksysb
= testlpar_mksysb_test
nim_script = nim_script
spot
= 530spot_res
cpuid
= 00CE12FF4C00
control
= master
Make sure that the Cstate shows Cstate
= BOS installation has been enabled

On the standalone server or LPAR you should see/watch the progress.


To complete the test case, at the completion of the restore the standalone server or LPAR
will reboot. Once it becomes available, login and check to ensure that all is correct.

#5:
In our test case, heres the confirmation that the restore of the proper image was restored:
# cd /tmp
# ls
.all_media_efix_packages.295166 Spmi_shm_hook
bos
.ctinst.log
TOCONFIRMMKSYSBBACKEDUPTHISFILE dpi_socket
.oslevel.datafiles
_nim_299108.err
lost+found
.sr_migrate.log
_nim_319496
rc.net.out
.strload.mutex
_nim_319626
rc.net.serial.out
.toc
_nim_348256.err
vgdata
299108.mnt0
_nim_dir_299108
348256.mnt0
_nim_dir_348256

The dummy file used in our test is there.

NOTE Restore by rebooting in SMS


If you decided not to have the NIM master reboot and install on the client (see above)
you will need to boot the standalone or LPAR via SMS to start the install. To do so
perform the following:

Ensure the nim client is ready:


lsnim -l testlpar
testlpar:
class
= machines
type
= standalone
connect
= shell
comments
= test lpar for a nim install
platform
= chrp
netboot_kernel = mp
if1
= master_net testlpar 0
cable_type1 = tp
Cstate
= BOS installation has been enabled
prev_state = ready for a NIM operation
Mstate
= currently running
boot
= boot
mksysb
= testlpar_mksysb_test
nim_script = nim_script
spot
= 530spot_res
cpuid
= 00CE12FF4C00
control
= master

Another important status to check is the NIM client file in /tftpboot. The following two
files have to be present:
root@acsgyul00010:/tftpboot#
ls -l
total 24472
-rw-r--r-- 1 root system 12525568 Apr 11 15:42 530spot_res.chrp.mp.ent
drwxr-xr-x 2 root system
256 Apr 10 14:19 lost+found
lrwxrwxrwx 1 root system
33 Apr 17 21:41 testlpar -> /tftpboot/530spot_res.chrp.mp.ent
-rw-r--r-- 1 root system
1142 Apr 17 21:41 testlpar.info

Reboot to SMS the standalone server or LPAR:


Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Main Menu
1. Select Language
2. Setup Remote IPL (Initial Program Load)
3. Change SCSI Settings
4. Select Console
5. Select Boot Options
------------------------------------------------------------------------------Navigation Keys:
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 2

Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------NIC Adapters
Device
Location Code
Hardware
Address
1. Interpartition Logical LAN
U9113.550.10E12FF-V6-C3-T1 626a6819c03d
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 1
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Network Parameters
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. IP Parameters
2. Adapter Configuration
3. Ping Test
4. Advanced Setup: BOOTP
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 1

Select each option and enter the proper information. Use the NIM IP address as the
gateway IP address.
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------IP Parameters
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. Client IP Address
[10.43.2.29]
2. Server IP Address
[10.43.2.199]
3. Gateway IP Address
[10.43.2.199]
4. Subnet Mask
[255.255.255.0]
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 1

Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Network Parameters
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. IP Parameters
2. Adapter Configuration
3. Ping Test
4. Advanced Setup: BOOTP
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:2
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Adapter Configuration
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. Speed,Duplex
2. Spanning Tree Enabled
3. Protocol
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 1
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Speed,Duplex
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. auto,auto ( none ) <===
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:1
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Spanning Tree Enabled
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. Yes

2. No <===
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 2
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Protocol
Interpartition Logical LAN: U9113.550.10E12FF-V6-C3-T1
1. Standard <===
2. IEEE802.3
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key: 1

Perform the ping test and once the success message is received, you can go to the main
menu by pressing M.
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Main Menu
1. Select Language
2. Setup Remote IPL (Initial Program Load)
3. Change SCSI Settings
4. Select Console
5. Select Boot Options
------------------------------------------------------------------------------Navigation Keys:
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:5
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Multiboot
1. Select Install/Boot Device
2. Configure Boot Device Order
3. Multiboot Startup <OFF>
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services

------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:1
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Select Device Type
1. Diskette
2. Tape
3. CD/DVD
4. IDE
5. Hard Drive
6. Network
7. List all Devices
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:6
Version SF240_284
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Select Device
Device Current Device
Number Position Name
1.
Virtual Ethernet
( loc=U9113.550.10E12FF-V6-C3-T1 )
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:1
SMS 1.6 (c) Copyright IBM Corp. 2000,2005 All rights reserved.
------------------------------------------------------------------------------Select Task
Virtual Ethernet
( loc=U9113.550.10E12FF-V6-C3-T1 )
1. Information
2. Normal Mode Boot
3. Service Mode Boot
------------------------------------------------------------------------------Navigation keys:
M = return to Main Menu
ESC key = return to previous screen
X = eXit System Management Services
------------------------------------------------------------------------------Type menu item number and press Enter or select Navigation key:2

Once Yes is answered to continue, something similar to the messages below should
appear and the install should then begin:
BOOTP: chosen-network-type = ethernet,auto,none,auto
BOOTP: server IP =
10.43.2.199
BOOTP: requested filename =
BOOTP: client IP =
10.43.2.29
BOOTP: client HW addr = 62 6a 68 19 c0 3d
BOOTP: gateway IP =
10.43.2.199
BOOTP: device /vdevice/l-lan@30000003
BOOTP: loc-code U9113.550.10E12FF-V6-C3-T1
BOOTP R = 1 BOOTP S = 2

Script for mksysbs


The following is a simple script that will cleanup the backup file location, delete the
required mksysb resources and trigger the mksysb from the NIM master:
#!/bin/ksh
# To perform an lpar mksysb onto the nim.
# This will create a new nim resource therefore maintenance
# is required on a regular basis in order to keep a clean
# filesystem and nim environment.
#
# Declare vars
export NIM_MKSYSB_SUBDIRS=yes
export MKSYSBDIR=/export/backups/mksysb
export DATE=`date +%H%M%d%m%y`
export LPARMKSYSBDIR=/export/backups/mksysb/testlpar_mksysb_$DATE
################################################
# Verify the mksysb resources for the lpar
################################################
/usr/bin/echo "List of NIM mksysb resources for testlpar"
lsnim -t'mksysb' | grep testlpar
/usr/bin/echo "Deleting old mksysb resources and files"
# NIM Maintenance section
# Change dir and check for files to delete
cd /export/backups/mksysb/testlpar
oldres=`find . -mtime +1 -print;`
echo $oldres > /root/NIM/testlpar.list
sed "s/.\///g" /root/NIM/testlpar.list > /root/NIM/testlpar.list.delete
# This section is to delete the NIM resource
for i in `cat /root/NIM/testlpar.list.delete`
do
nim -o remove $i
done
# This section is to delete the NIM backup file.
for i in `cat /root/NIM/testlpar.list`
do
rm -f /export/backups/mksysb/testlpar/$i
done
# List NIM resources and files

/usr/bin/echo "NIM res and files after maintenance:"


lsnim -t'mksysb'
ls -l /export/backups/mksysb/testlpar
# Trigger the mksysb
nim -o define -t mksysb -a server=master -a source=testlpar -a mk_image=yes -a
location=$LPARMKSYSBDIR testlpar_mksysb_$DATE

Boot standalone or lpar in maintenance mode via NIM


Different situation may require a standalone server or lpar to be booted in maintenance
mode (root password lost, kernel stuck at startup due to a wrong value in a parameter,
etc). To boot in maintenance mode via the NIM master server, do the steps listed
below:
On the NIM master:
root@acsgyul00010:/root#
lsnim -l testlpar
testlpar:
class
= machines
type
= standalone
connect
= shell
comments
= test lpar for a nim install
platform
= chrp
netboot_kernel = mp
if1
= master_net testlpar 0
cable_type1 = tp
Cstate
= ready for a NIM operation
prev_state = not running
Mstate
= currently running
cpuid
= 00CE12FF4C00
Cstate_result = success
root@acsgyul00010:/root#
nim -o maint_boot -a spot=530spot_res testlpar
root@acsgyul00010:/root#
lsnim -l testlpar
testlpar:
class
= machines
type
= standalone
connect
= shell
comments
= test lpar for a nim install
platform
= chrp
netboot_kernel = mp
if1
= master_net testlpar 0
cable_type1 = tp
Cstate
= maintenance boot has been enabled
prev_state = ready for a NIM operation
Mstate
= currently running
boot
= boot
spot
= 530spot_res
cpuid
= 00CE12FF4C00
control
= master

On the standalone server or lpar, boot in SMS using the same steps as in the NOTE
Restore by rebooting in SMS section (configure IP, etc). Once the environment is
booted in maintenance mode, import rootvg and start a shell. Here are some of the screen
shots:
You will be prompted to press 1 and enter to select the console and to press 1 again for
English during the maintenance.
Maintenance
Type the number of your choice and press Enter.
>>> 1 Access a Root Volume Group
2 Copy a System Dump to Removable Media
3 Access Advanced Maintenance Functions
4 Erase Disks
88 Help ?
99 Previous Menu
>>> Choice [1]: 1
Warning:
If you choose to access a root volume group, you will NOT be able to return
to the Base Operating System Installation menus without rebooting.
Type the number of your choice and press Enter.
0 Continue
88 Help ?
>>> 99 Previous Menu
>>> Choice [99]: 0
Access a Root Volume Group
Type the number for a volume group to display the logical volume information
and press Enter.
1) Volume Group 00ce12ff00004c000000011201a13ab3 contains these disks:
hdisk0 17216
vscsi
Choice: 1
-----------------------------------------------------------------------------Volume Group ID 00ce12ff00004c000000011201a13ab3 includes the following
logical volumes:
hd5
hd6
hd8
hd4
hd2
hd9var
hd3
hd1 hd10opt
------------------------------------------------------------------------------

Type the number of your choice and press Enter.


1) Access this Volume Group and start a shell
2) Access this Volume Group and start a shell before mounting filesystems
99) Previous Menu
Choice [99]: 1
Importing Volume Group...

Once the file system checks are completed, you should get your prompt to start doing the
maintenance work:
Filesystems mounted for maintenance work.
# df -k
Filesystem 1024-blocks
Free %Used Iused %Iused Mounted on
/dev/ram0
32768 14076 58% 1855 36% /
acsgyul00010.aircanada.ca:/export/aix53/spot/530spot_res/usr
df: /SPOT/usr: No such file or directory
/dev/hd4
32768 14076 58% 1855 36% /
/dev/hd2
1146880 83832 93% 25401 55% /usr
/dev/hd3
65536 64028 3%
38 1% /tmp
/dev/hd9var
32768 24888 25% 344 6% /var

Vous aimerez peut-être aussi