NIM – SPOT definition

Spot resource (Shared product Object Tree) is a fundamental object needed when installing or customizing new lpars.
It contains the necessary files (/usr) to mount and access the resources needed during setup phase (mksysb, lpp_source, etc.).

root@nim01:/home/src582# nim -o define -t spot -a server=master -a source=lpp-aix720501-FULL -a location=/export/spot/spot-aix720501 spot-aix720501

bos.iconv.com 7.2.5.0 ROOT APPLY SUCCESS
bos.ecc_client.rte 7.2.5.0 USR APPLY SUCCESS
bos.ecc_client.rte 7.2.5.0 ROOT APPLY SUCCESS
bos.adt.lib 7.2.4.0 USR APPLY SUCCESS
bos.adt.lib 7.2.4.0 ROOT APPLY SUCCESS
adde.v2.rdma.rte 7.2.2.0 USR APPLY SUCCESS
adde.v2.rdma.rte 7.2.2.0 ROOT APPLY SUCCESS
adde.v2.ethernet.rte 7.2.5.0 USR APPLY SUCCESS
Java7_64.sdk 7.0.0.665 USR APPLY SUCCESS
Java7_64.jre 7.0.0.665 USR APPLY SUCCESS
Java7_64.jre 7.0.0.665 ROOT APPLY SUCCESS

File /etc/inittab has been modified.

One or more of the files listed in /etc/check_config.files have changed.
See /var/adm/ras/config.diff for details.

Checking filesets and network boot images for SPOT “spot-aix720501”.
This may take several minutes …

NIM – LPP_SOURCE definition


Let’s start from AIX 7.2 base release LPP Source ,in order to define our new LPP_SOURCE resource:

root@nim01:/export/lpp_source/lpp-aix720501-FULL# nim -o define -t lpp_source -a server=master -a source=/export/lpp_source/lpp-aix720000-FULL -a location=/export/lpp_source/lpp-aix720501-FULL lpp-aix720501-FULL
Preparing to copy install images (this will take several minutes)…

/export/lpp_source/lpp-aix720501-FULL/RPMS/ppc/expect-5.42.1-3.aix6.1.ppc.rpm
/export/lpp_source/lpp-aix720501-FULL/RPMS/ppc/tcl-8.4.7-3.aix6.1.ppc.rpm
/export/lpp_source/lpp-aix720501-FULL/RPMS/ppc/tk-8.4.7-3.aix6.1.ppc.rpm
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/xlsmp.rte.4.1.2.0.I
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/xlsmp.aix61.rte.4.1.2.0.I


/export/lpp_source/lpp-aix720501-FULL/installp/ppc/Java7_64.sdk.7.0.0.320.I
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/Java7_64.jre.7.0.0.320.I
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/ICU4C.rte.7.2.0.0.I

Now checking for missing install images…

All required install images have been found. This lpp_source is now ready.

The newly created resource contains base release filesets, we need to update them to the desired version:

root@nim01:/export/lpp_source/lpp-aix720501-FULL# nim -o update -a packages=all -a source=/download/AIX/PTF/Aix-72-05-01 lpp-aix720501-FULL

/export/lpp_source/lpp-aix720501-FULL/installp/ppc/devices.pciex.df1060e214103404.7.2.0.0.I.1
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/rsct.msg.zh_TW.3.2.6.0.I
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/rsct.msg.zh_CN.3.2.6.0.I
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/rsct.msg.sk_SK.3.2.6.0.I


/export/lpp_source/lpp-aix720501-FULL/installp/ppc/devices.pciex.b315506714106104.rte.7.2.1.0.U
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/devices.pciex.b315506714101604.rte.7.2.1.0.U
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/devices.pciex.b31503101410b504.rte.7.2.1.0.U
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/devices.pciex.b3155067b3157365.rte.7.2.1.0.U
/export/lpp_source/lpp-aix720501-FULL/installp/ppc/devices.pciex.b3155067b3157265.rte.7.2.1.0.U

Resource creation and update tasks ended without errors, let’s run another check:

root@nim01:/export/lpp_source/lpp-aix720501-FULL# nim -o check lpp-aix720501-FULL
root@nim01:/export/lpp_source/lpp-aix720501-FULL#

Let’s remove eventual duplicate or superseded filesets:

