{{:Design Warning}}
On Linux, xCAT postscripts are executed during the init.d process via xcatdsklspost when a node boots up the first time. xcatdsklspost gets all the postscripts and environmental variables for the node from its master. It then runs the postscripts one by one. Node's DHCP server is used as its master. updatenode command also uses xcatdsklspost for running postscripts.
In a flat network, even if we set the noderes.xcatmaster for a node, any service node can respond to the DHCP request for the node. When the node's original DHCP server is down, updatenode will fail because xcatdsklspost cannot get all the postscripts from its DHCP server. In this case, the node's service node is alive, but updatenode cannot be run successfully. This problem also prevents nodes from being moved from one service node to another.
Retry logic will be added to the wget call (for getting the postscripts from the master) in xcatdsklspost. It will try to get the hostname of the master from the following sources in order:
/etc/xcatinfo file is used to save the node's master for later use. At the end of the xcatdsklspost script, it will save the value from the environmental variable MASTER to the file. This file contains a line like "XCATSERVER=<svr_name>".
During an AIX diskfull install or diskless boot the xCAT "xcataixpost" script is run. Among other things it will run whatever additional postscripts are specified.
When postscripts are run on AIX nodes the name of the server is read from the /etc/xcatinfo file. This file was originally created to preserve the information from the NIM /etc/niminfo file that is automatically created during the node installation (by NIM). This copy of the niminfo file was needed because the niminfo file is changed when an xCAT SN is configured as a NIM master. The xcatinfo file is now also being used it the Linux process.
Diskfull install flow:
During the creation of a diskfull image (using mknimimage) a NIM script resource is automatically defined using the xCAT "xcataixscript" script. NIM runs this script during the node install. This script will read the /etc/niminfo file and create the /etc/xcatinfo file. It will also mount/copy postscripts to the node and add the xCAT "xcataixpost" script to the /etc/inittab file.
During the initial reboot of the node the "xcataixpost" is run. It gets the name of the server from /etc/xcatinfo, requests the node-unique postscript from the server and runs the postscripts for the node. (It also sets the password, removes itself from inittab etc.)
Note: In the current design the /etc/xcatinfo file is only created once. The "xcataixpost" script will check for it and create one if it's not there but will not overwrite it.
Diskless boot flow:
During the creation of a diskless image the mknimimage command automatically updates the NIM SPOT resource. It adds "xcataixpost" to the image and it adds an entry for it in the /etc/inittab file contained in the image.
When the node is booted the script checks for the xcatinfo file, and if not there, it creates one. It will then mount/copy the postscripts, request the node-unique postscript and run the list of postscripts that have been specified.
Updatenode flow:
The updatenode support for running postscripts on AIX uses xdsh to call the "xcataixpost" script on the nodes.
(New support: )
The updatenode command will be modified to support the "-s|--sn" option. This option will cause the the /etc/xcatinfo file on the node to be updated.
For AIX nodes the updatenode command will call the xcataixpost script with either the "-m <servername>" or "-M <servername>" option. The "-M" option will mean to reset the xcatinfo file. It will be used if the updatenode command is called with the "-s" option. The "-m" option will be used otherwise and will provide a backup server name that may be used if the server named in the xcatinfo file is not reachable.
The server name is determined when the process_request part of the updatenode command runs on the MN or SN. It will be the value of the "xcatmaster" attribute in the node definition or, if not set, it will default to the name of the server as known by the node. The name of the server as known by the node will be determined by calling the getFacingIP(<nodename>) routine.