===== NIM operations ===== - **Preview install on client for specific package:** [root@aix06] /root> nimclient -o cust -a lpp_source=LPP-AIX72TL1SP2 -a filesets=bos.rte.install -a installp_flags=-pacNYgX - **Update all packages from NIM client:** [root@aix06] /root> nimclient -o cust -a lpp_source=LPP-AIX72TL1SP2 -a fixes=update_all -a installp_flags=-acNYgX - **Boot a nim client on a ethernet interface using vlan tagging:** [root@aix06] /root> bootlist -m normal -o hdisk0 pathid=1 ent0 speed=auto duplex=auto bserver=10.10.10.1 client=10.10.10.25 gateway=10.10.10.254 vlan_tag=5 - **Remove a resource:** # nim -Fo remove spot_aix6100-06-05 - **Deallocate resources from a NIM client:** # nim -o reset -a force=yes laboh nim -Fo deallocate -a subclass=all laboh For info: low level command to unallocated resource: # lsnim -Fl nimclient1 alloc_count = 1 # /usr/lpp/bos.sysmgt/nim/methods/m_chattr -a alloc_count=0 nimclient1 # lsnim -Fl nimclient1 alloc_count = 0 - **Create a NIM client:** # nim -o define -t standalone -a if1="net_41 testsrv 0" -a cable_type1='N/A' -a platform=chrp -a netboot_kernel=64 -a connect=nimsh testsrv - **Register a NIM client from client (if allowed):** # niminit -aname= -amaster= -a pif_name= -a connect=nimsh - **Create a mksysb from a NIM client:** # nim -o define -t mksysb -F -a server=master -a location=/export/mksysb/.mksysb -a source= -a mk_image=yes -a mksysb_flags='-e -i' _mksysb - **Define a LPPSOURCE:** # nim -o define -t lpp_source -a server=master -a source=lpp5300 -a location=/nim/lppsource/lpp5304 lpp5304 - **Cleanup an lppsource:** To remove duplicate packages from a directory ppc and put unused files into /software/ppc (lppmgr command): # /usr/lib/instl/lppmgr -d ppc -ubx -m /software/lpp -V - **Define a SPOT from an LPPSOURCE:** # nim -o define -t spot -a source=lpp_source1 -a server=master -a location=/export/spot spot1 - **Update a SPOT with new OS version:** # nim -o cust -a fixes=update_all -a lpp_source=aix7100-05-08-2114 spot_7100-05-06-2028 - **Define a SPOT from a directory that previously had a SPOT installed in it** # /usr/lpp/bos.sysmgt/nim/methods/m_mkspot -o -a server=server -a location=location -a source=no spotname - **Define a SCRIPT:**, for example to start before NIM upgrade # nim -o define -t script -a server=master -a location=/export/nim/custom_scr_mig72/pre_scr_mig72.sh pre_scr_mig72 - **Showlogs related to a resource:** # nim -o showlog -a full_log=yes -a log_type=nimerr spot_aix6100-06-05 - **Read the full NIM log:** # alog -f /var/adm/ras/nimlog -o - **List operation for a specific object:** [root@nimsrv]/root# lsnim -POt spot spot: change = change an object's attributes showres = show contents of a resource reset = reset an object's NIM state define = define an object remove = remove an object cust = perform software customization sync_roots = synchronize roots for all clients using specified SPOT maint = perform software maintenance lslpp = list LPP information about an object fix_query = perform queries on installed fixes showlog = display a log in the NIM environment check = check the status of a NIM object lppchk = verify installed filesets Lppchk on a spot (with checksum) [root@nimsrv]/root# nim -o lppchk -a lppchk_flags="-c" spot_7100-04-03 - **List attributes that can be changed for a resource:** [root@nimsrv]/root# lsnim -q change spot_aix6100-06-05 the following attributes are optional: -a comments= -a new_name= -a verbose= -a nfs_vers= -a nfs_sec= -a client_alloc= -a dest_dir= -a dumpsize= -a snapcollect= -a notify= -a max_dumps= - **Instfix command to check APARs, or individual fileset into a spot** # nim -o fix_query spot_7100-01 | grep SP All filesets for 71-00-011037_SP were found. All filesets for 71-00-021041_SP were found. All filesets for 71-00-031115_SP were found. All filesets for 71-01-011141_SP were found. All filesets for 71-00-041140_SP were found. All filesets for 71-01-021150_SP were found. All filesets for 71-01-031207_SP were found. All filesets for 71-00-051207_SP were found. All filesets for 71-01-041216_SP were found. All filesets for 71-00-061216_SP were found. All filesets for 71-01-051228_SP were found. # nim -o fix_query -a fix_query_flags="-c" spot_7100-01 | grep bos.net IV22689:bos.net.tcp.client:7.1.1.16:7.1.1.16:=:NETSTAT -R IN WPAR RETURNS "PERMISSION DENIED" 71-01-051228_SP:bos.net.nfs.client:7.1.1.16:7.1.1.16:=:AIX 7100-01-05 Service Pack 71-01-051228_SP:bos.net.tcp.client:7.1.1.16:7.1.1.16:=:AIX 7100-01-05 Service Pack ... # nim -o lslpp -a lslpp_flags=Lc -a filesets=bos.alt_disk_install.rte spot_aix6100-06 - **Perform change on NIM server if hostname, ip or adapter has changed:** [root@nimsrv]/export/software/TSM/client# nim_master_recover -i en0 -S error retrieving nim name, defaulting to host name. Updating master definition Updated master attribute platform to chrp Updated master attribute netboot_kernel to 64 Updated master attribute if1 to network1 nimsrv FA1EC34A1404 Updated master attribute cable_type1 to N/A Updated network1 routing1 to default 10.10.1.1 Finished updating master definition Resetting machines Reset master Reset client1 Reset Finished resetting machines Resetting NIM resources Finished resetting NIM resources Checking NIM resources Keeping spot_aix61tl7 Removing client5_mksysb 0518-307 odmdelete: 1 objects deleted. from nim_attr (serves attr) 0518-307 odmdelete: 0 objects deleted. from nim_attr (group memberships) 0518-307 odmdelete: 10 objects deleted. from nim_attr (resource attributes) 0518-307 odmdelete: 1 objects deleted. from nim_object (resource object) Finished removing client5_mksysb Keeping lpp_aix61tl7 Finished checking NIM resources nim_master_recover Complete - **NIM client commands:** Install and update software from a client # nimclient -o cust -a installp_flags=gXY -a filesets=xlsmp.rte -a lpp_source=lpp_aix7100-02-03_base # nimclient -o cust -a installp_flags=Y -a fixes=update_all -a lpp_source=lpp_aix7100-02-03_base - **List all resources available for a client:** # nimclient -l -L devds2_nc mksysb_nim_20121001 mksysb lpp_aix7100-01-00_base lpp_source spot_aix5300-08 spot lpp_aix5300-08-00_base lpp_source lpp_aix6100-06-00_base lpp_source lpp_aix7100-02-03_base lpp_source ===== Changing the CPUID of NIM Master and NIM Clients after LPM ===== ==== On the NIM Client: ==== This document explains how to change your NIM Master or NIM Clients CPUID after you have moved it to new HW to match the system's new CPUID. To check what CPUID the Master has for the NIM Client we can run the following command on the NIM Master: root@sentinel(/)# lsnim -l instlab163 | grep -i cpuid cpuid = 00FF48B55C00 <---- wrong/old CPUID To check the current CPUID of the NIM Client: root@instlab163(/)# uname -a AIX instlab163 2 7 00F84BE54C00 To change the CPUID on the NIM Master’s client definition to match with the actual CPUID of the nim client: root@sentinel(/)#nim -o change -a cpuid=00F84BE54C00 instlab163 root@sentinel(/)# lsnim -l instlab163 | grep -i cpuid cpuid = 00F84BE54C00 <---- correct CPUID We can verify connectivity: root@sentinel(/)# nim -o lslpp instlab163 | grep bos.mp bos.mp64 7.2.4.0 COMMITTED Base Operating System 64-bit ==== On the NIM Master: ==== To check the current system CPUID: root@sentinel(/)# uname -a AIX sentinel 2 7 00FB43B94C00 To check the NIM Master definition: root@sentinel(/)# lsnim -l master | grep -i cpuid cpuid = 00FB43C85B00 ß old/wrong CPUID To change the CPUID: # /usr/lpp/bos.sysmgt/nim/methods/m_chattr -a cpuid="new CPUID" master Example: root@sentinel(/)# /usr/lpp/bos.sysmgt/nim/methods/m_chattr -a cpuid="00FB43B94C00" master To verify: root@sentinel(/)# lsnim -l master | grep -i cpuid cpuid = 00FB43B94C00 ===== Automaticaly restore AIX LPAR ===== ==== Steps to install mksysb from NIM ==== === On the NIM server === Allocate required resource # nim -o reset -a force=yes $CLIENT_NAME # nim -Fo deallocate -a subclass=all $CLIENT_NAME # nim -o bos_inst -a source=mksysb -a mksysb=$MKSYSB -a spot=$SPOT -a accept_licenses=yes -a fb_script=$SCRIPTFB -a bosinst_data=$BOSINST_DATA -a boot_client=no $CLIENT_NAME Monitoring # nim -o showlog -a log_type=boot $CLIENT_NAME > $LOG === On the HMC === Now boot the partition using a specific IP, and also give the NIM server IP to boot # Syntax To retrieve a MAC address: lpar_netboot -M -n [-v] [-x] [-f] [-i] [-A] -t ent [-D -s Speed-d Duplex -S Server -G Gateway -C Client -K subnetmask] partition name partition profile manage system To perform a network boot: lpar_netboot [-v[-x] [-f] [-i] [-g args] [-A -D | [-D] -l phys_loc | [-D] -m maddress] -t ent [-D -s Speed-d Duplex -S Server -G Gateway -C Client -K subnetmask partition_name partition_profile manage_system