root@nim01:/export/lpp_source/lpp-aix720501-FULL# nim -o lppmgr -a lppmgr_flags=rub lpp-aix720501-FULL
lppmgr: Source table of contents location is /export/lpp_source/lpp-aix720501-FULL/installp/ppc/.toc
lppmgr: Building table of contents in /export/lpp_source/lpp-aix720501-FULL/installp/ppc ..
lppmgr: Building table of contents completed.
lppmgr: Generating duplicate list..
lppmgr: Generating base level duplicate list..

Results:
No filesets found that can be removed.

LPP_SOURCE resource is now ready to use.

Dimensionamento dei profili LPAR

CPU

Processing units : indica il numero dei core installati in macchina , in assenza di altri processor pools definiti sono tutti assegnati ad uno shared processor pool.

  • Cap o no cap :

A livello di profilo della Lpar possiamo definire sostanzialmente due modalità:

Uncapped

in questa modalità il profilo prevede l’impostazione di un valore di minimum cpu, ovvero il valore minimo garantito alla lpar, in mancanza del quale la lpar non si avvia, il desired ossia il valore di default assegnato alla lpar in presenza di cicli disponibili, ed il maximum che in questo caso perde di significato dal momento che la partizione uncapped può attingere dalloshared processor pool del server in caso di necessità seguendo un meccanismo di priorità basato su un “peso” assegnato al profilo della partizione.

Capped

        in questo caso i valori minimum e desired sono identici al caso precedente ed il maximum si comporta come limite massimo del valore assegnato , sia esso processing unit, virtual cpus , ecc.

  • Virtual cpus e processing units:

Una regola fondamentale per il disegno di un profilo lpar riguarda il rapporto tra le physical processing units e le virtual cpus; infatti è bene fare in modo che il numero delle desired vcpus coincida con il maximum processing units . Per esempio se ho 1 vp posso usare solo fino 1 PU anche se la partizione è uncapped e magari lo shared processor pool potrebbe permettere alla lpar di scalare il numero di cpu utilizzabili; il numero delle vcpus rappresenta il limite fino a cui attingere risorse libere quando richiesto, oltre il valore di “entitled capacity”.

Nota: si rimanda al documento allegato

P7_virtualization_bestpractice.doc

prelevato al link:

https://www.ibm.com/developerworks/community/wikis/form/anonymous/api/wiki/61ad9cf2-c6a3-4d2c-b779-61ff0266d32a/page/64c8d6ed-6421-47b5-a1a7-d798e53e7d9a/attachment/f9ddb657-2662-41d4-8fd8-77064cc92e48/media/p7_virtualization_bestpractice.doc

May the NIMADM be with you

NIMADM or Network Installation Manager Alternate Disk Migration, is a facility that helps you to seamlessly clone and upgrade your lpar to a new AIX release.

In the following example lpar01 is at 7100-05-05-1939 level, we ‘d like to upgrade it to 7200-03-03-1914 with the least possible downtime .

The entire nimadm process splits into 12 phases that allows to fully customize the target environment.

root@nim01:/download/AIX/PTF/# nimadm -l lpp-aix720303-FULL -c lpar01-int -s spot-aix720303 -d hdisk0 -Y
Initializing the NIM master.
Initializing NIM client lpar01-int.

Verifying alt_disk_migration eligibility.
Initializing log: /var/adm/ras/alt_mig/lpar01-int_alt_mig.log
Starting Alternate Disk Migration.


Restoring device ODM database.

+—————————————————————————–+
Executing nimadm phase 7.
+—————————————————————————–+
nimadm: There is no user customization script specified for this phase.

+—————————————————————————–+
Executing nimadm phase 8.
+—————————————————————————–+
Creating client boot image.
bosboot: Boot image is 59393 512 byte blocks.
Writing boot image to client’s alternate boot disk hdisk0.

+—————————————————————————–+
Executing nimadm phase 9.
+—————————————————————————–+
Unmounting client mounts on the NIM master.
forced unmount of /lpar01-int_alt/alt_inst/var/adm/ras/livedump
forced unmount of /lpar01-int_alt/alt_inst/var
forced unmount of /lpar01-int_alt/alt_inst/usr
forced unmount of /lpar01-int_alt/alt_inst/tmp
forced unmount of /lpar01-int_alt/alt_inst/opt/ocsinventory
forced unmount of /lpar01-int_alt/alt_inst/opt/netbackup
forced unmount of /lpar01-int_alt/alt_inst/opt/nagios
forced unmount of /lpar01-int_alt/alt_inst/opt/freeware/webmin
forced unmount of /lpar01-int_alt/alt_inst/opt/bmc
forced unmount of /lpar01-int_alt/alt_inst/opt/IBM
forced unmount of /lpar01-int_alt/alt_inst/opt
forced unmount of /lpar01-int_alt/alt_inst/logs
forced unmount of /lpar01-int_alt/alt_inst/home
forced unmount of /lpar01-int_alt/alt_inst/admin
forced unmount of /lpar01-int_alt/alt_inst

