0% found this document useful (0 votes)
27 views45 pages

Nim201 Oct272024

The document outlines the setup and management of the Network Installation Manager (NIM) for AIX systems, including various commands and configurations necessary for installation, backup, and maintenance of AIX LPARs and VIO servers. It highlights upcoming enhancements to NIM, such as support for concurrent migrations and improved resource management. Additionally, it provides detailed instructions for creating LPP and SPOT resources, checking network setups, and listing NIM resources.

Uploaded by

raj0000kaml
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views45 pages

Nim201 Oct272024

The document outlines the setup and management of the Network Installation Manager (NIM) for AIX systems, including various commands and configurations necessary for installation, backup, and maintenance of AIX LPARs and VIO servers. It highlights upcoming enhancements to NIM, such as support for concurrent migrations and improved resource management. Additionally, it provides detailed instructions for creating LPP and SPOT resources, checking network setups, and listing NIM resources.

Uploaded by

raj0000kaml
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

10/27/2024

NIM 201
• Jaqui Lynch
[email protected]
• Handout: https://www.circle4.com/ptechu/nim201-oct272024.pdf

ARTICLES
• Adventures with NIMADM
• https://techchannel.com/systems-management/nimadm-aix-v7-2-to-v7-3/
• Article from 2019 on Using NIM with VIO Servers
• http://www.circle4.com/jaqui/eserver/usingnimwithVIO-sep2019.pdf
• NIM Tips and Tricks (2017)
• https://www.circle4.com/jaqui/eserver/NIM-tipsandtricks-july2017.pdf

Agenda
• Introduction
• NIM Setup
• Working with mksysbs
• Useful Commands
• nimadm
• VIOS and NIM
• Hints and tips

1
10/27/2024

Cool NIM things you can do


• Install and maintain systems
• Backup and restore AIX LPARs and VIO servers
• Update LPARs and VIO servers
• Install ifix into a NIM spot
• Alternate disk – install, copy, clone
• Migrations
• Alternate Masters

Upcoming NIM Enhancements


• AIX 7.3 TL3 - 12 December 2024, for electronic delivery
• The AIX nimadm utility is enhanced to support concurrent migration of
multiple LPARs
• AIX NIM is enhanced to better manage resources for multiple tenants or
groups of systems from a single NIM server. This can help reduce the
need to deploy and maintain multiple NIM server instances
• AIX Collection for Ansible NIM enhancements

• https://www.ibm.com/docs/en/announcements/aix-enhancements-4q-
2024-aix-seee-private-cloud-ed-powerha?region=US

2
10/27/2024

NIM Server Setup


• Must be at highest level of AIX that you plan to support
• Should use dedicated resources for Disk and Network
• Affects ability to restore images if depends on VIO
• Same applies to TSM server
• Do not combine NIM and TSM on same LPAR
• Makes upgrades difficult
• Plan for memory (2-4GB is plenty) and core (.5 of a core with 2 VPs)
• Create scalable VG - nimvg on disk to hold NIM resources
• Do not put NIM resources into rootvg
• Create /nim filesystem in nimvg (JFS2)
• I also create a separate filesystem called /backups for mksysb images
• Install filesets and any updates from TLs for them
• bos.sysmgt.nim.master
• bos.sysmgt.nim.spot
• bos.sysmgt.nim.client
• Also ensure the following filesets are installed
• bos.net.tcp.server
• bos.net.nfs.server
• Use lslpp to check they are there

More Setup
• Note – NIM does not like dot in resource names so use _
• Put AIX DVD in the DVD drive or replace /dev/cd0 below with the directory you have the BFFs
from the DVD loaded up to
• Setup NIM
nim_master_setup –B –a device=/dev/cd0 -a file_system=/nim -a volume_group=nimvg
Creates /tftpboot
Will not take a mksysb of the NIM server
Creates SPOT and lpp_source resources in /nim

Directory Structure:
/nim
/nim/lpp_source
/nim/images
/nim/spot
/nim/bosinst_data
/nim/resolv_conf
I use /nim/mksysb for migrating mksysb images

3
10/27/2024

NIM on my AIX 7.3 system


#oslevel -s (on NIM Master)
7300-02-02-2420

#lslpp -l | grep bos.sysmgt.nim


bos.sysmgt.nim.client 7.3.2.1 COMMITTED Network Install Manager -
bos.sysmgt.nim.master 7.3.2.1 COMMITTED Network Install Manager -
bos.sysmgt.nim.spot 7.3.2.1 COMMITTED Network Install Manager - SPOT
bos.sysmgt.nim.client 7.3.2.1 COMMITTED Network Install Manager

# df -g /nim
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/lvnim 450.00 393.58 13% 69573 1% /nim

#ls -al /nim


total 32
drwxr-xr-x 8 root system 256 Mar 12 2022 .
drwxr-xr-x 25 root system 4096 Sep 5 16:21 ..
drwxr-xr-x 2 root system 256 Dec 26 2022 bosinst_data
drwxr-xr-x 2 root system 4096 Jun 15 19:37 images
drwxr-xr-x 2 root system 256 Mar 11 2022 lost+found
drwxr-xr-x 14 root system 4096 Jun 16 12:13 lpp_source
drwxr-xr-x 2 root system 256 Mar 12 2022 resolv_conf
drwxr-xr-x 19 root system 4096 Jun 16 12:18 spot
7

Check network setup


#cat /etc/hosts
192.168.2.71 vio1
192.168.2.72 vio2
192.168.2.73 aix1nim
192.168.2.74 aix2
192.168.2.75 aix3
192.168.2.76 aix4

# cat /etc/inetd.conf
##
## service socket protocol wait/ user server server program
## name type nowait program arguments
##
bootps dgram udp wait root /usr/sbin/bootpd bootpd /etc/bootptab
tftp dgram udp6 SRC nobody /usr/sbin/tftpd tftpd –n

Note – I quite often keep these commented out and only uncomment when I am using NIM

Do not TCP wrap these


For security reasons you can comment them out and just uncomment and refresh –s inetd
when you want to use them

4
10/27/2024

Check network setup


cat /etc/services | grep bootps
bootps 67/udp # Bootstrap Protocol Server
bootps 67/tcp # Bootstrap Protocol Server

cat /etc/services | grep bootpc


bootpc 68/tcp # Bootstrap Protocol Client
bootpc 68/udp # Bootstrap Protocol Client

cat /etc/services | grep tftp


tftp 69/udp # Trivial File Transfer
tftp 69/tcp # Trivial File Transfer

Above checks required services are defined

Make sure firewalls and routers allow these protocols to pass though

Create LPP and SPOT


Download base DVDs as ISO images and use smitty bffcreate to create a source directory containing the images
Download the latest service pack and save the images into a directory

Create an LPPsource
nim -o define -t lpp_source -a server=master -a source=/usr/local/software/aix72/ aix72tl5sp8-2420-base -a packages=all -a
location=/nim/lpp_source/ lpp_72tl5sp8-2420 lpp_72tl5sp8-2420

Update LPPsource with fixes and additional packages


nim -o update -a packages=all -a source=/usr/local/software/addons lpp_72tl5sp8-2420
nim -o update -a packages=all -a source=/usr/local/software/aix72/fix72 lpp_72tl5sp8-2420
nim -o update -a packages=all -a source=/usr/local/software/flrtfixes/sshssljava-aug162024 lpp_72tl5sp8-2420
nim -o showres lpp_72tl5sp8-2420 | grep bos.net
nim -o showres lpp_72tl5sp8-2420 | grep bos.alt.disk
bos.alt_disk_install.boot_images 7.2.5.208 I N usr
bos.alt_disk_install.rte 7.2.5.203 I N usr,root

nim -o check lpp_72tl5sp8-2420

Create the SPOT


nim -o define -t spot -a server=master -a source=lpp7212 -a location=/nim/spot/spot_72tl5sp8-2420 spot_72tl5sp8-2420
nim -o check spot_72tl5sp8-2420
nim -o cust -a filesets=bos.alt_disk_install.boot_images -a lpp_source= lpp_72tl5sp8-2420 spot_72tl5sp8-2420

You may need to use smitty to install bos.alt_disk_install.boot_images and bos.alt_disk_install.rte into the SPOT

nim -o showres spot_72tl5sp8-2420 | grep -i bos.alt

10

10

5
10/27/2024

List resources

11

11

List other items

12

12

6
10/27/2024

Show resources
nim -o showres lpp_72tl04sp2 | grep bos.suma
bos.suma 7.2.0.0 I N usr,root
bos.suma 7.2.3.15 S N usr,root

nim -o showres lpp_72tl04sp2 | grep -i bos.alt


