nim_master_recover Command

Purpose

Restores a backup of the Network Installation Management (NIM) database to a different machine and updates the database to reflect this change.

Syntax

nim_master_recover [ -f mstr_fileset_dir]

[ -n nimdef_file]

[ -r nimdb_file]

[ -i mstr_interface]

[ -D ] [ -R ] [ -S ] [ -p ] [ -s ] [ -u ] [ -v ]

[ -N mstr_net_info [-t net_def ]]

Description

The nim_master_recover command can restore and update the NIM database from a backup tar file. To backup the NIM database on the old master, run the smit nim_backup_db command. This creates a tar file named /usr/objrepos/nimdb.backup by default. Once the nimdb.backup is copied to the new master, pass the -r flag with the full path to the file. If the path to the tar file is /usr/objrepos/nimdb.backup, then pass -r /usr/objrepos/nimdb.backup to the nim_master_recover script.

The script updates the master definition in the NIM database based on the master's primary network interface. The -i flag specifies the primary interface to use for the master. To use en0, pass -i en0 to the nim_master_recover script.
Note: A restored NIM database may be incorrect if you restore from a database that has network definitions containing static routes. The nim_master_recover command removes all the interfaces in the old master definition before adding the primary interface for the new master. Check that the routing information is correct after running the nim_master_recover command, by running lsnim -lc networks. If all the NIM network definitions in the restored database contain dynamic routes, then you should not run into this situation.

Along with restoring and updating the NIM database, the script performs several other optional functions. One is to install the bos.sysmgt.nim.master fileset if the -f flag is passed with the location of the bos.sysmgt package. For instance, if the bos.sysmgt package is located in the /export/latest/installp/ppc directory, then you would pass -f /export/latest/installp/ppc to the nim_master_recover script.

The script always resets each client. If the -u flag is passed, the script attempts to unexport NIM resources that the database states are allocated to clients. Each client stores the hostname of its NIM master in its /etc/niminfo file. To update the niminfo file on each client, pass the -s flag.
Note: Any NIM client that is not running, does not have a network connection, does not allow the new master rhost permissions, or does not have at least the bos.sysmgt.nim.client 5.1.0.10 package, will not have its niminfo updated. The nim_master_recover script will report any clients which fail to have their niminfo files updated.

New clients can be added to the environment by specifying a nimdef file with the -n flag. Consult the AIX® Installation Guide for more information on nimdef files.

Finally, the script will check to see if the resources in the NIM database exist. The script deletes resources that don't exist. For example if the new master is unable to communicate with a NIM server, then the resources defined on that server will be removed from the NIM database. Passing the -R flag prevents the script from checking resources.
Note: Resources that were defined on the master where the database was backed up, will not be available once the database is restored unless the resources were copied to the new master before running nim_master_recover.

All output will be logged to /var/adm/ras/nim.recover. Once the script is complete you should verify that no errors were logged.

The nim_master_recover command behaves differently when it is called with the -N flag. This allows the master to have its hostname, IP address, and NIM network changed in its if1 attribute. Optionally, a new NIM network may be created if the -t flag is provided with the -N flag. The command should be run with these flags before the master's network name or address is actually changed so that the NIM environment will work properly once the change actually takes place. When the master's NIM attributes are changed, the command will attempt to update /.rhosts and /etc/niminfo of each standalone client defined in the environment. Any clients for which this attempt fails must have its NIM master information updated manually. Also, after a standalone client has had its NIM master's network name changed, it will not be able to execute any NIM operations until the master is up and running with its new network name.

Flags

Item Description
-D Deletes all client definitions from the restored database.
-f directory Directory containing the bos.sysmgt.nim.master fileset to install.
-i interface Primary network interface of the machine where you are running the command.
-n nimdef Optional nimdef file that will be used to define new machines.
-N mstr_net_info Changes the master's if1 attribute and attempts to update each standalone client defined in the environment with the master's new network information. The mstr_net_info variable consists of the following: "nim_net_name [hostname] [cable_type]"; where hostname and cable_type are optional.
-p Print the machine states before the script resets the machines.
-r nimdb.backup The NIM database backup tar file that will be restored.
-R Do not check the resources to see if each one exists. The default behavior is for the script to check each resource and if it does not exist, remove its definition from the database.
-S Do not check the SPOT resources. The default behavior is for the script to check every SPOT to ensure it is ready to support an install. For example, the check ensures the boot images are created.
-s Attempt to update the niminfo file on each client. Any NIM client that is not running, does not have a network connection, does not allow the new master rhost permissions, or does not have at least the bos.sysmgt.nim.client 5.1.0.10 package installed, will not have its niminfo updated.
-t net_def Creates a new NIM network if the master's IP address changes and there is no existing NIM network that could contain the master. This flag is only valid when the -N flag is also specified. The net_def variable consists of the following: "nim_net_name net_type net_addr net_snm default_route"; where net_type can be ent, tok, atm, or fddi.
-u Unexport all resources that are listed as allocated in the restored database. The default behavior is for the script to delete the allocation from the NIM database without attempting to deallocate the resource.
-v Enables verbose debug output during command execution.

Location

/usr/sbin/nim_master_recover

Exit Status

Returns zero (0) upon success.

Security

Access Control: You must have root authority to run the nim_master_recover command.

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To recover the NIM master using the/export/nim/nimdb.backup file and the primary interface en0, type:
    nim_master_recover -r /usr/objrepos/nimdb.backup -i en0
  2. To install the bos.sysmgt.nim.master fileset from /export/lpp_source/installp/ppc before recovering the NIM master, type:
    nim_master_recover -f /export/lpp_source/installp/ppc \
               -r /usr/objrepos/nimdb.backup -i en0
  3. To recover the NIM master without checking if each resource exists and without checking the SPOTs to rebuild boot images, type:
    nim_master_recover -R -S -r /usr/objrepos/nimdb.backup -i en0
  4. To recover the NIM master while unexporting any resources that are allocated and printing the state of the clients before each one is reset, type:
    nim_master_recover -u -p -r /usr/objrepos/nimdb.backup -i en0
  5. To recover the NIM master and update the /etc/niminfo file on each client, type:
    nim_master_recover -s -r /usr/objrepos/nimdb.backup -i en0
  6. To recover the NIM master, delete each client from the database, and define new clients from the nimdef file /export/nim/nimdef, type:
    nim_master_recover -D -n /export/nim/nimdef -r /usr/objrepos/nimdb.backup -i en0
  7. To change the master's hostname to newhost.domain.com and move it to a different existing NIM network, called net2, but preserve the value of the current cable_type attribute, type:
    nim_master_recover -N "net2 newhost.domain.com"
  8. To change the master's hostname to newhost.domain.com, change its cable_type to bnc, and move it to a new NIM ethernet network called new_nim_net whose address is 192.168.1.0, subnet mask is 255.255.255.0, and default gateway is 192.168.1.1, type:
    nim_master_recover -N "new_nim_net newhost.domain.com bnc" \
    	-t "new_nim_net ent 192.168.1.0 255.255.255.0 192.168.1.1"

Files

Item Description
/etc/niminfo Contains variables used by NIM.
/var/adm/ras/nim.recover Contains log information from command execution.