+—————————————————————————–+
Executing nimadm phase 10.
+—————————————————————————–+
Unexporting alt_inst filesystems on client lpar01-int:

+—————————————————————————–+
Executing nimadm phase 11.
+—————————————————————————–+
Cloning altinst_rootvg on client, Phase 3.
Client alt_disk_install command: alt_disk_copy -M 7.2 -P3 -d “hdisk0”

Verifying altinst_rootvg…
Modifying ODM on cloned disk.
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt/ocsinventory
forced unmount of /alt_inst/opt/ocsinventory
forced unmount of /alt_inst/opt/netbackup
forced unmount of /alt_inst/opt/netbackup
forced unmount of /alt_inst/opt/nagios
forced unmount of /alt_inst/opt/nagios
forced unmount of /alt_inst/opt/freeware/webmin
forced unmount of /alt_inst/opt/freeware/webmin
forced unmount of /alt_inst/opt/bmc
forced unmount of /alt_inst/opt/bmc
forced unmount of /alt_inst/opt/IBM
forced unmount of /alt_inst/opt/IBM
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/logs
forced unmount of /alt_inst/logs
forced unmount of /alt_inst/home
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks…
Fixing file system superblocks…
Bootlist is set to the boot disk: hdisk0 blv=hd5

+—————————————————————————–+
Executing nimadm phase 12.
+—————————————————————————–+
Cleaning up alt_disk_migration on the NIM master.
Cleaning up alt_disk_migration on client lpar01-int.

ALT_DISK_COPY fallisce a causa di LDR_PRELOAD valorizzato

alt_disk_copy con upgrade fallisce con errori relativi a dynatrace:

##################################################
Tue Mar 31 10:51:45 CEST 2020
cmd: /usr/sbin/alt_disk_copy -d hdisk1 -B update_all -l /mnt/AIX/PTF/Aix-72-03-03-FULL/ -e
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5
Creating logical volume alt_hd6
Creating logical volume alt_hd8
Creating logical volume alt_hd4
Creating logical volume alt_hd2
Creating logical volume alt_hd9var
Creating logical volume alt_hd3
Creating logical volume alt_hd1
Creating logical volume alt_hd10opt
Creating logical volume alt_hd11admin
Creating logical volume alt_lg_dumplv
Creating logical volume alt_livedump
Creating logical volume alt_nagios
Creating logical volume alt_fslv00
Creating logical volume alt_logs
Creating logical volume alt_ocsinv
Creating logical volume alt_netbackup
Creating logical volume alt_bmc
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/download file system.
Creating /alt_inst/home file system.
Creating /alt_inst/logs file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/opt/bmc file system.
Creating /alt_inst/opt/nagios file system.
Creating /alt_inst/opt/netbackup file system.
Creating /alt_inst/opt/ocsinventory file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump file system.
Generating a list of files
for backup and restore into the alternate file system…
Backing-up the rootvg files and restoring them to the
alternate file system…
0505-148 alt_disk_install: WARNING: an error occurred during backup.
Modifying ODM on cloned disk.
Building boot image on cloned disk.
exec(): 0509-036 Cannot load program /usr/bin/ksh because of the following errors:
0509-150 Dependent module /opt/dynatrace/oneagent/agent/lib/liboneagentproc.so could not be loaded.
0509-022 Cannot load module /opt/dynatrace/oneagent/agent/lib/liboneagentproc.so.
0509-026 System error: A file or directory in the path name does not exist.
0505-120 alt_disk_install: Error running bosboot in the cloned
root volume group.
Cleaning up.

Abbiamo aperto un case al supporto che ha rilevato che Dynatrace non è installato ma una libreria del prodotto è referenziata da una variabile di ambiente.

LDR_PRELOAD=/opt/dynatrace/oneagent/agent/lib/liboneagentproc.so

