Nim Useful Commands

root's picture

How to list all defined NIM objects:

# lsnim

How to list all defined objects of a specific type:

# lsnim -t <type>

How to show an object's definition:

# lsnim -l <object>

How to define an LPP source if you have the bffs location:

# nim -o define -t lpp_source -a server=master -a location=</path/to/bffs> \
-a comments=<free text> <lpp source>

How to define a network for nim operations:

# nim -o define -t ent -a net_addr=<netaddress> -a snm=<netmask> \
-a routing1="default <gateway>" <network>

How to define a NIM client:

Instead of ip label, you can use ip address too.

# nim -o define -t standalone -a platform=chrp -a netboot_kernel=64 \
-a if1="<network> <ip label> 0 ent" -a cable_type1=tp <client>

How to define an MKSYSB resource:

# nim -o define -t mksysb -a server=master -a comments="<free text>" \
-a location=<directory> <mksysb>

Example:

[gznim:root:/home/root:] nim -o define -t mksysb -a server=master -a location=/export/mksysb/gznim/gznim.mksysb mksysb_71-03-04
[gznim:root:/home/root:]

How to create mksysb backup of a nim client:

# nim -o define -t mksysb -a server=master -a location=<image path> \
-a source=<client> -a mksysb_flags=<mksysb flags> -a mk_image=yes <mksysb resource name>

Example:

[gznim:root:/home/root:] nim -o define -t mksysb -a server=master -a location=/export/mksysb/gzaix/gzaix_$(date +%Y%m%d%H%M%S)_sysb -a source=gzaix -a mksysb_flags=eiX -a mk_image=yes gzaix_mksysb

+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+

Required = 11474417 (11206 MB)    Available = 790102232 (771585 MB)



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

Creating list of files to back up 
Backing up 86069 files..............................
14817 of 86069 files backed up (17%)......................

86069 of 86069 files backed up (100%)
0512-038 savevg: Backup Completed Successfully.
[gznim:root:/home/root:] ls -la /export/mksysb/gzaix/gzaix_*
-rw-r--r--    1 root     system   10699110400 Jan  8 13:28 /export/mksysb/gzaix/gzaix_20150108131936_sysb

How to define an image_data resource:

# nim -o define -t image_data -a server=master -a comments="<free text>" \
-a location=</path/to/image_data> <image_data>

How to create a spot from an LPP source:

# nim -o define -t spot -a server=master -a source=<lpp source> \
-a location=<directory> -a comments="<free text>" <spot>

How to create a spot from an MKSYSB:

Use the base directory for your spots here rather than a spot specific directory. NIM automatically creates a subdirectory with the name of the spot object <spot>.

# nim -o define -t spot -a server=master -a source=<mksysb> \
-a location=<directory> -a comments="<free text>" <spot>

Example:

[gznim:root:/export/mksysb:] nim -o define -t spot -a server=master -a location=/export/spot/7.1/ -a source=mksysb_71-03-04 spot_71-03-04

 Creating SPOT in "/export/spot/7.1/" on machine "master" from "mksysb_71-03-04" ...

 Restoring files from BOS image.  This may take several minutes ...


 Checking filesets and network boot images for SPOT "spot_71-03-04".
 This may take several minutes ...

How to prepare spot and LPP source for an Alternate Disk Migration:

In <source directory> NIM searches for the two filesets bos.alt_disk_install.rte and bos.alt_disk_install.boot_images. nimadm then updates spot and LPP source with these two filesets. This way you can migrate a client to a lower AIX level then the level of the NIM server itself. This feature has been added to NIM with AIX 7.1.
# nimadm -M -s <spot> -l <lpp source> -d <source directory>

How to modifying a client's definition:

# nim -o change -a <attribute>=<value> <client>
By listing the nim client, you fin the exact names of valid attributes:
# lsnim -l <client>
The option change is used to modify the value of an attribute. For example, if you want to change a client's netboot kernel from mp to 64, the command is:
# nim -o change -a netboot_kernel=64 <client>

How to re-initializing a client:

This is useful if you want to move a client from one nim to another. In this case, you will have to create the client on the nim server before this.
In case a client's /etc/niminfo is out of date, it can be rewritten:
nim_client# rm /etc/niminfo
nim_client# niminit -a name=<client> -a master=<nimserver> -a connect=nimsh
PS: The option -a connect=nimsh is optional. If not mentioned, the communication will be done via rsh.

How to install a client:

The option no_client_boot=yes is to avoid the initialisation of lpar's reboot. After executing this command, you will have to manually boot the partition from SMS menu.

# nim -o bos_inst -a spot=<spot> -a lpp_source=<lpp source> \
-a fb_script=<script> -a script=<postinstall script> -a no_client_boot=yes \
-a accept_licenses=yes <client>

How to install a client from MKSYSB image:

# nim -o bos_inst -a source=mksysb -a spot=<spot> -a mksysb=<mksysb> \
-a lpp_source=<lpp source> -a fb_script=<script> -a script=<postinstall script> \
-a no_client_boot=yes -a accept_licenses=yes <client>

How to reset a NIM client:

# nim -F -o reset <client>
Resetting a nim client is useful when new operations can be done.
Usually you do this after a failed operation and you want to start over.
Sometimes it is not enough to only reset it, you will have to deallocate the attached resources too.
They can be found with # lsnim -l <client>.

How to deallocate a resource:

# nim -o deallocate -a spot=<spot> -a ...=... <client>

How to remove all resources from a client:

# nim -o deallocate -a subclass=all <client>

How to query a client for installed APARs:

This way you can see also if the client is reachable.
# nim -o fix_query <client>

How to enable a maintenance boot of a client:

# nim -o maint_boot -a spot=<spot> <client>

How to start an Alternate Disk Migration:

# nimadm -c <client> -l <lpp source> -s <spot> -d <hdisk> -Y

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root