bos.alt_disk_install.boot_images 7.2.0.0 I N usr
bos.alt_disk_install.boot_images 7.2.4.2 S N usr
bos.alt_disk_install.boot_images 7.2.4.6 S N usr
bos.alt_disk_install.rte 7.2.0.0 I N usr,root
bos.alt_disk_install.rte 7.2.4.0 S N usr,root

nim -o showres lpp_72tl04sp2 | grep -i Java


Lists all the Java levels
You can do the same for ssh and ssl to check the updates are in the LPP

nim -o showres spot_72tl04sp2 | grep -i bos.alt


bos.alt_disk_install.boot_images
bos.alt_disk_install.rte 7.2.4.1 A F Alternate Disk Installation

13

13

NIM Resources 1/2


#ls -l /nim/lpp_source
drwxr-xr-x 6 root system 256 Jun 16 12:17 lpp_72tl5sp8-2420
drwxr-xr-x 6 root system 256 Jun 16 12:16 lpp_73tl2sp2-2420

# ls –l /nim/spot
drwxr-xr-x 3 bin bin 256 Jun 15 19:44 spot_72tl5sp8-2420
drwxr-xr-x 3 bin bin 256 Jun 16 12:18 spot_73tl2sp2-2420
drwxrwxr-x 3 root system 256 Mar 12 2022 spotvios313_14
drwxrwxr-x 4 root system 256 Jun 16 12:12 spotvios41021

#ls –l /nim/images
-rw-r--r-- 1 root system 8488089600 Apr 24 09:38 xxmksysb-apr2417

#ls –l /nim/mksysb
-rw-r--r-- 1 root system 8231219200 Apr 24 11:24 xxapr2417mksysb
-rw-r--r-- 1 root system 8440883200 May 04 15:37 xxmksysb-sep222024

#lspv | grep nimvg


hdisk7 00f6934bdeb1713b nimvg active
hdisk63 00f6934be0630676 nimvg active
14

14

7
10/27/2024

NIM Resources 2/2