Eliminando la variabile l’esecuzione di alt_disk_copy termina correttamente senza errori.

Aix alt_disk_clone

Di seguito i passi eseguiti per clonare rootvg della lpar LPAR1 in occasione della migrazione da un P6-570 ad un P7-770.
Aggiungo un disco da 50GB (hdisk27) che ospiterà il rootvg della nuova partizione , sulla vecchia si chiamerà altinst_rootvg
al termine dell’operazione.

root@lpar1:/#lspv
hdisk0 00cff683554eac45 rootvg active
hdisk1 00cff683554eac7b rootvg active
hdisk4 00cff683e9f9313f vgappl30 active
hdisk2 00cff68379f89cc7 vgappl31 active
hdisk3 00cff68379f89dbe vgappl32 active
hdisk5 00cff68379f89e28 vgappl33 active
hdisk6 00cff68379f89e74 vgappl34 active
hdisk7 00cff68379f89eb4 vgappl35 active
hdisk8 00cff68379f89ef9 vgappl36 active
hdisk9 00cff68379f89f36 vgappl30 active
hdisk10 00cff68379f89f7a vgappl31 active
hdisk11 00cff68379f89fbb vgappl32 active
hdisk12 00cff68379f89ffc vgappl33 active
hdisk13 00cff68379f8a046 vgappl34 active
hdisk14 00cff68379f8a08b vgappl35 active
hdisk15 00cff68379f8a0d1 vgappl36 active
hdisk16 00cff6837a2fb38a tempvg active
hdisk17 00cff683ad734158 tempvg active
hdisk18 00cff6837b91c30d vgappl30 active
hdisk19 00cff683d38e1716 swapvg active
hdisk20 00cff6830a99978f vgappl30 active
hdisk21 00cff6830a999885 vgappl31 active
hdisk22 00cff6830a9998f1 vgappl32 active
hdisk23 00cff6830a999958 vgappl33 active
hdisk24 00cff6830a9999c5 vgappl34 active
hdisk25 00cff6830a999a4e vgappl35 active
hdisk26 00cff6830a999ace vgappl36 active
hdisk27 00cff6830915c025 None

 

Notare che se rootvg è mirrored l’operazione fallirà per mancanza di spazio; rimuovere mirror prima di procedere:

root@lpar1:/#unmirrorvg rootvg hdisk1
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run ‘chpv -c <diskname>’
as root user to clear the boot record and avoid a potential boot
off an old boot image that may reside on the disk from which this
logical volume is moved/removed.
0516-1804 chvg: The quorum change takes effect immediately.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
bosboot of system to reinitialize boot records. Then, user must modify
bootlist to just include: hdisk0.

 

Verifichiamo lo stato del mirror :

root@lpar1:/#lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 981 588 08..00..188..196..196
hdisk1 active 981 981 197..196..196..196..196

 

OK , adesso rimuovo hdisk1 da rootvg :

root@lpar1:/#reducevg rootvg hdisk1
root@lpar1:/#lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 981 588 08..00..188..196..196

 

Un altro problema che potrebbe impedire l’operazione è la presenza di LV con nomi di lunghezza superiore a 12 caratteri
visto che la procedura aggiungerà un prefisso al nome originale dei logical volumes.

root@lpar1:/#smitty alt_clone

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
* Target Disk(s) to install [hdisk27] +
Phase to execute all +
image.data file [] /
Exclude list [] /

Bundle to install [] +
-OR-
Fileset(s) to install []

Fix bundle to install []
-OR-
Fixes to install []

Directory or Device with images []
(required if filesets, bundles or fixes used)

installp Flags
COMMIT software updates? yes +
SAVE replaced files? no +
AUTOMATICALLY install requisite software? yes +
EXTEND file systems if space needed? yes +
OVERWRITE same or newer versions? no +
VERIFY install and check file sizes? no +
ACCEPT new license agreements? yes +

Customization script [] /
Set bootlist to boot from this disk
on next reboot? no +
Reboot when complete? no +
Verbose output? yes +
Debug output? no +

 

Attenzione a non selezionare la modifica della bootlist e il reboot when complete .

Selezionando l’output verboso vedremo la lista dei files che vengono copiati nel nuovo disco , inutile.

Alla fine avremo :