# lsvg nimvg
VOLUME GROUP: nimvg VG IDENTIFIER: 00f6934b00004c000000012ee06306b7
VG STATE: active PP SIZE: 512 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 998 (510976 megabytes)
MAX LVs: 256 FREE PPs: 83 (42496 megabytes)
LVs: 4 USED PPs: 915 (468480 megabytes)
OPEN LVs: 3 QUORUM: 2 (Enabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per VG: 32768 MAX PVs: 1024
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
MIRROR POOL STRICT: off
PV RESTRICTION: none INFINITE RETRY: no
DISK BLOCK SIZE: 512 CRITICAL VG: no
FS SYNC OPTION: no CRITICAL PVs: no

#lsvg -l nimvg
nimvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lvnimlog jfs2log 4 4 2 closed/syncd N/A
lvtftp jfs2 10 10 2 open/syncd /tftpboot
lvnim jfs2 900 900 2 open/syncd /nim
loglv04 jfs2log 1 1 1 open/syncd N/A

15

15

List resources 1/2


#lsnim -l gandalf
gandalf:
class = machines
type = standalone
connect = nimsh
platform = chrp
netboot_kernel = 64
if1 = master_net Gandalf 0
cable_type1 = N/A
Cstate = ready for a NIM operation
prev_state = not running
Mstate = currently running
cpuid = 00C242914B00
Cstate_result = success

16

16

8
10/27/2024

List resources 2/2

17

17

Install or Update a 7.3tl2sp2 resource


• Creates NIM resources for AIX 7.3 with tl2 sp2 applied
• Put update CD in or change into directory where iso image was used to create install files
• Update SPOT and lpp_source
smitty nim
Perform nim administration tasks
Manage resources
Perform operations on resources
Select the SPOT
Select update_all
Point it to the update CD or directory
• OR to create a new LPP and SPOT
nim -o define -t lpp_source -a server=master -a location=/nim/lpp_source/lpp_73tl02sp2 -a source=/software/aix73/
aix73tl2sp2-2420-base lpp_73tl2sp2-2420

nim -o update -a packages=all -a source=/software/aix73/ aix73tl2sp2-2420-updates lpp_73tl2sp2-2420

nim -o define -t spot -a server=master -a location=/nim/spot -a source= lpp_73tl2sp2-2420 spot_73tl2sp2-2420


nim -o check spot_73tl2sp2-2420
nim -o check lpp_73tl2sp2-2420
18
nim -o reset -a force=yes gandalf

18

9
10/27/2024

Install an ifix into a SPOT


• ifixes and efixes can be installed manually after a NIM install or they can be added to the SPOT so they go on
automatically

• Build your LPP and SPOT

• Put efixes into a directory


i.e for AIX 7.2.5.6 to install ij46487 into the SPOT
mkdir /nim/lpp_source/lpp_aix72tl5sp6/emgr/ppc
cd /usr/local/software/flrtfixes/ij46487
cp IJ46541s6a.230503.AIX72TL05SP06.epkg.Z /nim/lpp_source/lpp_aix72tl5sp6/emgr/ppc

• Now customize the SPOT from the directory


nim -o cust -a lpp_source=lpp_aix72tl5sp6 -a filesets=IJ46541s6a.230503.AIX72TL05SP06.epkg.Z spot_aix72tl5sp6

• You can list the efixes in a SPOT with:


nim -o lslpp -a lslpp_flags=e spot_aix72tl5sp6

• You can uninstall the fix using:


nim -Fo maint -a installp_flags=u -a filesets=IJ46541s6a spot_aixtl5sp6
19

19

Setup a client to restore from a mksysb


• Make sure aix2 (client) is in /etc/hosts or in DNS and that the name can be resolved
• Create the client (aix2) machine to nim as a machine object
• The first step is to define aix2 as a client machine
• smitty nim, perform NIM administrative tasks, manage machines, Define a machine
• Put in the hostname (i.e. aix2) as it is in /etc/hosts or DNS
• Select correct network type (usually ent)
• Select 64 as kernel, nimsh as shell, N/A as network i/face
• lsnim | grep aix2 check it is there
• Now create an image_data if you need one

20

20

10
10/27/2024

Image_data
• Template is /usr/lpp/bosinst/image.template
• Copy and modify
• Specify things like
• logical volume policy
• SHRINK=no
• EXACT_FIT=no
• lv_data: (an lv_data stanza for each logical volume in rootvg)
• COPIES= 1 ( or 2, 3 to mirror. make sure you have enough target disk stanzas in the bosinst_data
resource)
• LPs= nn (the number of logical partitions)
• PP= nn (if mirroring, this is an exact 2x or 3x of LPs)
• If you don't specify an image_data resource, NIM will use the file embedded in the mksysb image.
• Typical use of a "side" image.data file is when mksysb is mirrored, but the new install is to be nonmirrored,
or vice-versa.

• Now set up the mksysb resource to use for the restore

21

21

Setup mksysb as a resource


smitty nim
Perform nim administrative tasks
Manage resources
Define a resource
Select mksysb resource and then fill in the following fields
name = mksysb_aix7258
server = master
location = /nim/images/aix7258-golden.mksysb
OR
nim -o define -t mksysb -a server=master -a location=/nim/images/aix7258-golden.mksysb mksysb_ aix7258

For VIO:
nim -o define -t mksysb -a server=master -a location=/nim/images/vios41021-flash-mksysb_image
mksysb_vios41021
Grabbed the VIO 4.1.0.21 mksysb image off the Flash ISO downloaded from ESS

22

22

11
10/27/2024

mksysb Resources
#lsnim -l | grep mksysb

aix1nim: lsnim -l | grep mksysb


serves = mksysb_aix7258
serves = mksysb_vios41021
mksysb_aix7258:
type = mksysb
location = /nim/images/aix7258.mksysb

mksysb_vios41021:
type = mksysb
location = /nim/images/vios41021-flash-mksysb_image
23

23

Check VIOS mksysb definition


lsnim -l mksysb_vios41021
mksysb_vios41021:
class = resources
type = mksysb
creation_date = Wed Sep 16 13:22:34 2020
Rstate = ready for use
prev_state = unavailable for use
location = /nim/images/vios41021-flash-mksysb_image
version = 7
release = 3
mod =2
oslevel_r = 7300-02
oslevel_s = 7300-02-02-2240
alloc_count = 0
server = master

Check the image is there:


# ls -l /nim/images/vios41021-flash-mksysb_image

24

24

12
10/27/2024

Tell NIM to use the AIX 7.2.5.8 mksysb for aix2 machine

smitty nim_bosinst
Select aix2
install source = mksysb_aix7258
select mksysb and spot as resources (also select the lpp)
Select yes to accept licenses
Select no to initiate now

Initiate now = no means this is a pull resource and must be initiated at the client

nim -o allocate -a spot=spot7258-a lpp_source=lpp7258 -a mksysb=mksysb_aix7258 aix2


OR
nim -o allocate -a lpp_source=lpp7258 -a spot=spot7258 -a mksysb=mksysb_aix7258 -a bosinst_data=bosinst72
-a installp_bundle=netapphak60 aix2

nim -o bos_inst -a source=mksysb -a accept_licenses=yes -a boot_client=no -a installp_flags='-agX’ aix2

25

25

smitty nim_bosinst

I normally set
to yes

I normally set
to no

I normally set initiate reboot to no – if yes it will reboot immediately to do the install if it can 26

26

13
10/27/2024

Tell NIM to use the mksysb for this machine


First go into smitty nim and allocate resources – then check:
lsnim -l aix2

27

27

Checks
• showmount –e
/nim/images/aix7258.mksysb aix2
/nim/lpp_source/lpp_72tl05sp8 aix2
/nim/spot/spot_72tl05sp8/spot_72tl05sp8/usr aix2

• # cat /etc/bootptab
aix2:bf=/tftpboot/aix2:ip=10.152.10.124:ht=ethernet:sa=10.152.10.203:sm=255.255.255.0:

• ls –al /tftpboot | grep vios

28

28

14
10/27/2024

Useful NIM commands


• Recover missing simages if needs be:
• nim -o update -a recover=yes -a source=/software/aixv7/aix71-base lpp_72tl05sp8

• ALLOCATIONS
• nim -o deallocate -a spot=spot_72tl05sp8 -a lpp_source=lpp_72tl05sp8 -a mksysb=mksysb_72tl05sp8 gandalf
• nim -o allocate -a spot=spot_72tl05sp8 -a lpp_source=lpp_72tl05sp8 -a mksysb=mksysb_72tl05sp8 gandalf

• nim -o bos_inst -a source=mksysb -a accept_licenses=yes -a boot_client=no -a installp_flags='-agX' gandalf

• OTHER
• To add the bos.games 7.2.0.0 and bos.terminfo filesets to lpp_source1, type:
• nim -o update -a packages="bos.games 7.2.0.0 bos.terminfo" -a source=/dev/cd0 lpp_source1
• To remove bos.games from lpp_source1, type:
• nim -o update -a rm_images=yes -a packages="bos.games" lpp_source1

• alt_rootvg_op
• https://www.ibm.com/docs/en/aix/7.3?topic=alt-rootvg-op-command

29

29

Backout
• If you have a machine enabled for install, and need to back out...
• nim -o reset –a force=yes <nimclienthostname>
• nim -Fo deallocate –a subclass=all <nimclienthostname>

• May need to fix cpuid after an LPM move or other server migration so cpuid reflects new
system
• Test as follows:
• On client
• uname –a
• Note CPUID – something like: 00CE48C04B00
• On NIM SERVER
• nim -o lslpp clientlparname | grep bos.mp
• Check /var/adm/ras/nimsh.log on client if it fails If last line is similar to:
• error: local value passed, '', does not match environment value '00CE48D04B00’
• Fix is to change the CPUID on the NIM LPAR as follows:
• nim -o change -a cpuid=00CE48D04B00
• Also make sure nimclient is running on the client
• lssrc -g nimclient
• If necessary: startsrc –g nimclient 30

30

15
10/27/2024

Pre-install Notes
• Aggregation and installs and restores
• You cannot easily install a VIO server from the HMC or from NIM if the network is aggregated
• Network installs are only normally supported over an access port connection
• This applies to installing any LPAR that has physical network ports that are aggregated
• One solution is a separate admin network on a single port that is used for installs
• Installing onto SAN disks
• The SAN team may need you to light up the adapters so they can do their zoning and mapping
• Lighting up WWPNs for a VIO or LPAR for zoning and mapping
• On the HMC go to the profile (action, profiles, manage profile then selct the profile)
Then virtual adapters
Check all the virtual fibre adapters (called client fibre channel)
Then actions, advanced, login/logout fibre
Click on login to log them all in or logout to logout any not being used
• http://www-01.ibm.com/support/docview.wss?uid=isg3T1024487
• Troubleshooting NIM LED Hangs
• http://www-01.ibm.com/support/docview.wss?uid=isg3T1012561
31

31

MPIO
• IBM is now recommending using the AIXPCM rather than SDDPCM. They have a
new MPIO best practices document at:
• https://developer.ibm.com/articles/au-aix-mpio/
• There is a good description of AIXPCM here:
• https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.osd
evice/devmpio.htm
• Migration notes
• http://www-01.ibm.com/support/docview.wss?uid=ssg1S1010646
• Article on MPIO resiliency and problem determination
• https://developer.ibm.com/articles/au-aix-multipath-io-mpio/

32

32

16
10/27/2024

Start the install from the client


• Boot client into SMS mode either from the HMC or the server
Select 2 for setup remote IPL
Select 1 for first ethernet
Select 1 for IPV4
Select 1 for bootp
Select 1 for IP parameters
1 - client – 10.0.1.5 Use the client IP here
2 - server - 10.0.1.9 Use the NIM server IP here
3 - Gateway - 10.0.1.1 You may need to leave this as 0.0.0.0
4 - Subnet - 255.255.255.0
Esc
Select 2 for adapter config
2 spanning tree - ensure it is disabled (this can speed things up)
ESC
3 - protocol - set it to standard
ESC and ESC
3 Ping test then 1 to execute ping test
If the ping test is successful return to main menu
Select 5 - boot options
1 select boot device
6 select network
1 bootp
1 select first ethernet or whichever ethernet is the correct one
2 normal mode boot
1 yes I want to exit 33

33

Next steps
• LPAR/Server should boot, and you should see tftp start up
• After around 30,000 to 50,000 packets the console prompt should appear
• Sometimes it goes through the tftp process twice

• F1 and enter for console


• 1 for english during install
• An error message that “all LVs are being created exactly as they were but the disks are not the same” may appear.
Unless there is a reason not to, go ahead and:
• Choose 1 to continue with install
• 2 Check install settings

• Make sure that only 1 disk is chosen here and that it is the correct one for rootvg:
• Choose hdisk0
• Use maps for installation – I tend to choose no
• Check that importvgs defaults to n
• 0 to continue with choices

• Note make sure the mksysb you are using is not of a mirrored system – if it is mirrored then you will need to provide 2
disks to restore to or use a custom image_data file
• https://www.ibm.com/docs/no/aix/7.3?topic=resource-defining-image-data

34

34

17
10/27/2024

Continuing on
• During the reboot the install should start
• Monitor using lsnim –l lparname
• This will show you how far it has gone
• Or you can monitor reference codes on the HMC

• You can also ssh to the HMC and use vtmenu to get a console on the
LPAR so you can watch it boot

• After the system reboots you can import volume groups, remirror
rootvg (if on local disks) and perform further tailoring
35

35

Useful commands
• lsnim
• lsnim –l lparname
• nim -o reset –a force=yes clientnode
• nim -Fo deallocate –a subclass=all clientnode
• nim -o change -a cpuid="" clientnode
• bootlist -m normal –o (check bootlist)
• arp and ping
• oslevel –s
• Instfix
• showmount –e
• ls –al /tftpboot
• lsnim –c machines | resources | networks
• lsnim –t spot | lpp_source | mksysb | standalone …….
• lsnim –O resource - shows valid actions
• i.e. lsnim –O lpp7221
• nim –o check resource (i.e. spot, lpp, etc)
• nim –o check lpp7221
• nim –o lslpp clientlpar LPAR must be up
• nim –o lslpp aix2
36

36

18
10/27/2024

Useful commands on master

37

37

master - niminfo
#ls -l /etc/niminfo
-rw-r--r-- 1 root system 164 Dec 08 2016 /etc/niminfo

#cat /etc/niminfo
# nimconfig
export NIM_NAME=master
export NIM_CONFIGURATION=master
export NIM_MASTER_PORT=1058
export NIM_REGISTRATION_PORT=1059
export NIM_MASTER_HOSTNAME=aix1nim

38

38

19
10/27/2024

NIM master database and files


# ls -l /etc/objrepos/nim*
-rw-rw-r-- 1 root system 28672 Sep 22 16:23 /etc/objrepos/nim_attr
-rw-rw-r-- 1 root system 20480 Sep 22 16:23 /etc/objrepos/nim_attr.vc
-rw-rw-r-- 1 root system 4096 Sep 22 16:23 /etc/objrepos/nim_object
-rw-rw-r-- 1 root system 4096 Sep 22 16:23 /etc/objrepos/nim_object.vc
-r-xr-x--- 1 root system 28672 Jun 15 20:21 /etc/objrepos/nim_pdattr
-r-xr-x--- 1 root system 28672 Jun 15 20:21 /etc/objrepos/nim_pdattr.vc

/var/adm/ras is where default logs for NIM go

# ls -l /var/adm/ras/nim*
-rw-r--r-- 1 root system 342272 Dec 08 2016 /var/adm/ras/nim.setup
-rw-r--r-- 1 root system 131072 Sep 16 13:22 /var/adm/ras/nimlog
/var/adm/ras/nimsh.log nimsh log – check connection issues here
/var/adm/ras/nimlog general NIM log
alog -f /var/adm/ras/nimlog -o
Above shows failed NIM operations

39

39

Backing up and restoring NIM


• Save the following NIM files on the master

• /etc/niminfo
• /etc/objrepos/nim_attr
• /etc/objrepos/nim_attr.vc
• /etc/objrepos/nim_object
• /etc/objrepos/nim_object.vc

• You can restore the NIM database and activate the NIM master using SMIT or the command line.

• Restore the files saved in backing up the NIM database.

40

40

20
10/27/2024

Recovering /etc/niminfo
• /etc/niminfo is required on master and running NIM clients to run NIM operations and
commands

• You can rebuild it on the master:


• nimconfig -rTo

• You can rebuild it from a running NIM client:


• niminit -a master_port=1058 -a master=NIMSERVERNAME -a
name=CLIENTLPARNAME

• Check /etc/inittab to see if NIM is starting on master:


nim:2:wait:/usr/bin/startsrc -g nim >/dev/console 2>&1

41

41

/etc/niminfo on the client


#------------------ Network Install Manager ---------------
# warning - this file contains NIM configuration information
# and should only be updated by NIM
export NIM_NAME=gandalf
export NIM_HOSTNAME=gandalf.local
export NIM_CONFIGURATION=standalone
export NIM_MASTER_HOSTNAME=nimsrvr1.local
export NIM_MASTER_PORT=1058
export NIM_REGISTRATION_PORT=1059
export NIM_SHELL="nimsh"
export NIM_MASTERID=00C242914B00
export NIM_FIPS_MODE=0
export NIM_LICENSE_ACCEPT=yes
export RC_CONFIG=rc.bos_inst
export NIM_BOSINST_RECOVER="/../SPOT/usr/lpp/bos.sysmgt/nim/methods/c_bosinst_env -a
hostname=gandalf"
export SPOT=gandalf:/nim/spot/spot_72tl5sp8-2420/usr
export NIM_CUSTOM="/../SPOT/usr/lpp/bos.sysmgt/nim/methods/c_script -a
location=gandalf:/export/nim/scripts/gandalf.script"
export NIM_BOS_IMAGE=/NIM_BOS_IMAGE
export NIM_BOS_FORMAT=mksysb
export NIM_HOSTS=" 127.0.0.1:loopback:localhost 192.168.2.116:gandalf 192.168.2.103:gandalf "
export NIM_MOUNTS=" gandalf:/nim/lpp_source/lpp_72tl5sp3:/SPOT/usr/sys/inst.images:dir
gandalf:/nim/images/aix7258-golden-sep222024.mksysb:/NIM_BOS_IMAGE:file "
export ROUTES=" default:0:192.168.2.1 "
42

42

21
10/27/2024

Migrations and Updates


Migration
Changes version or release i.e. v7.2 to v7.3
Update
Preserves version and release
Basically changes a TL or SP i.e. 7.2.5.3 to 7.2.5.8 or 7.2.4 to 7.2.5

Both migrations and updates can use alternate copies of rootvg if there is an unused disk available

After changes, boot from altinst_rootvg and test

Migrate or update NIM Master first


Then update LPP_SOURCE and SPOT or create new ones

Use nimadm for migrations, to install a down level mksysb and then migrate it or to install a new golden
image

Use nim_alt_clone with update_all to update a TL or SP


With multibos the standby copy of AIX can be on the same physical disk as the current rootvg

43

43

Backup Tips
• /nim is a separate filesystem
• I take mksysbs to a separate filesystem that is an NFS directory exported
from my NIM server - /usr/local/backups or /backups
• When I want to use a mksysb image I copy it from /usr/local/backups to
/nim/images and create it as a mksysb resource
• This avoids issues around the way NIM exports mksysb images
• As an example
• If NIM exports a mksysb image only the file is exported to NFS clients
• However, if someone is taking a mksysb to that same directory the whole parent
directory is exported
• This will cause NFS errors, so it is best to keep them separate
• OR you can use the environment variable that will cause NIM to use subdirectories to
separate mksysb images
NIM_MKSYSB_SUBDIRS=yes
44

44

22
10/27/2024

nimadm
Creates a copy of rootvg to a free disk (or disks) and simultaneously migrates it to a new version or release level of
AIX.

Using a copy of rootvg, creates a new NIM mksysb resource that has been migrated to a new version or release
level of AIX.

Using a NIM mksysb resource, creates a new NIM mksysb resource that has been migrated to a new version or
release level of AIX.

Using a NIM mksysb resource, restore to a free disk (or disks) and simultaneously migrate to a new version or
release level of AIX.

Once upgraded mksysb is there you can either boot from it over the network or copy it to the client and use alt disk
install to restore the mksysb to the alt disk.

man nimadm provides man page entries

45

45

nimadm
Make sure bos.alt_disk_install.rte is installed into your spot or you will get error messages
Also make sure there are no errors in /etc/inittab or /etc/inetd.conf

# nimadm -T cg-aix61 -O /export/mksysb/cg-aix71 -s spotaix7tl0sp2 -l lppaix7tl0sp2 -j nimadmvg -Y -N cg-aix71

The flags indicate the following:

-T specifies the existing AIX 6.1 NIM mksysb resource.


-O specifies the output location for the migrated mksysb resource.
-s indicates the AIX 7.1 NIM SPOT resource for the migration.
-l indicates the AIX 7.1 NIM lpp_source resource for the migration.
-j identifies the volume group that will be used on the NIM master to create file systems.
-Y Agrees to required software license agreements for software to be installed.
-N specifies the name of the new AIX 7.1 NIM mksysb resource to be created after migration.

You can add “-d hdisk3” to do the upgrade to an alternate disk (hdisk3)

For alternate disk migration:


nimadm -l lpp_source -c NIMClient -s SPOT -d TargetDisks [ -a PreMigrationScript ] [ -b installp_bundle] [ -z
PostMigrationScript] [ -e exclude_files] [ -i image_data ] [ -j VGname ]
[ -m NFSMountOptions ] [ -o bosinst_data] [-P Phase] [ -j VGname ] [-Y ] [ -F ] [ -D ] [ -E ] [ -V ] [ { -B | -r } ]

46

46

23
10/27/2024

NIMADM Upgrade example


#oslevel -s
7200-05-07-2346
#lspv | grep root
hdisk0 00ce48c00cb8a7ca rootvg active
hdisk1 00ce48c00ca692a8 altinst_rootvg
exportvg altinst_rootvg

1. Using a copy of rootvg, create a new NIM mksysb resource that has been migrated to the new version or release level of AIX. You can restore
from this new upgraded mksysb later
#nimadm -T xxmksysb-apr2417 -O /nim/mksysb/xxmksysb-sep222024 -s spot_73tl2sp2-2420 -l lpp_73tl2sp2-2420 -j nimvg -Y -N

2. Use a copy of rootvg on the client to create an upgraded copy on the spare disk (source can also be a mksysb)
#nimadm -c gandalf -l lpp_73tl2sp2-2420 -s spot_73tl2sp2-2420 -d hdisk1 -Y -V

Flags:
-Y say agree to software licenses
-V is verbose mode
-N is when you provide a new mksysb name to use later

nimadm sets the bootlist to the new hdisk


Check:
gandalf# bootinfo -b
hdisk1
gandalf# bootlist -m normal -o
hdisk0 blv=hd5 pathid=0
hdisk0 blv=hd5 pathid=1
hdisk0 blv=hd5 pathid=2
hdisk0 blv=hd5 pathid=3 47
hdisk0 blv=hd5 pathid=4

47

NIM Cloning
Clone rootvg to another disk – can use this for VIO servers as well as regular LPARs (current rootvg is hdisk0)
alt_disk_copy –V –B –d hdisk2 (if you add –B flag it does not set the bootlist but I still set it anyway)
bosboot –a –d hdisk0
bootlist –m normal –o Check what bootlist is now)
bootlist –m normal hdisk0
bootlist –m normal -o
IBM uses alt_disk_copy for their v3 and v4 VIO server upgrades under the covers

Update within the same version/release (i.e update a TL or SP)


Build the lpp_source at the desired level with simages-yes
Update NIM master from this lpp_source and reboot master
On client
unmirror rootvg and cleanup (chpv –c and reducevg)
bosboot –a and bootlist –m
Master
smitty nim_alt_clone
Specify target client and target disks
Set FIXES to install to “update_all”
Point to lpp_source from above and accept licenses

The clone and update will take place on altinst_rootvg while still running on rootvg
Boot from altinst_rootvg and test
Either reboot from old rootvg or make this the production one
If you don’t plan to reboot immediately then ensure the bootlist is set to the original rootvg hdisk
48

48

24
10/27/2024

Alternate Disk Install


• https://www.ibm.com/docs/en/aix/7.2?topic=alt-disk-install-command

• Make sure you have a spare hard disk or LUN


• Install bos.alt_disk_install.rte and update it
• Create a bundle to install to the new disk and any custom scripts
• Or take a mksysb of the system to a file
• Clone rootvg using smitty alt_clone
• lspv now shows a disk as rootvg and one as altinst_rootvg
• Check your bootlist as the alt disk install process changes it
• bootlist –m normal –o
• Correct the bootlist back to normal until you are ready
• Now you can use smitty alt_disk_install to do the upgrades to the new hard drive
• When happy with the upgrade you update the bootlist and reboot on the new image
• If having problems with nimadm you can create the migrated mksysb then copy it to the client and use
alternate disk install to restore the mksysb on a separate disk