root@lpar1:/#lspv
hdisk0 00cff683554eac45 rootvg active
hdisk1 00cff683554eac7b None
hdisk4 00cff683e9f9313f vgappl30 active
hdisk2 00cff68379f89cc7 vgappl31 active
hdisk3 00cff68379f89dbe vgappl32 active
hdisk5 00cff68379f89e28 vgappl33 active
hdisk6 00cff68379f89e74 vgappl34 active
hdisk7 00cff68379f89eb4 vgappl35 active
hdisk8 00cff68379f89ef9 vgappl36 active
hdisk9 00cff68379f89f36 vgappl30 active
hdisk10 00cff68379f89f7a vgappl31 active
hdisk11 00cff68379f89fbb vgappl32 active
hdisk12 00cff68379f89ffc vgappl33 active
hdisk13 00cff68379f8a046 vgappl34 active
hdisk14 00cff68379f8a08b vgappl35 active
hdisk15 00cff68379f8a0d1 vgappl36 active
hdisk16 00cff6837a2fb38a tempvg active
hdisk17 00cff683ad734158 tempvg active
hdisk18 00cff6837b91c30d vgappl30 active
hdisk19 00cff683d38e1716 swapvg active
hdisk20 00cff6830a99978f vgappl30 active
hdisk21 00cff6830a999885 vgappl31 active
hdisk22 00cff6830a9998f1 vgappl32 active
hdisk23 00cff6830a999958 vgappl33 active
hdisk24 00cff6830a9999c5 vgappl34 active
hdisk25 00cff6830a999a4e vgappl35 active
hdisk26 00cff6830a999ace vgappl36 active
hdisk27 00cff6830915c025 altinst_rootvg

 

A questo punto abbiamo il nuovo rootvg (altinst_rootvg) , per accedervi dobbiamo usare il comando alt_rootvg_op.
Ad esempio possiamo “svegliare” il vg :

root@lpar1:/#alt_rootvg_op -W -d hdisk27
Waking up altinst_rootvg volume group …

root@lpar1:/#lsvg -l altinst_rootvg
altinst_rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
alt_hd5 boot 1 1 1 closed/syncd N/A
alt_hd6 paging 16 16 1 closed/syncd N/A
alt_hd8 jfs2log 1 1 1 open/syncd N/A
alt_hd4 jfs2 8 8 1 open/syncd /alt_inst
alt_hd2 jfs2 37 37 1 open/syncd /alt_inst/usr
alt_hd9var jfs2 16 16 1 open/syncd /alt_inst/var
alt_hd3 jfs2 32 32 1 open/syncd /alt_inst/tmp
alt_hd10opt jfs2 64 64 1 open/syncd /alt_inst/opt
alt_hd11admin jfs2 2 2 1 open/syncd /alt_inst/admin
alt_dumplv0 sysdump 64 64 1 closed/syncd N/A
alt_livedump jfs2 4 4 1 open/syncd /alt_inst/var/adm/ras/livedump
alt_netbackup jfs2 64 64 1 open/syncd /alt_inst/opt/netbackup
alt_ocsinv jfs2 2 2 1 open/syncd /alt_inst/opt/ocsinventory
alt_nagios jfs2 2 2 1 open/syncd /alt_inst/opt/nagios
alt_logs jfs2 80 80 1 open/syncd /alt_inst/logs

 

e rimetterlo a dormire :

root@lpar1:/#alt_rootvg_op -S
Putting volume group altinst_rootvg to sleep …
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt/ocsinventory
forced unmount of /alt_inst/opt/ocsinventory
forced unmount of /alt_inst/opt/netbackup
forced unmount of /alt_inst/opt/netbackup
forced unmount of /alt_inst/opt/nagios
forced unmount of /alt_inst/opt/nagios
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/logs
forced unmount of /alt_inst/logs
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Fixing LV control blocks…
Fixing file system superblocks…

root@lpar1:/#lsvg
rootvg
altinst_rootvg
vgappl30
vgappl31
vgappl32
vgappl33
vgappl34
vgappl35
vgappl36
stagevg
swapvg

root@lpar1:/#lsvg -l altinst_rootvg
0516-010 : Volume group must be varied on; use varyonvg command.

 

Ora non rimane che eliminare ogni traccia del vg e del disco dalla lpar per spostarlo sulla nuova.

root@lpar1:/#exportvg altinst_rootvg

root@lpar1:/#rmdev -dl hdisk27
hdisk27 deleted