49

49

Alt Disk from mksysb


Commands to look at:
alt_disk_copy
alt_disk_install
alt_disk_mksysb
alt_rootvg_op

Note: since AIX 5.3 alt_disk_install command is


replaced by the alt_disk_copy,
alt_disk_mksysb, and alt_rootvg_op

#
# lspv
hdisk0 00f6934c642af030 rootvg active
hdisk1 none None
# lsdev -Ccdisk
hdisk0 Available Virtual SCSI Disk Drive
hdisk1 Available Virtual SCSI Disk Drive
#
# lslpp -l | grep bos.alt
bos.alt_disk_install.boot_images
bos.alt_disk_install.rte 7.1.4.30 COMMITTED Alternate Disk Installation
bos.alt_disk_install.rte 7.1.4.30 COMMITTED Alternate Disk Installation

50

50

25
10/27/2024

Alt Disk from mksysb

51

51

Alt Disk from mksysb

Plus many more as it restores from the mksysb image


52

52

26
10/27/2024

Alt Disk from mksysb


Now we see:
# lspv
hdisk0 00f6934c642af030 rootvg active
hdisk1 00f6934c75816830 altinst_rootvg active

# bootlist -m normal -o
hdisk0 blv=hd5 pathid=0

Phase 1 Creates the altinst_rootvg volume group, the alt_ "logical volumes", the /alt_inst file
systems, and restores the mksysb or rootvg data.
Phase 2 Runs any specified customization script, installs updates, new filesets, fixes or
bundles (cloning only), copies a resolv.conf file if specified, and copies files over to
remain a NIM client if specified.
Phase 3 Unmounts the /alt_inst file systems, renames the file systems and logical volumes,
removes the alt_ logical volumes, names ODM and varies off the altinst_rootvg. It sets
the bootlist and reboots if specified.

53

53

Alt Disk from mksysb


# lspv -l hdisk0 # lspv -l hdisk1
hdisk0: hdisk1:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT LV NAME LPs PPs DISTRIBUTION MOUNT POINT
hd8 1 1 00..00..01..00..00 N/A alt_hd10opt 32 32 00..32..00..00..00 /alt_inst/opt
hd6 64 64 00..64..00..00..00 N/A alt_hd1 4 4 00..00..04..00..00 /alt_inst/home
hd2 80 80 00..00..80..00..00 /usr alt_hd3 48 48 00..00..48..00..00 /alt_inst/tmp
hd4 10 10 00..00..10..00..00 / alt_hd9var 12 12 00..00..12..00..00 /alt_inst/var
hd3 48 48 00..00..48..00..00 /tmp alt_hd2 80 80 00..00..80..00..00 /alt_inst/usr
hd9var 12 12 00..00..12..00..00 /var alt_hd4 10 10 00..00..10..00..00 /alt_inst
hd10opt 32 32 00..32..00..00..00 /opt alt_hd8 1 1 00..00..01..00..00 N/A
hd1 4 4 00..00..04..00..00 /home alt_hd6 64 64 00..64..00..00..00 N/A
hd5 1 1 01..00..00..00..00 N/A alt_hd5 1 1 01..00..00..00..00 N/A
lg_dumplv2 16 16 00..16..00..00..00 N/A alt_lg_dumplv 16 16 00..16..00..00..00 N/A
fslv00 80 80 80..00..00..00..00 /usr/local alt_hd11admin 4 4 00..00..04..00..00 /alt_inst/admin
fslv01 16 16 00..16..00..00..00 /usr/local/logs alt_lg_dumplv2 16 16 00..16..00..00..00 N/A
lg_dumplv 16 16 00..16..00..00..00 N/A alt_fslv01 16 16 00..16..00..00..00 /alt_inst/usr/local/logs
livedump 4 4 00..04..00..00..00 /var/adm/ras/livedump alt_fslv00 80 80 80..00..00..00..00 /alt_inst/usr/local
hd11admin 4 4 00..00..04..00..00 /admin alt_livedump 4 4 00..04..00..00..00
/alt_inst/var/adm/ras/livedump

You can display the above during the mksysb clone


At the end altinst_rootvg is varied offline and these (the alt ones) are all unmounted

54

54

27
10/27/2024

Alt Disk from mksysb Back to sleep


# alt_disk_install -S hdisk1
+-----------------------------------------------------------------------------+
ATTENTION: calling new module /usr/sbin/alt_rootvg_op. Please
see the
You can wake up the altinst_rootvg to mount the filesystems and put it alt_rootvg_op man page and documentation for more details.
back to sleep: Executing command: /usr/sbin/alt_rootvg_op -S hdisk1
+-----------------------------------------------------------------------------+
# alt_disk_install -W hdisk1 Putting volume group altinst_rootvg to sleep ...
+-----------------------------------------------------------------------------+ forced unmount of /alt_inst/var/adm/ras/livedump
ATTENTION: calling new module /usr/sbin/alt_rootvg_op. Please see the forced unmount of /alt_inst/var/adm/ras/livedump
alt_rootvg_op man page and documentation for more details. forced unmount of /alt_inst/var
Executing command: /usr/sbin/alt_rootvg_op -W -d hdisk1 forced unmount of /alt_inst/var
+-----------------------------------------------------------------------------+ forced unmount of /alt_inst/usr/local/logs
Waking up altinst_rootvg volume group ... forced unmount of /alt_inst/usr/local/logs
forced unmount of /alt_inst/usr/local
forced unmount of /alt_inst/usr/local
Replacement command to wake the disk is: forced unmount of /alt_inst/usr
alt_rootvg_op –W –d hdisk1 forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
Replacement command to put the disk back to sleep is: forced unmount of /alt_inst/tmp
alt_rootvg_op –S –d hdisk1 forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
# lspv forced unmount of /alt_inst/home
hdisk0 00f6934c642af030 rootvg active forced unmount of /alt_inst/admin
hdisk1 00f6934c75816830 altinst_rootvg active forced unmount of /alt_inst/admin
forced unmount of /alt_inst
Once it is awake you can copy files that you may need forced unmount of /alt_inst
Fixing LV control blocks...
Fixing file system superblocks...

# lspv
hdisk0 00f6934c642af030 rootvg active
hdisk1 00f6934c75816830 altinst_rootvg 55

55

Alt Disk from mksysb df


# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 0.62 0.41 35% 10330 10% /
/dev/hd2 5.00 2.37 53% 62100 11% /usr
/dev/hd9var 0.75 0.47 38% 5785 5% /var
/dev/hd3 3.00 3.00 1% 72 1% /tmp
/dev/hd1 0.25 0.25 1% 11 1% /home
/dev/hd11admin 0.25 0.25 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 2.00 1.41 30% 13901 5% /opt
/dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump
/dev/fslv00 5.00 4.93 2% 231 1% /usr/local
/dev/fslv01 1.00 0.98 2% 39 1% /usr/local/logs

/dev/alt_hd4 0.62 0.53 1% 13 1% /alt_inst


/dev/alt_hd11admin 0.25 0.25 1% 5 1% /alt_inst/admin
/dev/alt_hd1 0.25 0.25 1% 11 1% /alt_inst/home
/dev/alt_hd10opt 2.00 1.41 30% 13900 5% /alt_inst/opt
/dev/alt_hd3 3.00 3.00 1% 61 1% /alt_inst/tmp
/dev/alt_hd2 5.00 2.37 53% 62100 11% /alt_inst/usr
/dev/alt_fslv00 5.00 4.93 2% 230 1% /alt_inst/usr/local
/dev/alt_fslv01 1.00 0.98 2% 39 1% /alt_inst/usr/local/logs
/dev/alt_hd9var 0.75 0.47 38% 5761 5% /alt_inst/var
/dev/alt_livedump 0.25 0.25 1% 4 1% /alt_inst/var/adm/ras/livedump

56

56

28
10/27/2024

Quick alt_disk_copy with upgrade Example


alt_disk_copy –V –B-d hdisk1 -F 7300-01_AIX_ML -l /updates

The above copies the current 7300-00 rootvg to hdisk1


It applies the updates from /updates to bring the cloned rootvg to 7300-01
It also says not to change the bootlist from the current one – if you leave off the –B it will set
the bootlist to hdisk1

Allows you to copy the running system and apply maintenance in one step
After reboot the prior rootvg will be named old_rootvg
Use alt_rootvg_op to remove it later
Use bootlist to go back if needs be

OR
alt_disk_copy –V –B –d hdisk2
Above just copies rootvg across to hdisk2

https://www.ibm.com/docs/en/aix/7.2?topic=alt-disk-copy-command

57

57

Migrating a 7.1 mksysb to 7.2


Take a mksysb on the client to be updated
Copy it to /nim/images and add it as a resource
Check the mksysb
listvgbackup -f'/nim/images/jlmksysb-may2317' | grep rc.tcpip
listvgbackup -f'/nim/images/jlmksysb-may2317' | grep inetd.conf
Convert the mksysb to 7.2
nimadm -T jlmksysb-may2317 -O /nim/mksysb/jlmksysb72-may2317 -s spot7212 -l lpp7211 -j nimvg -Y -N
Check the converted mksysb
listvgbackup -f'/nim/mksysb/jlmksysb72-may2317' | grep rc.tcpip
listvgbackup -f'/nim/mksysb/jlmksysb72-may2317' | grep inetd.conf
If all is good on the master then copy it to the client:
cp /nim/mksysb/jlmksysb72-may2317 /usr/local/backups
And on client in stall in this case to hdisk11:
alt_disk_mksysb -m /backups/jlmksysb72-may2317 -d hdisk11 –k
NOTE: Ensure your /etc/inetd.conf and /etc/inittab are pristine. We had a bug where a line in inetd.conf
went over 2 lines and it caused the resulting converted mksysb to drop over 2000 filesets

If not rebooting migrated image immediately then make sure to set the bootlist to the original rootvg
This works for 7.1 to 7.3 or 7.2 to 7.3 as well
58

58

29
10/27/2024

listvgbackup

listvgbackup -f'/nim/images/vios31125-flash-mksysb_image' | grep rc.tcpip

New volume on /nim/images/vios31125-flash-mksysb_image:


Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Fri Jul 3 02:43:34 EDT 2020
Files are backed up by name.
The user is .
6978 ./usr/lpp/bos.net/inst_root/etc/rc.tcpip
4065 ./usr/share/man/info/EN_US/a_doc_lib/files/filesreference/rc.tcpip.html
7020 ./etc/rc.tcpip
The number of archived files is 79119.

59

59

VIOS and NIM


• Use of NIM to back up, install, and update the VIOS is supported.
• Note: For install, always create the SPOT resource directly from the VIOS mksysb image. Do NOT update the
SPOT from an LPP_SOURCE.
• Use of NIM to update the VIOS is supported as follows:
Ensure that the NIM Master is at the appropriate level to support the VIOS image.
• https://www.ibm.com/support/pages/node/6561917
• On the NIM Master, use the operation updateios to update the VIOS Server.
• "nim –o updateios –... ... ..."
• On the NIM Master, use the operation alt_disk_install to update an alternate disk copy of the VIOS Server.
• "nim –o alt_disk_install –a source=rootvg –a disk=target_disk –a fix_bundle=(Value) ... ... ..."
• If NIM is not used to update the VIOS, only the updateios or the alt_root_vg command from the padmin shell
can be used to update the VIOS.
• You must use viosupgrade to upgrade from 2.2.6.32 to v3.1 or V3 to v4 of the VIO server
• Remember the syntax for viosupgrade on NIM Is different to the one on the VIO server so consistently pick one
• NIM - https://www.ibm.com/docs/en/aix/7.3?topic=v-viosupgrade-command
• VIO - https://www.ibm.com/docs/en/power10?topic=commands-viosupgrade-command

60

60

30
10/27/2024

VIOS to NIM Master


https://www.ibm.com/support/pages/node/6561917

61

61

VIOS and NIM – Set up resources


• Need to extract mksysb image from VIO install ISO - I use the flash ISO as there is only one mksysb image to deal with
• Copy the image into the images directory
• It is now there as:
• /nim/images/vios41021-flash-mksysb_image

• Create the mksysb resource


• nim -o define -t mksysb -a server=master -a location=/nim/images/vios41021-flash-mksysb_image mksysb_vios41021

• Create the spot from the mksysb image


• nim -o define -t spot -a server=master -a location=/nim/spot -a source=mksysb_vios41021 spot_vios41021

• Check the images


• nim –o check spot_vios41021
• nim –o check mksysb_vios41021

62

62

31
10/27/2024

VIOS and NIM – More Details


1. Add VIOS partition as a client
2. Copy the VIOS mksysb image from the ISO image to your NIM master
#mkdir /software/powervm41/powervm41021-base
#cd /software/powervm41
#loopmount -i /software/powervm41/Virtual_IO_Server_Base_Install_4.1.0.21_Flash_062024_LCD8292401.iso -
o "-V udfs -o ro" -m /cdrom
#cp /cdrom/usr/sys/inst.images/mksysb_image /software/powervm41/mksysb_vio41021_2024
#cp -R /cdrom/* /software/powervm41/powervm41021-base
#umount /cdrom
#cp /software/powervm41/mksysb_vio41021_2024 /nim/images
3. Build a mksysb resource of /nim/images/mksysb_vio41021_2024
4. Now create the SPOT from the mksysb
#nim -o define -t spot -a server=master -a source=mksysb_vio41021_2024 -a location=/nim/spot spotvios41021
5. Check the spot
nim -o check spotvios41021
lsnim -l spotvios41021
6. Copy the bosinst.data from the DVD and create a viosbosinst resource
7. You can now use bos_inst to do a mksysb install once the partition profile is defined
http://www-01.ibm.com/support/docview.wss?uid=isg3T1011386
63

63

VIOS and NIM – Check resources

64

64

32
10/27/2024

VIOS and NIM – Check resources

65

65

Examples from man page - nim –o updateios

66

66

33
10/27/2024

NIM viosupgrade
• The viosupgrade command on NIM is different to the one on the VIO server
• http://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.cmds6/viosup
grade.htm
• https://www.ibm.com/docs/en/aix/7.3?topic=v-viosupgrade-command
• Use to perform bosinst upgrade
• Use to perform alternate disk upgrade
• viosupgrade –q –n hostname to check
• Backups up the virtual and logical configuration data
• Performs a new and complete VIOS installation from the VIOS image
• Restores the virtual and logical configuration
• Can specify bosinst (current disk) or altdisk
• VIOS to be upgraded must be at least 2.2.6.30 (2.2.6.32 if SSPs) to upgrade to V3
• 2.2.6.32 is where I start all my VIOS to 3.1 upgrades
• For VIOS 4.1.0.21 NIM master must be at AIX 7300-02-02
• VIOS 3.1.0 and higher can be upgraded to 4.1.0.21 using the flash image
67

67

Examples from man page on NIM – man viosupgrade

68

68

34
10/27/2024

Backing up VIOS (nim_resources.tar)


• Use viosbr to backup user defined virtual resources on the VIO
• Make sure to save that backup in rootvg
• viosbr –backup –file /tmp/viosbkup-sep222024
Backup of this node (vio1) successful
• You can also use viosbr to view or restore
viosbr –view –file /tmp/viosbkup-sep222024.tar.gz
• https://www.ibm.com/docs/en/power8/9119-MHE?topic=commands-viosbr-command

• Mount NFS filesystem to backup to (in my case /backups)

• #mkdir /backups/viosa

• Then as padmin run backupios which automatically calls savevgstruct:


• backupios -file {File name} [-mksysb] [-nopak ] [-nosvg] [-nomedialib]
• $backupios –file /backups/viosa -nomedialib
• The above creates a nim_resources.tar package in that directory and it can be used to clone or restore VIO servers using installios (NIMOL) from
the HMC. It ignores the media library (/var/vio/VMLibrary) if it is rootvg

• You can also back it up as a mksysb file that is easy to restore from the NIM server
• $backupios -file /backups/viosa.mksysb –mksysb -nomedialib

• You can also backup your VIOS virtuals and your VIO server to the HMC if the HMC is fairly recent (950 or higher)

• The nim_resources.tar file contains all the necessary resources to restore the Virtual I/O Server, including the mksysb image, the bosinst.data
file, the network boot image, and SPOT resource.
• The NFS export should allow root access to the Virtual I/O Server, otherwise the backup will fail with permission errors.

69

69

VIO Server Backup Script to put in crontab


#! /bin/sh
#
machine=`uname -n`
mount /usr/local/backups
mkdir /usr/local/backups/$machine
umount /var/vio/VMLibrary
su - padmin -c "ioscli backupios -file /usr/local/backups/$machine -nomedialib"
su - padmin -c "ioscli backupios -file /usr/local/backups/vio-mksysbs/$machine.mksysb -nomedialib -mksysb"
mount /var/vio/VMLibrary
#
exit 0

NOTES
The above can be put in root’s crontab to run regularly
Creates both the NIM resources and a full mksysb file
Don’t forget to set up an NFS mount of /usr/local/backups to the VIO from your NIM or NFS server
Do not allow ANY NFS mount to mount automatically at boot in case the NIM or NFS server is down at the time of boot
Also, regularly grab an HMCScanner report
https://www.ibm.com/support/pages/node/1117515
https://www.ibm.com/support/pages/system/files/inline-files/hmcScanner-0.11.54.zip
70

70

35
10/27/2024

$ backupios -file /usr/local/backups/viosa -nomedialib

Creating information file for volume group fbovg.


Creating list of files to back up.
Backing up 15 files.........

15 of 15 files (100%)
0512-038 savevg: Backup Completed Successfully.
Backup in progress. This command can take a considerable amount of time
to complete, please be patient...
$

# ls -al viosa
total 44300704
drwxr-xr-x 2 root staff 256 Oct 09 23:32 .
drwxr-xr-x 4 root system 4096 Oct 09 22:42 ..
-rw-r--r-- 1 root staff 22678507520 Oct 09 23:32 nim_resources.tar

# du -sg viosa
21.12 viosa
But I saw it get as big as 40GB during the process

If you use smitty mksysb then you can check if it ran by checking smit.log – usually in /home/padmin on VIO
#tail -20 /home/padmin/smit.log
71

71

Restore from nim_resources.tar


If you plan to use NIM to restore to a specific disk, then you will need to follow this procedure:

Extract from the nim_resources.tar the bosinst.data


tar -xvf nim_resources.tar ./bosinst.data
The following is an example of the target_disk_data stanza of the bosinst.data generated by
backupios.
target_disk_data:
LOCATION =
SIZE_MB =
HDISKNAME =
Fill the value of HDISKNAME with the name of the disk to which you want to restore to
Put back the modified bosinst.data in the nim_resources.tar image
tar -uvf nim_resources.tar ./bosinst.data

All other parts of the nim_resources.tar image must remain unchanged.

72

72

36
10/27/2024

Restore from nim_resources.tar


Once bosinst.data is changed (if needed)
run the installios command without any flag from the HMC command line.
Select the Managed System where you want to restore your Virtual I/O Server from the objects of type
"managed system" found by installios command.
Select the VIOS Partition where you want to restore your system from the objects of type "virtual I/O
server partition" found
Select the Profile from the objects of type "profile" found.
Enter the source of the installation images [/dev/cdrom]: server:/exported_dir (this is where the tar file is)
Enter the client's intended IP address: <IP address of the VIOS>
Enter the client's intended subnet mask: <subnet of the VIOS>
Enter the client's gateway: <default gateway of the VIOS>
Enter the client's speed [100]: <network speed>
Enter the client's duplex [full]: <network duplex>
Would you like to configure the client's network after the installation [yes]/no?
Select the Ethernet Adapter used for the installation from the objects of type "ethernet adapters" found.
When the restoration is finished, open a virtual terminal connection (for example, using telnet) to the Virtual
I/O Server that you restored.

Don’t forget to use your viosbr to restore your virtual devices as needed.

73

73

Using NIM with VIOS mksysb


Again we run the viosbr to backup the virtual resources
Then:
backupios –file /backups/viosmksysb-oct0219.mksysb –mksysb -nomedialib
When the -mksysb flag is used, the NIMOL resources are not saved in the image.

To restore from this image first copy the image to /nim/images


Define the mksysb as a nim object
nim -o define -t mksysb -a server=master –a location=/nim/images/ viosmksysb-oct0219.mksysb viosmksysb
Now define a spot
nim -o define -t spot -a server=master -a location=/nim/spot -a source=viosmksysb spotvios
Then smitty bos_inst and select a mksysb restore along with the mksysb and spot resources created above
Open a vterm (I use vtmenu from the HMC) to the vios
Activate the partition in SMS mode
Set up the remote_ipl parameters
Do the ping test
Select boot options and boot from the network from the NIM server
Reply to prompts in the vtmenu console

When complete don’t forget to restore virtuals using viosbr

IBM document on this at:


74
https://www.ibm.com/docs/en/aix/7.3?topic=nim-installing-virtual-io-server-using-ios-mksysb

74

37
10/27/2024

Cloning disks for vio servers


After installing vio1, if you have all the disks in vio1 you can take a clone to build vio2
If your server has a split backplane then you can make a clone
It is best to do this before adding the network and fiber adapters as it makes the cleanup much easier
Make sure the 4 disks are split (2 and 2) across the backplane
vio1 is using hdisk0 and hdisk1, hdisk2 and 3 are on the other adapter and will be used for vio2
Put all the disks into vio1 (both adapters)
Install vio1 on hdisk0 – from NIM, DVD, HMC …..
Now clone it to hdisk2
alt_disk_copy –V –B –d hdisk2
Useful flags are –B and –O
-B tells it NOT to change the bootlist which it does automatically otherwise
Remove vio2 hdisks from vio1, Shutdown vio1
Remove vio2 resources from vio1 profile
Leave vio1 down
Activate vio2
Remove any disks, adapters, networks etc that show as defined on vio2
Now cleanup vio2 (see next slide)
https://www.ibm.com/docs/en/aix/7.3?topic=alt-disk-copy-command
75

75

Cleaning up after cloning vio


If you do not cleanup you will experience weird RMC issues
Cleanup vio2:
stopsrc -g rsct_rm; stopsrc -g rsct
Clear Nodeid
chdev -l cluster0 -a node_uuid=00000000-0000-0000-0000-000000000000
OR
/usr/bin/odmdelete -o CuAt -q 'attribute=node_uuid'
Generate new nodeid
/usr/sbin/rsct/bin/mknodeid -f
lsattr -El cluster0
/usr/sbin/rsct/bin/lsnodeid
/usr/sbin/rsct/install/bin/recfgct
lspartition -dlpar
lssrc -g rsct_rm; lssrc –g rsct
You may have to start ctcas – startsrc –s ctcas
Cleanup old vio1 resources (next slide)

76

76

38
10/27/2024

Cleaning up after cloning vio


CLEANUP on VIO2
rmdev all devices showing as defined (fcs, ent, hdisk, etc)
rmdev -dp hdisk0
rmdev -dl hdisk0
rmdev -dp pdisk0
rmdev -dl pdisk0
rmdev -dp sissas0
rmdev -dl sissas0
rmdev -dp pci0
rmdev -dp pci1
rmdev -dp pci2
rmdev -dp pci3
rmdev -dp pci4
rmdev -dl pci0
rmdev -dl pci1
rmdev -dl pci2
rmdev -dl pci3
rmdev -dl pci4
If ethernet adapters were in vio1 when cloned then you may need to remove all those as well

Once vio2 is cleaned up reboot it


Then activate vio1

Clean up vio1 removing any extra hdisks, pdisks, pci, sissas1, etc that now show as defined. Also remove the adapter definitions for them.
Reboot vio1 to ensure changes are good

alt_disk_copy -O
Performs a device reset on the target altinst_rootvg. This causes the alternate disk install to not retain any user-defined device configurations. This flag is useful if the target disk or
disks become the rootvg of a different system (such as in the case of logical partitioning or system disk swap).
The above flag on the copy helps avoid much of the cleanup
77

77

NIM and Ansible and Linux


https://developer.ibm.com/tutorials/awb-run-ansible-playbooks-from-aix-nim/

It is possible to use NIM to trigger Ansible playbooks on NIM clients


The link above provides detailed instructions on how to do so

You need to install Ansible on all NIM clients so that Ansible runs playbooks on the NIM clients locally.
The necessary RPMs can be found in the AIX Toolbox and can be installed using dnf

You will also need to install the ibm.power-aix collection from Ansible Galaxy

The following article cover how to install rpms using a NIM master

https://www.ibm.com/support/pages/how-install-rpms-using-nim-
master?utm_source=ibm_developer&utm_content=in_content_link&utm_id=tutorials_awb-run-
ansible-playbooks-from-aix-nim&cm_sp=ibmdev-_-developer-tutorials-_-ibmcom

Article on installing/rescuing RHEL on POWER using NIM


https://www.belisama.services/_files/ugd/3fa2a4_f3e1627bb8884f2fbd2f2b819a4cf40d.pdf
78

78

39
10/27/2024

Uninstalling NIM
• nim –o unconfig master
• installp –u bos.sysmgt.nim.master
• Note: the NIM master must be unconfigured before you can uninstall the
master fileset

79

79

NIM and NFS exports


• Never export your /nim filesystem using NFS – NIM will do this when it needs to
• By default NIM creates an entry in /etc/exports granting both client mount access and root
access for root users
• If you have numerous clients and need to exceed 32767 characters in the exports file
nim –o change –a restrict_nfs_exports=no master
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.install/addl_mstr_mgmt_tasks_incr_hosts.htm

The above change causes NIM to only grant root access to target hosts
Still have to obey NFS limitation of 256 hostnames in a root exports file entry
You can change this back easily by reissuing the command changing no to yes

80

80

40
10/27/2024

Suppressing output
• Use show_progress=no to suppress progress messages
• nim -o cust -a show_progress=no -a lpp_source=images1 \ -a
fixes=update_all Standalone1

81

81

Alternate NIM Master


Assumes there is already a NIM master

Install bos.sysmgt.nim.master fileset


Then smitty niminit_altmstr
Use smitty nim_altmstr fast path to synchronize the alternate master with the master or:
On master
nim –o sync altmastername
Or nim –o sync –a replicate=yes altmastername
Above causes it to replicate masters resources to the Alt.
You can add reset_clients=yes to also rebuild the NIM clients list in/etc/niminfo to be aware of the alternate
master
You may need to add –F (-Fo sync) to overwrite existing NIM database
You can use niminit command if you prefer
# niminit -a is_alternate=yes -a master=mastername -a pif_name=en0 -a cable_type1=N/A -a platform=chrp -a
name=altmastername
Then go to the master and register the alternate:
# niminit -a is_alternate=yes -a master=altmastername -a pif_name=en0 -a cable_type1=N/A -a platform=chrp -a
name=mastername

To takeover from the master


On the alternate: nim –o takeover mastername (can add –a async=yes or no – default is yes)

To remove an alternate master (from the master)


nim –o remove altmastername

82

82

41
10/27/2024

Problems
• Step 1 – bootp makes initial communication and talks to the client
• Step 2 – after successful bootp tftp is used for transfer of boot image.
• U0608 – usually a bootp or tftp problem
• Bootp Issues
• Ensure bootp is active in /etc/inetd.conf
• lssrc –ls inetd
• Ensure /etc/bootptab entries are correct
• Check GW setting on the NIM machine definition as well as on the SMS boot setting
• Check all IP addresses specified
• To run bootpd in debug mode:
1. Comment out the bootps entry from the /etc/inetd.conf file on the server.
2. Stop all running bootpd processes (ps -ef | grep bootp –> kill -9 ..)
3. Restart inetd using the refresh -s inetd command.
4. Start bootpd from the command line, using the /usr/sbin/bootpd -s -d -d -d command (output will be on the screen)
• Tftpd Issues
• Check /etc/tftpboot to make sure .info files are there for the machine
• cat /etc/tftpaccess.ctl make sure /tftpboot is allowed
• lssrc –ls tftpd make sure it is active
• To run tftpd in debug mode – add –v to startup in /etc/inetd.conf and entries will go to SYSLOG at the info
level

• Make sure tftp and bootp are allowed through any firewalls
83

83

NIM Specific Useful Links References for NIM

• Adventures with NIMADM


• https://techchannel.com/systems-management/nimadm-aix-v7-2-to-v7-3/
• EZNIM
• https://www.ibm.com/docs/en/aix/7.3?topic=management-using-eznim
• SG24-7296 – NIM from A-Z in AIX 5L Redbook – 30 May 2007
• https://www.redbooks.ibm.com/redbooks/pdfs/sg247296.pdf
• Network Install Manager
• https://www.ibm.com/docs/en/aix/7.3?topic=installing-network-installation-management
• Simplifying with NIM – article from IBM Systems Magazine 2006
• http://www.circle4.com/jaqui/eserver/aixtra-FebMar06-SimplifyingwithNIM.pdf
• Backing up the NIM Database
• https://www.ibm.com/docs/en/aix/7.2?topic=nim-backing-up-database

84

84

42
10/27/2024

Useful Links
• HMC Scanner
• https://www.ibm.com/support/pages/node/1117515
• alt_disk_install
• https://www.ibm.com/docs/en/aix/7.2?topic=alt-disk-install-command
• alt_rootvg_op
• https://www.ibm.com/docs/en/aix/7.2?topic=alt-rootvg-op-command
• alt_disk_copy
• https://www.ibm.com/docs/en/aix/7.2?topic=alt-disk-copy-command
• alt_disk_mksysb
• https://www.ibm.com/docs/en/aix/7.2?topic=alt-disk-mksysb-command

85

85

Articles and other Useful Items


• Jaqui Lynch Articles
• http://www.circle4.com/jaqui/eserver.html
• https://techchannel.com/contributor/jaqui-lynch/
• Jaqui’s Movie Replays
• http://www.circle4.com/movies
• IBM US Virtual User Group
• http://www.tinyurl.com/ibmaixvug
• Jaqui Lynch YouTube
• https://www.youtube.com/@jaquilynch

86

86

43
10/27/2024

Thank you for your time

If you have questions please email me at:


[email protected]

Handout at:
https://www.circle4.com/ptechu/nim201-oct272024.pdf

Also check out:


http://www.circle4.com/movies/

87

87

NIM Layout

From: https://aix4admins.blogspot.com/2011/05/nim-database-nim-database-is-stored-in.html
Also look at: https://aix4admins.blogspot.com/2013/07/bootpd-this-is-initial-communication.html 88

88

44
10/27/2024

NIM Resources
• Machines
• These are the clients
• lpp_source
• The lpp_source (Licensed Program Product source) directory contains the images that AIX uses to load
software. These are typically the BFF (backup file format) images that exist on the AIX installation CDs or
DVD. Each OS version should have its own lpp_source. Additionally these should be separated into 32-
bit and 64-bit lpp_source sets.
• SPOT
• The SPOT (Shared Product Object Tree) is a directory that is created from the lpp_source. The SPOT is
used in a similar fashion to the boot images and installation scripts on the Base installation CD volume 1
for AIX. It may be necessary to create multiple SPOTs depending on the maintenance levels and
versions that need to be supported.
• mksysb
• The NIM master can use lpp_source to install an instance or it can install the instance from a mksysb of
either that instance or another one. Once the mksysb is restored a script can be run automatically to
customize the instance .

89

89

Nim Commands
• nim –o operation –a attribute=value …. • alt_disk_install
Targetname(s) • Install to an alternate disk to current rootvg
• cust • bos_inst
• Install filesets or updates on clients or SPOT • Install AIX on a client
resources • change
• sync • Modify NIM object attributes
• Sync NIM database with an alternate master • check
• fix_query • Verify usability of a NIM resource or machine
• Check fix status on a client • chwpar
• maint • Change characteristics of a WPAR
• Uninstall filesets and commit or reject updates on • allocate or deallocate
a client or SPOT • Allocate or deallocate resources to a client
• maint_boot • define
• Boot client into maintenance mode • Create networks, machines or resources
• reboot • diag
• Reboot a NIM client • Netboot client into diagnostic mode
• lppchk • remove
• Verify software installed correctly • Remove objects from the NIM environment
• lppmgr • reset
• Helps manage base install images and update • Reset the state of a client or resource
images in an lpp_source • takeover
• activate or deactivate • Allow alternate_master to take control
• Start or stop a managed system • unconfig
• showlog • Unconfigure the NIM environment
• List software installed on a client or SPOT • showres
• update • lslpp
• Update the lpp_source by adding or removing
packages
• updateios
• Update and customize the VIO server

90

90

45

You might also like