mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
modify postscripts doc
This commit is contained in:
parent
8f0cb07b44
commit
cf7414e0b5
@ -1,5 +0,0 @@
|
||||
Install Additional OS Packages
|
||||
==============================
|
||||
|
||||
Install Additional Other Packages
|
||||
=================================
|
@ -0,0 +1,5 @@
|
||||
Add Additional Software
|
||||
==========================
|
||||
|
||||
|
||||
|
@ -0,0 +1,39 @@
|
||||
Overview
|
||||
---------
|
||||
|
||||
The name of the packages that will be installed on the node are stored in the packages list files. There are two kinds of package list files:
|
||||
|
||||
* The package list file contains the names of the packages that comes from the os distro. They are stored in .pkglist file.
|
||||
* The other package list file contains the names of the packages that do NOT come from the os distro. They are stored in .otherpkgs.pkglist file.
|
||||
|
||||
The path to the package lists will be read from the osimage definition. Which osimage a node is using is specified by the provmethod attribute. To display this value for a node: ::
|
||||
|
||||
lsdef node1 -i provmethod
|
||||
Object name: node
|
||||
provmethod=<osimagename>
|
||||
|
||||
You can display this details of this osimage by running the following command, supplying your osimage name: ::
|
||||
|
||||
lsdef -t osimage <osimagename>
|
||||
Object name: <osimagename>
|
||||
exlist=/opt/xcat/share/xcat/<inst_type>/<os>/<profile>.exlist
|
||||
imagetype=linux
|
||||
osarch=<arch>
|
||||
osname=Linux
|
||||
osvers=<os>
|
||||
otherpkgdir=/install/post/otherpkgs/<os>/<arch>
|
||||
otherpkglist=/install/custom/<inst_type>/<distro>/<profile>.otherpkgs.pkglist
|
||||
pkgdir=/install/<os>/<arch>
|
||||
pkglist=/opt/xcat/share/xcat/<inst_type>/<os>/<profile>.pkglist
|
||||
postinstall=/opt/xcat/share/xcat/<inst_type>/<distro>/<profile>.<os>.<arch>.postinstall
|
||||
profile=<profile>
|
||||
provmethod=<profile>
|
||||
rootimgdir=/install/<inst_type>/<os>/<arch>/<profile>
|
||||
synclists=/install/custom/<inst_type>/<profile>.synclist
|
||||
|
||||
You can set the pkglist and otherpkglist using the following command: ::
|
||||
|
||||
chdef -t osimage <osimagename> pkglist=/opt/xcat/share/xcat/<inst_type>/<distro>/<profile>.pkglist\
|
||||
otherpkglist=/install/custom/<inst_type>/<distro>/my.otherpkgs.pkglist
|
||||
|
||||
|
@ -0,0 +1,168 @@
|
||||
.. _Install-Additional-Other-Packages-label:
|
||||
|
||||
Install Additional Other Packages for Redhat and Sles
|
||||
------------------------------------------------------
|
||||
|
||||
Install Additional Other Packages Steps
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you have additional rpms (rpms **not** in the distro) that you also want installed, make a directory to hold them, create a list of the rpms you want installed, and add that information to the osimage definition:
|
||||
|
||||
* Create a directory to hold the additional rpms: ::
|
||||
|
||||
mkdir -p /install/post/otherpkgs/<distro>/<arch>
|
||||
cd /install/post/otherpkgs/<distro>/<arch>
|
||||
cp /myrpms/* .
|
||||
createrepo .
|
||||
|
||||
* Create a file that lists the additional rpms that should be installed. For example, in **/install/custom/<inst_type>/<distro>/<profile>.otherpkgs.pkglist** put: ::
|
||||
|
||||
myrpm1
|
||||
myrpm2
|
||||
myrpm3
|
||||
|
||||
* Add both the directory and the file to the osimage definition: ::
|
||||
|
||||
chdef -t osimage mycomputeimage otherpkgdir=/install/post/otherpkgs/<os>/<arch> otherpkglist=/install/custom/<inst_type>/<os>/<profile>.otherpkgs.pkglist
|
||||
|
||||
If you add more rpms at a later time, you must run ``createrepo`` again. The ``createrepo`` command is in the createrepo rpm, which for RHEL is in the 1st DVD, but for SLES is in the SDK DVD.
|
||||
|
||||
If you have **multiple sets of rpms** that you want to **keep separate** to keep them organized, you can put them in separate sub-directories in the otherpkgdir. If you do this, you need to do the following extra things, in addition to the steps above:
|
||||
|
||||
* Run createrepo in each sub-directory
|
||||
|
||||
* In your otherpkgs.pkglist, list at least 1 file from each sub-directory. (During installation, xCAT will define a yum or zypper repository for each directory you reference in your otherpkgs.pkglist.) For example: ::
|
||||
|
||||
xcat/xcat-core/xCATsn
|
||||
xcat/xcat-dep/<os>/<arch>/conserver-xcat
|
||||
|
||||
There are some examples of otherpkgs.pkglist in ``/opt/xcat/share/xcat/<inst_type>/<distro>/<profile>.*.otherpkgs.pkglist`` that show the format.
|
||||
|
||||
Note: the otherpkgs postbootscript should by default be associated with every node. Use lsdef to check: ::
|
||||
|
||||
lsdef node1 -i postbootscripts
|
||||
|
||||
If it is not, you need to add it. For example, add it for all of the nodes in the **"compute"** group: ::
|
||||
|
||||
chdef -p -t group compute postbootscripts=otherpkgs
|
||||
|
||||
For the format of the .Otherpkgs file,see :ref:`File-Format-for-otherpkglist-label`
|
||||
|
||||
.. _File-Format-for-otherpkglist-label:
|
||||
|
||||
File Format for .otherpkgs.pkglist File
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The otherpkgs.pklist file can contain the following types of entries: ::
|
||||
|
||||
* rpm name without version numbers
|
||||
* otherpkgs subdirectory plus rpm name
|
||||
* blank lines
|
||||
* comment lines starting with #
|
||||
* #INCLUDE: <full file path># to include other pkglist files
|
||||
* #NEW_INSTALL_LIST# to signify that the following rpms will be installed with a new rpm install command (zypper, yum, or rpm as determined by the function using this file)
|
||||
* #ENV:<variable list># to specify environment variable(s) for a sparate rpm install command
|
||||
* rpms to remove before installing marked with a "-"
|
||||
* rpms to remove after installing marked with a "--"
|
||||
|
||||
These are described in more details in the following sections.
|
||||
|
||||
RPM Names
|
||||
'''''''''
|
||||
|
||||
A simple otherpkgs.pkglist file just contains the the name of the rpm file without the version numbers.
|
||||
|
||||
For example, if you put the following three rpms under **/install/post/otherpkgs/<os>/<arch>/** directory, ::
|
||||
|
||||
rsct.core-2.5.3.1-09120.ppc.rpm
|
||||
rsct.core.utils-2.5.3.1-09118.ppc.rpm
|
||||
src-1.3.0.4-09118.ppc.rpm
|
||||
|
||||
The otherpkgs.pkglist file will be like this: ::
|
||||
|
||||
src
|
||||
rsct.core
|
||||
rsct.core.utils
|
||||
|
||||
RPM Names with otherpkgs Subdirectories
|
||||
''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
If you create a subdirectory under **/install/post/otherpkgs/<os>/<arch>/**, say rsct, the otherpkgs.pkglist file will be like this: ::
|
||||
|
||||
rsct/src
|
||||
rsct/rsct.core
|
||||
rsct/rsct.core.utils
|
||||
|
||||
Include Other pkglist Files
|
||||
''''''''''''''''''''''''''''''
|
||||
|
||||
You can group some rpms in a file and include that file in the otherpkgs.pkglist file using **#INCLUDE:<file>#** format. ::
|
||||
|
||||
rsct/src
|
||||
rsct/rsct.core
|
||||
rsct/rsct.core.utils
|
||||
#INCLUDE:/install/post/otherpkgs/myotherlist#
|
||||
|
||||
where **/install/post/otherpkgs/myotherlist** is another package list file that follows the same format.
|
||||
|
||||
Note the trailing **"#"** character at the end of the line. It is important to specify this character for correct pkglist parsing.
|
||||
|
||||
Multiple Install Lists
|
||||
'''''''''''''''''''''''
|
||||
|
||||
You can specify that separate calls should be made to the rpm install program (**zypper, yum, rpm**) for groups of rpms by specifying the entry **#NEW_INSTALL_LIST#** on a line by itself as a separator in your pkglist file. All rpms listed up to this separator will be installed together. You can have as many separators as you wish in your pkglist file, and each sublist will be installed separately in the order they appear in the file.
|
||||
|
||||
For example: ::
|
||||
|
||||
compilers/vacpp.rte
|
||||
compilers/vac.lib
|
||||
compilers/vacpp.lib
|
||||
compilers/vacpp.rte.lnk
|
||||
#NEW_INSTALL_LIST#
|
||||
pe/IBM_pe_license
|
||||
|
||||
Environment Variable List
|
||||
''''''''''''''''''''''''''
|
||||
|
||||
You can specify environment variable(s) for each rpm install call by entry **"#ENV:<variable list>#"**. The environment variables also apply to rpm(s) remove call if there is rpm(s) needed to be removed in the sublist.
|
||||
|
||||
For example: ::
|
||||
|
||||
#ENV:INUCLIENTS=1 INUBOSTYPE=1#
|
||||
rsct/rsct.core
|
||||
rsct/rsct.core.utils
|
||||
rsct/src
|
||||
|
||||
Be same as, ::
|
||||
|
||||
#ENV:INUCLIENTS=1#
|
||||
#ENV:INUBOSTYPE=1#
|
||||
rsct/rsct.core
|
||||
rsct/rsct.core.utils
|
||||
rsct/src
|
||||
|
||||
Remove RPMs Before Installing
|
||||
''''''''''''''''''''''''''''''
|
||||
|
||||
You can also specify in this file that certain rpms to be removed before installing the new software. This is done by adding '-' before the rpm names you want to remove. For example: ::
|
||||
|
||||
rsct/src
|
||||
rsct/rsct.core
|
||||
rsct/rsct.core.utils
|
||||
#INCLUDE:/install/post/otherpkgs/myotherlist#
|
||||
-perl-doc
|
||||
|
||||
If you have ``#NEW_INSTALL_LIST#`` separators in your pkglist file, the rpms will be removed before the install of the sublist that the ``"-<rpmname>"`` appears in.
|
||||
|
||||
Remove RPMs After Installing
|
||||
'''''''''''''''''''''''''''''
|
||||
|
||||
You can also specify in this file that certain rpms to be removed after installing the new software. This is done by adding ``--`` before the rpm names you want to remove. For example: ::
|
||||
|
||||
pe/IBM_pe_license
|
||||
--ibm-java2-ppc64-jre
|
||||
|
||||
If you have **#NEW_INSTALL_LIST#** separators in your pkglist file, the rpms will be removed after the install of the sublist that the ``"--<rpmname>"`` appears in.
|
||||
|
||||
|
||||
|
@ -0,0 +1,107 @@
|
||||
.. _Install-Additional-OS-Packages-label:
|
||||
|
||||
Install Additional OS Packages for redhat and sles
|
||||
-----------------------------------------------------------
|
||||
|
||||
Install Additional Packages using OS Packages steps
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For rpms from the OS distro, add the new rpm names (without the version number) in the .pkglist file. For example, file **/install/custom/<inst_type>/<os>/<profile>.pkglist** will look like this after adding perl-DBI: ::
|
||||
|
||||
bash
|
||||
nfs-utils
|
||||
openssl
|
||||
dhcpcd
|
||||
kernel-smp
|
||||
openssh
|
||||
procps
|
||||
psmisc
|
||||
resmgr
|
||||
wget
|
||||
rsync
|
||||
timezone
|
||||
perl-DBI
|
||||
|
||||
For the format of the .pkglist file,
|
||||
see :ref:`File-Format-for-pkglist-label`
|
||||
|
||||
If you have newer updates to some of your operating system packages that you would like to apply to your **OS** image, you can place them in another directory, and add that directory to your osimage pkgdir attribute. For example, with the osimage defined above, if you have a new openssl package that you need to update for security fixes, you could place it in a directory, create repository data, and add that directory to your pkgdir: ::
|
||||
|
||||
mkdir -p /install/osupdates/<os>/<arch>
|
||||
cd /install/osupdates/<os>/<arch>
|
||||
cp <your new openssl rpm> .
|
||||
createrepo .
|
||||
chdef -t osimage <os>-<arch>-<inst_type>-<profile> pkgdir=/install/<os>/<arch>,/install/osupdates/<os>/<arch>
|
||||
|
||||
Note:If the objective node is not installed by xCAT,please make sure the correct osimage pkgdir attribute so that you could get the correct repository data.
|
||||
|
||||
.. _File-Format-for-pkglist-label:
|
||||
|
||||
File Format for .ospkgs.pkglist File
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The .pklist file is used to specify the rpm and the group/pattern names from os distro that will be installed on the nodes. It can contain the following types of entries: ::
|
||||
|
||||
* rpm name without version numbers
|
||||
* group/pattern name marked with a '@' (for full install only)
|
||||
* rpms to removed after the installation marked with a "-" (for full install only)
|
||||
|
||||
These are described in more details in the following sections.
|
||||
|
||||
RPM Names
|
||||
''''''''''
|
||||
|
||||
A simple .pkglist file just contains the the name of the rpm file without the version numbers.
|
||||
|
||||
For example ::
|
||||
|
||||
openssl
|
||||
xntp
|
||||
rsync
|
||||
glibc-devel.i686
|
||||
|
||||
Include pkglist Files
|
||||
''''''''''''''''''''''
|
||||
|
||||
The **#INCLUDE** statement is supported in the pkglist file.
|
||||
|
||||
You can group some rpms in a file and include that file in the pkglist file using **#INCLUDE:<file>#** format. ::
|
||||
|
||||
openssl
|
||||
xntp
|
||||
rsync
|
||||
glibc-devel.1686
|
||||
#INCLUDE:/install/post/custom/<distro>/myotherlist#
|
||||
|
||||
where **/install/post/custom/<distro>/myotherlist** is another package list file that follows the same format.
|
||||
|
||||
Note: the trailing **"#"** character at the end of the line. It is important to specify this character for correct pkglist parsing.
|
||||
|
||||
Group/Pattern Names
|
||||
'''''''''''''''''''
|
||||
|
||||
It is only supported for statefull deployment.
|
||||
|
||||
In Linux, a groups of rpms can be packaged together into one package. It is called a group on RedHat, CentOS, Fedora and Scientific Linux. To get the a list of available groups, run
|
||||
|
||||
* **[RHEL]** ::
|
||||
|
||||
yum grouplist
|
||||
|
||||
* **[SLES]** ::
|
||||
|
||||
zypper se -t pattern
|
||||
|
||||
You can specify in this file the group/pattern names by adding a **'@'** and a space before the group/pattern names. For example: ::
|
||||
|
||||
@ base
|
||||
|
||||
Remove RPMs After Installing
|
||||
''''''''''''''''''''''''''''
|
||||
|
||||
It is only supported for statefull deployment.
|
||||
|
||||
You can specify in this file that certain rpms to be removed after installing the new software. This is done by adding **'-'** before the rpm names you want to remove. For example: ::
|
||||
|
||||
-ntp
|
||||
|
@ -1,5 +0,0 @@
|
||||
Using Prescript
|
||||
===============
|
||||
|
||||
Using Postscript
|
||||
================
|
@ -0,0 +1,678 @@
|
||||
.. _Using-Postscript-label:
|
||||
|
||||
Using Postscript
|
||||
----------------
|
||||
|
||||
xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. This explains the xCAT support to do this.
|
||||
|
||||
Types of scripts
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There are two types of scripts in the postscripts table ( postscripts and postbootscripts). The types are based on when in the install process they will be executed. Run the following for more information:
|
||||
|
||||
``man postscripts``
|
||||
|
||||
* **postscripts attribute** - List of scripts that should be run on this node after diskfull installation or diskless boot.
|
||||
|
||||
* **[RHEL]**
|
||||
|
||||
Postscripts will be run before the reboot.
|
||||
|
||||
* **[SLES]**
|
||||
|
||||
Postscripts will be run after the reboot but before the init.d process. For Linux diskless deployment, the postscripts will be run at the init.d time, and xCAT will automatically add the list of postscripts from the postbootscripts attribute to run after postscripts list.
|
||||
|
||||
* **postbootscripts attribute** - list of postbootscripts that should be run on this Linux node at the init.d time after diskfull installation reboot or diskless boot
|
||||
* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a site table attribute runbootscripts is available to change this default behavior. If set to yes, then the postbootscripts will be run on install and on reboot.
|
||||
|
||||
**xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot.**
|
||||
|
||||
Adding your own postscripts
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To add your own script, place it in /install/postscripts on the management node. Make sure it is executable and world readable. Then add it to the postscripts table for the group of nodes you want it to be run on (or the "all" group if you want it run on all nodes in the appropriate attribute, according to when you want it to run).
|
||||
|
||||
To check what scripts will be run on your node during installation: ::
|
||||
|
||||
lsdef node1 | grep scripts
|
||||
postbootscripts=otherpkgs
|
||||
postscripts=syslog,remoteshell,syncfiles
|
||||
|
||||
You can pass parameters to the postscripts. For example: ::
|
||||
|
||||
script1 p1 p2,script2,....
|
||||
|
||||
|
||||
|
||||
p1 p2 are the parameters to script1.
|
||||
|
||||
Postscripts could be placed in the subdirectories in /install/postscripts on management node, and specify "subdir/postscriptname" in the postscripts table to run the postscripts in the subdirectories. This feature could be used to categorize the postscripts for different purposes. Here is an example: ::
|
||||
|
||||
mkdir -p /install/postscripts/subdir1
|
||||
mkdir -p /install/postscripts/subdir2
|
||||
cp postscript1 /install/postscripts/subdir1/
|
||||
cp postscript2 /install/postscripts/subdir2/
|
||||
chdef node1 -p postscripts=subdir1/postscript1,subdir2/postscript2
|
||||
updatenode node1 -P
|
||||
|
||||
If some of your postscripts will affect the network communication between the management node and compute node, like restarting network or configuring bond, the postscripts execution might not be able to be finished successfully because of the network connection problems, even if we put this postscript be the last postscript in the list, xCAT still may not be able to update the node status to be "booted". The recommendation is to use the Linux "at" mechanism to schedule this network-killing postscript to be run at a later time. Here is an example:
|
||||
|
||||
The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node, then we could use "at" to run this nic bonding postscripts after all the postscripts processes have been finished.
|
||||
|
||||
We could write a script, say, /install/postscripts/nicbondscript, the nicbondscript simply calls the confignicsbond using **"at"**: ::
|
||||
|
||||
[root@xcatmn ~]#cat /install/postscripts/nicbondscript
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
at -f ./confignicsbond now + 1 minute
|
||||
|
||||
[root@xcatmn ~]#
|
||||
|
||||
Then ::
|
||||
|
||||
chdef <nodename> -p postbootscripts=nicbondscript
|
||||
|
||||
Recommended Postscript design
|
||||
'''''''''''''''''''''''''''''
|
||||
|
||||
|
||||
* Postscripts that you want to run anywhere, Linux, should be written in shell. This should be available on all OS's. If only on the service nodes, you can use Perl .
|
||||
* Postscripts should log errors using the following command **local4** is the default xCAT syslog class. **logger -t xCAT -p local4.info "your info message**".
|
||||
* Postscripts should have good and error exit codes (i.e 0 and 1).
|
||||
* Postscripts should be well documented. At the top of the script, the first few lines should describe the function and inputs and output. You should have comments throughout the script. This is especially important if using regx.
|
||||
|
||||
PostScript/PostbootScript execution
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When your script is executed on the node, all the attributes in the site table are exported as variables for your scripts to use. You can add extra attributes for yourself. See the sample mypostscript file below.
|
||||
|
||||
To run the postscripts, a script is built, so the above exported variables can be input. You can usually find that script in /xcatpost on the node and for example in the Linux case it is call mypostscript. A good way to debug problems is to go to the node and just run mypostscript and see errors. You can also check the syslog on the Management Node for errors.
|
||||
|
||||
When writing you postscripts, it is good to follow the example of the current postscripts and write errors to syslog and in shell. See Suggestions for writing scripts.
|
||||
|
||||
All attributes in the site table are exported and available to the postscript/postbootscript during execution. See the mypostscript file, which is generated and executed on the nodes to run the postscripts.
|
||||
|
||||
Example of mypostscript ::
|
||||
|
||||
#subroutine used to run postscripts
|
||||
run_ps () {
|
||||
logdir="/var/log/xcat"
|
||||
mkdir -p $logdir
|
||||
logfile="/var/log/xcat/xcat.log"
|
||||
if [_-f_$1_]; then
|
||||
echo "Running postscript: $@" | tee -a $logfile
|
||||
./$@ 2>&1 | tee -a $logfile
|
||||
else
|
||||
echo "Postscript $1 does NOT exist." | tee -a $logfile
|
||||
fi
|
||||
}
|
||||
# subroutine end
|
||||
AUDITSKIPCMDS='tabdump,nodels'
|
||||
export AUDITSKIPCMDS
|
||||
TEST='test'
|
||||
export TEST
|
||||
NAMESERVERS='7.114.8.1'
|
||||
export NAMESERVERS
|
||||
NTPSERVERS='7.113.47.250'
|
||||
export NTPSERVERS
|
||||
INSTALLLOC='/install'
|
||||
export INSTALLLOC
|
||||
DEFSERIALPORT='0'
|
||||
export DEFSERIALPORT
|
||||
DEFSERIALSPEED='19200'
|
||||
export DEFSERIALSPEED
|
||||
DHCPINTERFACES="'xcat20RRmn|eth0;rra000-m|eth1'"
|
||||
export DHCPINTERFACES
|
||||
FORWARDERS='7.113.8.1,7.114.8.2'
|
||||
export FORWARDERS
|
||||
NAMESERVER='7.113.8.1,7.114.47.250'
|
||||
export NAMESERVER
|
||||
DB='postg'
|
||||
export DB
|
||||
BLADEMAXP='64'
|
||||
export BLADEMAXP
|
||||
FSPTIMEOUT='0'
|
||||
export FSPTIMEOUT
|
||||
INSTALLDIR='/install'
|
||||
export INSTALLDIR
|
||||
IPMIMAXP='64'
|
||||
export IPMIMAXP
|
||||
IPMIRETRIES='3'
|
||||
export IPMIRETRIES
|
||||
IPMITIMEOUT='2'
|
||||
export IPMITIMEOUT
|
||||
CONSOLEONDEMAND='no'
|
||||
export CONSOLEONDEMAND
|
||||
SITEMASTER=7.113.47.250
|
||||
export SITEMASTER
|
||||
MASTER=7.113.47.250
|
||||
export MASTER
|
||||
MAXSSH='8'
|
||||
export MAXSSH
|
||||
PPCMAXP='64'
|
||||
export PPCMAXP
|
||||
PPCRETRY='3'
|
||||
export PPCRETRY
|
||||
PPCTIMEOUT='0'
|
||||
export PPCTIMEOUT
|
||||
SHAREDTFTP='1'
|
||||
export SHAREDTFTP
|
||||
SNSYNCFILEDIR='/var/xcat/syncfiles'
|
||||
export SNSYNCFILEDIR
|
||||
TFTPDIR='/tftpboot'
|
||||
export TFTPDIR
|
||||
XCATDPORT='3001'
|
||||
export XCATDPORT
|
||||
XCATIPORT='3002'
|
||||
export XCATIPORT
|
||||
XCATCONFDIR='/etc/xcat'
|
||||
export XCATCONFDIR
|
||||
TIMEZONE='America/New_York'
|
||||
export TIMEZONE
|
||||
USENMAPFROMMN='no'
|
||||
export USENMAPFROMMN
|
||||
DOMAIN='cluster.net'
|
||||
export DOMAIN
|
||||
USESSHONAIX='no'
|
||||
export USESSHONAIX
|
||||
NODE=rra000-m
|
||||
export NODE
|
||||
NFSSERVER=7.113.47.250
|
||||
export NFSSERVER
|
||||
INSTALLNIC=eth0
|
||||
export INSTALLNIC
|
||||
PRIMARYNIC=eth1
|
||||
OSVER=fedora9
|
||||
export OSVER
|
||||
ARCH=x86_64
|
||||
export ARCH
|
||||
PROFILE=service
|
||||
export PROFILE
|
||||
PATH=`dirname $0`:$PATH
|
||||
export PATH
|
||||
NODESETSTATE='netboot'
|
||||
export NODESETSTATE
|
||||
UPDATENODE=1
|
||||
export UPDATENODE
|
||||
NTYPE=service
|
||||
export NTYPE
|
||||
MACADDRESS='00:14:5E:5B:51:FA'
|
||||
export MACADDRESS
|
||||
MONSERVER=7.113.47.250
|
||||
export MONSERVER
|
||||
MONMASTER=7.113.47.250
|
||||
export MONMASTER
|
||||
OSPKGS=bash,openssl,dhclient,kernel,openssh-server,openssh-clients,busybox-anaconda,vim-
|
||||
minimal,rpm,bind,bind-utils,ksh,nfs-utils,dhcp,bzip2,rootfiles,vixie-cron,wget,vsftpd,ntp,rsync
|
||||
OTHERPKGS1=xCATsn,xCAT-rmc,rsct/rsct.core,rsct/rsct.core.utils,rsct/src,yaboot-xcat
|
||||
export OTHERPKGS1
|
||||
OTHERPKGS_INDEX=1
|
||||
export OTHERPKGS_INDEX
|
||||
export NOSYNCFILES
|
||||
# postscripts-start-here\n
|
||||
run_ps ospkgs
|
||||
run_ps script1 p1 p2
|
||||
run_ps script2
|
||||
# postscripts-end-here\n
|
||||
|
||||
The mypostscript file is generated according to the mypostscript.tmpl file.
|
||||
|
||||
Using the mypostscript template
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Using the mypostscript template
|
||||
'''''''''''''''''''''''''''''''
|
||||
|
||||
xCAT provides a way for the admin to customize the information that will be provide to the postscripts/postbootscripts when they run on the node. This is done by editing the mypostscript.tmpl file. The attributes that are provided in the shipped mypostscript.tmpl file should not be removed. They are needed by the default xCAT postscripts.
|
||||
|
||||
The mypostscript.tmpl, is shipped in the /opt/xcat/share/xcat/templates/mypostscript directory.
|
||||
|
||||
If the admin customizes the mypostscript.tmpl, they should copy the mypostscript.tmpl to /install/postscripts/mypostscript.tmpl, and then edit it. The mypostscript for each node will be named mypostscript.<nodename>. The generated mypostscript.<nodename>. will be put in the /tftpboot/mypostscripts directory.
|
||||
|
||||
site table precreatemypostscripts attribute
|
||||
'''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
If the site table precreatemypostscripts attribute is set to 1 or yes, it will instruct xcat at nodeset and updatenode time to query the db once for all of the nodes passed into the command and create the mypostscript file for each node and put them in a directory in $TFTPDIR(for example /tftpboot). The created mypostscript.<nodename>. file in the /tftpboot/mypostscripts directory will not be regenerated unless another nodeset or updatenode command is run to that node. This should be used when the system definition has stabilized. It saves time on the updatenode or reboot by not regenerating the mypostscript file.
|
||||
|
||||
If the precreatemyposcripts attribute is yes, and a database change is made or xcat code is upgraded, then you should run a new nodeset or updatenode to regenerate the /tftpboot/mypostscript/mypostscript.<nodename>. file to pick up the latest database setting. The default for precreatemypostscripts is no/0.
|
||||
|
||||
When you run nodeset or updatenode, it will search the **/install/postscripts/mypostscript.tmpl** first. If the **/install/postscripts/mypostscript.tmpl** exists, it will use that template to generate the mypostscript for each node. Otherwise, it will use **/opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl**.
|
||||
|
||||
|
||||
Content of the template for mypostscript
|
||||
''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
**The attributes that are defined in the shipped mypostscript.tmpl file** should not be removed. The xCAT default postscripts rely on that information to run successfully. **The following will explain the entries in the mypostscript.tmpl file**.
|
||||
|
||||
The SITE_TABLE_ALL_ATTRIBS_EXPORT line in the file directs the code to export all attributes defined in the site table. Note the attributes are not always defined exactly as in the site table to avoid conflict with other table attributes of the same name. For example, the site table master attribute is named SITEMASTER in the generated mypostscript file. ::
|
||||
|
||||
#SITE_TABLE_ALL_ATTRIBS_EXPORT#
|
||||
|
||||
The following line exports ENABLESSHBETWEENNODES by running the internal xCAT routine (enablesshbetweennodes). ::
|
||||
|
||||
ENABLESSHBETWEENNODES=#Subroutine:xCAT::Template::enablesshbetweennodes:$NODE#
|
||||
export ENABLESSHBETWEENNODES
|
||||
|
||||
**tabdump(<TABLENAME>)** is used to get all the information in the **<TABLENAME>** table ::
|
||||
|
||||
tabdump(networks)
|
||||
|
||||
These line export the node name based on its definition in the database. ::
|
||||
|
||||
NODE=$NODE
|
||||
export NODE
|
||||
|
||||
These lines get a comma separated list of the groups to which the node belongs. ::
|
||||
|
||||
GROUP=#TABLE:nodelist:$NODE:groups#
|
||||
export GROUP
|
||||
|
||||
These lines reads the nodesres table, the given attributes (nfsserver,installnic,primarynic,xcatmaster,routenames) for the node **($NODE)**, and exports it. ::
|
||||
|
||||
NFSSERVER=#TABLE:noderes:$NODE:nfsserver#
|
||||
export NFSSERVER
|
||||
INSTALLNIC=#TABLE:noderes:$NODE:installnic#
|
||||
export INSTALLNIC
|
||||
PRIMARYNIC=#TABLE:noderes:$NODE:primarynic#
|
||||
export PRIMARYNIC
|
||||
MASTER=#TABLE:noderes:$NODE:xcatmaster#
|
||||
export MASTER
|
||||
NODEROUTENAMES=#TABLE:noderes:$NODE:routenames#
|
||||
export NODEROUTENAMES
|
||||
|
||||
The following entry exports multiple variables from the routes table. Not always set. ::
|
||||
|
||||
#ROUTES_VARS_EXPORT#
|
||||
|
||||
The following lines export nodetype table attributes. ::
|
||||
|
||||
OSVER=#TABLE:nodetype:$NODE:os#
|
||||
export OSVER
|
||||
ARCH=#TABLE:nodetype:$NODE:arch#
|
||||
export ARCH
|
||||
PROFILE=#TABLE:nodetype:$NODE:profile#
|
||||
export PROFILE
|
||||
PROVMETHOD=#TABLE:nodetype:$NODE:provmethod#
|
||||
export PROVMETHOD
|
||||
|
||||
The following adds the current directory to the path for the postscripts. ::
|
||||
|
||||
PATH=`dirname $0`:$PATH
|
||||
export PATH
|
||||
|
||||
The following sets the NODESETSTATE by running the internal xCAT getnodesetstate script. ::
|
||||
|
||||
NODESETSTATE=#Subroutine:xCAT::Postage::getnodesetstate:$NODE#
|
||||
export NODESETSTATE
|
||||
|
||||
The following says the postscripts are not being run as a result of updatenode.(This is changed =1, when updatenode runs). ::
|
||||
|
||||
UPDATENODE=0
|
||||
export UPDATENODE
|
||||
|
||||
The following sets the NTYPE to compute,service or MN. ::
|
||||
|
||||
NTYPE=$NTYPE
|
||||
export NTYPE
|
||||
|
||||
The following sets the mac address. ::
|
||||
|
||||
MACADDRESS=#TABLE:mac:$NODE:mac#
|
||||
export MACADDRESS
|
||||
|
||||
IF vlan is setup, then the #VLAN_VARS_EXPORT# line will provide the following exports: ::
|
||||
|
||||
VMNODE='YES'
|
||||
export VMNODE
|
||||
VLANID=vlan1...
|
||||
export VLANID
|
||||
VLANHOSTNAME=..
|
||||
..
|
||||
#VLAN_VARS_EXPORT#
|
||||
|
||||
If monitoring is setup, then the #MONITORING_VARS_EXPORT# line will provide: ::
|
||||
|
||||
MONSERVER=11.10.34.108
|
||||
export MONSERVER
|
||||
MONMASTER=11.10.34.108
|
||||
export MONMASTER
|
||||
#MONITORING_VARS_EXPORT#
|
||||
|
||||
The OSIMAGE_VARS_EXPORT# line will provide, for example: ::
|
||||
|
||||
OSPKGDIR=/install/<os>/<arch>
|
||||
export OSPKGDIR
|
||||
OSPKGS='bash,nfs-utils,openssl,dhclient,kernel,openssh-server,openssh-clients,busybox,wget,rsyslog,dash,vim-minimal,ntp,rsyslog,rpm,rsync,
|
||||
ppc64-utils,iputils,dracut,dracut-network,e2fsprogs,bc,lsvpd,irqbalance,procps,yum'
|
||||
export OSPKGS
|
||||
|
||||
#OSIMAGE_VARS_EXPORT#
|
||||
|
||||
THE NETWORK_FOR_DISKLESS_EXPORT# line will provide diskless networks information, if defined. ::
|
||||
|
||||
NETMASK=255.255.255.0
|
||||
export NETMASK
|
||||
GATEWAY=8.112.34.108
|
||||
export GATEWAY
|
||||
..
|
||||
#NETWORK_FOR_DISKLESS_EXPORT#
|
||||
|
||||
Note: the **#INCLUDE_POSTSCRIPTS_LIST#** and the **#INCLUDE_POSTBOOTSCRIPTS_LIST#** sections in **/tftpboot/mypostscript(mypostbootscripts)** on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an **updatenode** command for only some of the scripts , you will see in the **/xcatpost/mypostscript** file on the node, the list has been redefined during the execution of updatenode to only run the requested scripts. For example, if you run **updatenode <nodename> -P** syslog.
|
||||
|
||||
The **#INCLUDE_POSTSCRIPTS_LIST#** flag provides a list of postscripts defined for this **$NODE**. ::
|
||||
|
||||
#INCLUDE_POSTSCRIPTS_LIST#
|
||||
|
||||
For example, you will see in the generated file the following stanzas: ::
|
||||
|
||||
# postscripts-start-here
|
||||
# defaults-postscripts-start-here
|
||||
syslog
|
||||
remoteshell
|
||||
# defaults-postscripts-end-here
|
||||
# node-postscripts-start-here
|
||||
syncfiles
|
||||
# node-postscripts-end-here
|
||||
|
||||
The **#INCLUDE_POSTBOOTSCRIPTS_LIST#** provides a list of postbootscripts defined for this **$NODE**. ::
|
||||
|
||||
#INCLUDE_POSTBOOTSCRIPTS_LIST#
|
||||
|
||||
For example, you will see in the generated file the following stanzas: ::
|
||||
|
||||
# postbootscripts-start-here
|
||||
# defaults-postbootscripts-start-here
|
||||
otherpkgs
|
||||
# defaults-postbootscripts-end-here
|
||||
# node-postbootscripts-end-here
|
||||
# postbootscripts-end-here
|
||||
|
||||
Kinds of variables in the template
|
||||
'''''''''''''''''''''''''''''''''''
|
||||
|
||||
**Type 1:** For the simple variable, the syntax is as follows. The mypostscript.tmpl has several examples of this. **$NODE** is filled in by the code. **UPDATENODE** is changed to 1, when the postscripts are run by ``updatenode``. **$NTYPE** is filled in as either compute,service or MN. ::
|
||||
|
||||
NODE=$NODE
|
||||
export NODE
|
||||
UPDATENODE=0
|
||||
export UPDATENODE
|
||||
NTYPE=$NTYPE
|
||||
export NTYPE
|
||||
|
||||
**Type 2:** This is the syntax to get the value of one attribute from the **<tablename>** and its key is **$NODE**. It does not support tables with 2 keys. Some of the tables with two keys are **(litefile,prodkey,deps,monsetting,mpa,networks)**. ::
|
||||
|
||||
VARNAME=#TABLE:tablename:$NODE:attribute#
|
||||
|
||||
For example, to get the new updatstatus attribute from the nodelist table: ::
|
||||
|
||||
UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus#
|
||||
export UPDATESTATUS
|
||||
|
||||
**Type 3:** The syntax is as follows: ::
|
||||
|
||||
VARNAME=#Subroutine:modulename::subroutinename:$NODE#
|
||||
or
|
||||
VARNAME=#Subroutine:modulename::subroutinename#
|
||||
|
||||
Examples in the mypostscript.tmpl are the following: ::
|
||||
|
||||
NODESETSTATE=#Subroutine:xCAT::Postage::getnodesetstate:$NODE#
|
||||
export NODESETSTATE
|
||||
ENABLESSHBETWEENNODES=#Subroutine:xCAT::Template::enablesshbetweennodes:$NODE#
|
||||
export ENABLESSHBETWEENNODES
|
||||
|
||||
Note: Type 3 is not an open interface to add extensions to the template.
|
||||
|
||||
**Type 4:** The syntax is #FLAG#. When parsing the template, the code generates all entries defined by **#FLAG#**, if they are defined in the database. For example: To export all values of all attributes from the site table. The tag is ::
|
||||
|
||||
#SITE_TABLE_ALL_ATTRIBS_EXPORT#
|
||||
|
||||
For the **#SITE_TABLE_ALL_ATTRIBS_EXPORT#** flag, the related subroutine will get the attributes' values and deal with the special case. such as : the site.master should be exported as **"SITEMASTER"**. And if the noderes.xcatmaster exists, the noderes.xcatmaster should be exported as **"MASTER"**, otherwise, we also should export site.master as the **"MASTER"**.
|
||||
|
||||
Other examples are: ::
|
||||
|
||||
#VLAN_VARS_EXPORT# - gets all vlan related itesm
|
||||
#MONITORING_VARS_EXPORT# - gets all monitoring configuration and setup da ta
|
||||
#OSIMAGE_VARS_EXPORT# - get osimage related variables, such as ospkgdir, ospkgs ...
|
||||
#NETWORK_FOR_DISKLESS_EXPORT# - gets diskless network information
|
||||
#INCLUDE_POSTSCRIPTS_LIST# - includes the list of all postscripts for the node
|
||||
#INCLUDE_POSTBOOTSCRIPTS_LIST# - includes the list of all postbootscripts for the node
|
||||
|
||||
Note: Type4 is not an open interface to add extensions to the templatel.
|
||||
|
||||
**Type 5:** Get all the data from the specified table. The **<TABLENAME>** should not be a node table, like nodelist. This should be handles with TYPE 2 syntax to get specific attributes for the **$NODE**. tabdump would result in too much data for a nodetype table. Also the auditlog, eventlog should not be in tabdump for the same reason. site table should not be specified, it is already provided with the **#SITE_TABLE_ALL_ATTRIBS_EXPORT#** flag. It can be used to get the data from the two key tables (like switch). ::
|
||||
|
||||
The syntax is:
|
||||
|
||||
tabdump(<TABLENAME>)
|
||||
|
||||
Edit mypostscript.tmpl
|
||||
'''''''''''''''''''''''
|
||||
|
||||
**Add new attribute into mypostscript.tmpl**
|
||||
|
||||
When you add new attributes into the template, you should edit the **/install/postscripts/mypostscript.tmpl** which you created by copying **/opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl**. Make all additions before the **# postscripts-start-here** section. xCAT will first look in **/install/mypostscript.tmpl** for a file and then if not found will use the one in **/opt/xcat/share/xcat/templates/mypostcript/mypostscript.tmpl**.
|
||||
|
||||
For example: ::
|
||||
|
||||
UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus#
|
||||
export UPDATESTATUS
|
||||
...
|
||||
# postscripts-start-here
|
||||
#INCLUDE_POSTSCRIPTS_LIST#
|
||||
## The following flag postscripts-end-here must not be deleted.
|
||||
# postscripts-end-here
|
||||
|
||||
Note: If you have a hierarchical cluster, you must copy your new mypostscript.tmpl to **/install/postscripts/mypostscript.tmpl** on the service nodes, unless **/install/postscripts** directory is mounted from the MN to the service node.
|
||||
|
||||
**Remove attribute from mypostscript.tmpl**
|
||||
|
||||
If you want to remove an attribute that you have added, you should remove all the related lines or comment them out with ##. For example, comment out the added lines. ::
|
||||
|
||||
##UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus#
|
||||
##export UPDATESTATUS
|
||||
|
||||
Test the new template
|
||||
''''''''''''''''''''''
|
||||
|
||||
There are two quick ways to test the template.
|
||||
|
||||
#.
|
||||
If the node is up: ::
|
||||
|
||||
updatenode <nodename> -P syslog
|
||||
|
||||
Check your generated template : ::
|
||||
|
||||
Check the generated mypostscript file on compute node /xcatpost.
|
||||
|
||||
#.
|
||||
Another way, is set the precreate option ::
|
||||
|
||||
chdef -t site -o clustersite precreatemypostscripts=1
|
||||
|
||||
Then run ::
|
||||
|
||||
nodeset <nodename> ....
|
||||
|
||||
Check your generated template ::
|
||||
|
||||
vi /tftpboot/mypostscripts/mypostscript.<nodename>
|
||||
|
||||
Sample /xcatpost/mypostscript
|
||||
'''''''''''''''''''''''''''''''
|
||||
|
||||
This is an example of the generated postscript for a servicenode install. It is found in /xcatpost/mypostscript on the node. ::
|
||||
|
||||
# global value to store the running status of the postbootscripts,the value
|
||||
#is non-zero if one postbootscript failed
|
||||
return_value=0
|
||||
# subroutine used to run postscripts
|
||||
run_ps () {
|
||||
local ret_local=0
|
||||
logdir="/var/log/xcat"
|
||||
mkdir -p $logdir
|
||||
logfile="/var/log/xcat/xcat.log"
|
||||
if [ -f $1 ]; then
|
||||
echo "`date` Running postscript: $@" | tee -a $logfile
|
||||
#./$@ 2>&1 1> /tmp/tmp4xcatlog
|
||||
#cat /tmp/tmp4xcatlog | tee -a $logfile
|
||||
./$@ 2>&1 | tee -a $logfile
|
||||
ret_local=${PIPESTATUS[0]}
|
||||
if [ "$ret_local" -ne "0" ]; then
|
||||
return_value=$ret_local
|
||||
fi
|
||||
echo "Postscript: $@ exited with code $ret_local"
|
||||
else
|
||||
echo "`date` Postscript $1 does NOT exist." | tee -a $logfile
|
||||
return_value=-1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
# subroutine end
|
||||
SHAREDTFTP='1'
|
||||
export SHAREDTFTP
|
||||
TFTPDIR='/tftpboot'
|
||||
export TFTPDIR
|
||||
CONSOLEONDEMAND='yes'
|
||||
export CONSOLEONDEMAND
|
||||
PPCTIMEOUT='300'
|
||||
export PPCTIMEOUT
|
||||
VSFTP='y'
|
||||
export VSFTP
|
||||
DOMAIN='cluster.com'
|
||||
export DOMAIN
|
||||
XCATIPORT='3002'
|
||||
export XCATIPORT
|
||||
DHCPINTERFACES="'xcatmn2|eth1;service|eth1'"
|
||||
export DHCPINTERFACES
|
||||
MAXSSH='10'
|
||||
export MAXSSH
|
||||
SITEMASTER=10.2.0.100
|
||||
export SITEMASTER
|
||||
TIMEZONE='America/New_York'
|
||||
export TIMEZONE
|
||||
INSTALLDIR='/install'
|
||||
export INSTALLDIR
|
||||
NTPSERVERS='xcatmn2'
|
||||
export NTPSERVERS
|
||||
EA_PRIMARY_HMC='c76v2hmc01'
|
||||
export EA_PRIMARY_HMC
|
||||
NAMESERVERS='10.2.0.100'
|
||||
export NAMESERVERS
|
||||
SNSYNCFILEDIR='/var/xcat/syncfiles'
|
||||
export SNSYNCFILEDIR
|
||||
DISJOINTDHCPS='0'
|
||||
export DISJOINTDHCPS
|
||||
FORWARDERS='8.112.8.1,8.112.8.2'
|
||||
export FORWARDERS
|
||||
VLANNETS='|(\d+)|10.10.($1+0).0|'
|
||||
export VLANNETS
|
||||
XCATDPORT='3001'
|
||||
export XCATDPORT
|
||||
USENMAPFROMMN='no'
|
||||
export USENMAPFROMMN
|
||||
DNSHANDLER='ddns'
|
||||
export DNSHANDLER
|
||||
ROUTENAMES='r1,r2'
|
||||
export ROUTENAMES
|
||||
INSTALLLOC='/install'
|
||||
export INSTALLLOC
|
||||
ENABLESSHBETWEENNODES=YES
|
||||
export ENABLESSHBETWEENNODES
|
||||
NETWORKS_LINES=4
|
||||
export NETWORKS_LINES
|
||||
NETWORKS_LINE1='netname=public_net||net=8.112.154.64||mask=255.255.255.192||mgtifname=eth0||gateway=8.112.154.126||dhcpserver=||tftpserver=8.112.154.69||nameservers=8.112.8.1||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='
|
||||
export NETWORKS_LINE2
|
||||
NETWORKS_LINE3='netname=sn21_net||net=10.2.1.0||mask=255.255.255.0||mgtifname=eth1||gateway=<xcatmaster>||dhcpserver=||tftpserver=||nameservers=10.2.1.100,10.2.1.101||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='
|
||||
export NETWORKS_LINE3
|
||||
NETWORKS_LINE4='netname=sn22_net||net=10.2.2.0||mask=255.255.255.0||mgtifname=eth1||gateway=10.2.2.100||dhcpserver=10.2.2.100||tftpserver=10.2.2.100||nameservers=10.2.2.100||ntpservers=||logservers=||dynamicrange=10.2.2.120-10.2.2.250||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='
|
||||
export NETWORKS_LINE4
|
||||
NODE=xcatsn23
|
||||
export NODE
|
||||
NFSSERVER=10.2.0.100
|
||||
export NFSSERVER
|
||||
INSTALLNIC=eth0
|
||||
export INSTALLNIC
|
||||
PRIMARYNIC=eth0
|
||||
export PRIMARYNIC
|
||||
MASTER=10.2.0.100
|
||||
export MASTER
|
||||
OSVER=sles11
|
||||
export OSVER
|
||||
ARCH=ppc64
|
||||
export ARCH
|
||||
PROFILE=service-xcattest
|
||||
export PROFILE
|
||||
PROVMETHOD=netboot
|
||||
export PROVMETHOD
|
||||
PATH=`dirname $0`:$PATH
|
||||
export PATH
|
||||
NODESETSTATE=netboot
|
||||
export NODESETSTATE
|
||||
UPDATENODE=1
|
||||
export UPDATENODE
|
||||
NTYPE=service
|
||||
export NTYPE
|
||||
MACADDRESS=16:3d:05:fa:4a:02
|
||||
export MACADDRESS
|
||||
NODEID=EA163d05fa4a02EA
|
||||
export NODEID
|
||||
MONSERVER=8.112.154.69
|
||||
export MONSERVER
|
||||
MONMASTER=10.2.0.100
|
||||
export MONMASTER
|
||||
MS_NODEID=0360238fe61815e6
|
||||
export MS_NODEID
|
||||
OSPKGS='kernel-ppc64,udev,sysconfig,aaa_base,klogd,device-mapper,bash,openssl,nfs- utils,ksh,syslog-ng,openssh,openssh-askpass,busybox,vim,rpm,bind,bind-utils,dhcp,dhcpcd,dhcp-server,dhcp-client,dhcp-relay,bzip2,cron,wget,vsftpd,util-linux,module-init-tools,mkinitrd,apache2,apache2-prefork,perl-Bootloader,psmisc,procps,dbus-1,hal,timezone,rsync,powerpc-utils,bc,iputils,uuid-runtime,unixODBC,gcc,zypper,tar'
|
||||
export OSPKGS
|
||||
OTHERPKGS1='xcat/xcat-core/xCAT-rmc,xcat/xcat-core/xCATsn,xcat/xcat-dep/sles11/ppc64/conserver,perl-DBD-mysql,nagios/nagios-nsca-client,nagios/nagios,nagios/nagios-plugins-nrpe,nagios/nagios-nrpe'
|
||||
export OTHERPKGS1
|
||||
OTHERPKGS_INDEX=1
|
||||
export OTHERPKGS_INDEX
|
||||
## get the diskless networks information. There may be no information.
|
||||
NETMASK=255.255.255.0
|
||||
export NETMASK
|
||||
GATEWAY=10.2.0.100
|
||||
export GATEWAY
|
||||
# NIC related attributes for the node for confignics postscript
|
||||
NICIPS=""
|
||||
export NICIPS
|
||||
NICHOSTNAMESUFFIXES=""
|
||||
export NICHOSTNAMESUFFIXES
|
||||
NICTYPES=""
|
||||
export NICTYPES
|
||||
NICCUSTOMSCRIPTS=""
|
||||
export NICCUSTOMSCRIPTS
|
||||
NICNETWORKS=""
|
||||
export NICNETWORKS
|
||||
NICCOMMENTS=
|
||||
export NICCOMMENTS
|
||||
# postscripts-start-here
|
||||
# defaults-postscripts-start-here
|
||||
run_ps test1
|
||||
run_ps syslog
|
||||
run_ps remoteshell
|
||||
run_ps syncfiles
|
||||
run_ps confNagios
|
||||
run_ps configrmcnode
|
||||
# defaults-postscripts-end-here
|
||||
# node-postscripts-start-here
|
||||
run_ps servicenode
|
||||
run_ps configeth_new
|
||||
# node-postscripts-end-here
|
||||
run_ps setbootfromnet
|
||||
# postscripts-end-here
|
||||
# postbootscripts-start-here
|
||||
# defaults-postbootscripts-start-here
|
||||
run_ps otherpkgs
|
||||
# defaults-postbootscripts-end-here
|
||||
# node-postbootscripts-start-here
|
||||
run_ps test
|
||||
# The following line node-postbootscripts-end-here must not be deleted.
|
||||
# node-postbootscripts-end-here
|
||||
# postbootscripts-end-here
|
||||
exit $return_value
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
Postscripts and Prescripts
|
||||
==========================
|
||||
|
||||
|
||||
|
@ -0,0 +1,73 @@
|
||||
.. _Using-Prescript-label:
|
||||
|
||||
Using Prescript
|
||||
---------------
|
||||
|
||||
The prescript table will allow you to run scripts before the install process. This can be helpful for performing advanced actions such as manipulating system services or configurations before beginning to install a node, or to prepare application servers for the addition of new nodes. Check the man page for more information.
|
||||
|
||||
``man prescripts``
|
||||
|
||||
The scripts will be run as root on the MASTER for the node. If there is a service node for the node, then the scripts will be run on the service node.
|
||||
|
||||
Identify the scripts to be run for each node by adding entries to the prescripts table: ::
|
||||
|
||||
tabedit prescripts
|
||||
Or:
|
||||
chdef -t node -o <noderange> prescripts-begin=<beginscripts> prescripts-end=<endscripts>
|
||||
Or:
|
||||
chdef -t group -o <nodegroup> prescripts-begin=<beginscripts> prescripts-end=<endscripts>
|
||||
|
||||
tabdump prescripts
|
||||
#node,begin,end,comments,disable
|
||||
|
||||
begin or prescripts-begin - This attribute lists the scripts to be run at the beginning of the nodeset.
|
||||
end or prescripts-end - This attribute lists the scripts to be run at the end of the nodeset.
|
||||
|
||||
Format for naming prescripts
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The general format for the prescripts-begin or prescripts-end attribute is: ::
|
||||
|
||||
[action1:]s1,s2...[|action2:s3,s4,s5...]
|
||||
|
||||
where:
|
||||
|
||||
- action1 and action2 are the nodeset actions ( 'install', 'netboot',etc) specified in the command .
|
||||
|
||||
- s1 and s2 are the scripts to run for _action1_ in order.
|
||||
|
||||
- s3, s4, and s5 are the scripts to run for action2.
|
||||
|
||||
If actions are omitted, the scripts apply to all actions.
|
||||
|
||||
Examples:
|
||||
|
||||
* myscript1,myscript2 - run scripts for all supported commands
|
||||
* install:myscript1,myscript2|netboot:myscript3
|
||||
|
||||
Run scripts 1,2 for nodeset(install), runs script3 for nodeset(netboot).
|
||||
|
||||
All the scripts should be copied to /install/prescripts directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local /install directory (i.e. /install is not mounted from the xCAT management node to the service nodes), you will need to synchronize your /install/prescripts directory to your service node anytime you create new scripts or make changes to existing scripts.
|
||||
|
||||
The following two environment variables will be passed to each script:
|
||||
|
||||
* NODES - a comma separated list of node names on which to run the script
|
||||
* ACTION - current nodeset action.
|
||||
|
||||
By default, the script will be invoked once for all nodes. However, if **'#xCAT setting:MAX_INSTANCE=number'** is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in **number** will be invoked at at a time.
|
||||
|
||||
Exit values for prescripts
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If there is no error, a prescript should return with 0. If an error occurs, it should put the error message on the stdout and exit with 1 or any non zero values. The command (nodeset for example) that runs prescripts can be divided into 3 sections.
|
||||
|
||||
#. run begin prescripts
|
||||
#. run other code
|
||||
#. run end prescripts
|
||||
|
||||
If one of the prescripts returns 1, the command will finish the rest of the prescripts in that section and then exit out with value 1. For example, a node has three begin prescripts s1,s2 and s3, three end prescripts s4,s5,s6. If s2 returns 1, the prescript s3 will be executed, but other code and the end prescripts will not be executed by the command.
|
||||
|
||||
If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have **'#xCAT setting:MAX_INSTANCE=number'**.
|
||||
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
Suggestions
|
||||
------------
|
||||
|
||||
For writing scripts
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Some compute node profiles exclude perl to keep the image as small as possible. If this is your case, your postscripts should obviously be written in another shell language, e.g. **bash,ksh**.
|
||||
* If a postscript is specific for an os, name your postscript mypostscript.osname.
|
||||
* Add logger statements to send errors back to the Management Node. By default, xCAT configures the syslog service on compute nodes to forward all syslog messages to the Management Node. This will help debug.
|
||||
|
||||
Using Hierarchical Clusters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you are running a hierarchical cluster, one with Service Nodes. If your /install/postscripts directory is not mounted on the Service Node. You are going to need to sync or copy the postscripts that you added or changed in the **/install/postscripts** on the MN to the SN, before running them on the compute nodes. To do this easily, use the ``xdcp`` command and just copy the entire **/install/postscripts** directory to the servicenodes ( usually in /xcatpost ). ::
|
||||
|
||||
xdcp service -R /install/postscripts/* /xcatpost
|
||||
or
|
||||
prsync /install/postscripts service:/xcatpost
|
||||
|
||||
If your **/install/postscripts** is not mounted on the Service Node, you should also: ::
|
||||
|
||||
xdcp service -R /install/postscripts/* /install
|
||||
or
|
||||
prsync /install/postscripts service:/install
|
@ -1,2 +1,5 @@
|
||||
.. _Sync-Files-label:
|
||||
|
||||
Sync Files to Compute Node
|
||||
==========================
|
||||
|
@ -0,0 +1,12 @@
|
||||
Run the Sync'ing File action in the creating diskless image process
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Different approaches are used to create the diskless image. The **Sync'ing** File action is also different.
|
||||
|
||||
The ``packimage`` command is used to prepare the root image files and package the root image. The Syncing File action is performed here.
|
||||
|
||||
Steps to make the Sync'ing File working in the packimage command:
|
||||
|
||||
1. Prepare the synclist file and put it into the appropriate location as describe above in (refer :ref:`the_localtion_of_synclist_file_for_updatenode_label`)
|
||||
2. Run packimage as is normally done.
|
||||
|
@ -0,0 +1,47 @@
|
||||
Synchronizing Files during the installation process
|
||||
----------------------------------------------------
|
||||
|
||||
The policy table must have the entry to allow syncfiles postscript to access the Management Node. Make sure this entry is in your table:
|
||||
|
||||
``tabdump policy`` ::
|
||||
|
||||
#priority,name,host,commands,noderange,parameters,time,rule,comments,disable
|
||||
.
|
||||
.
|
||||
"4.6",,,"syncfiles",,,,"allow",,
|
||||
.
|
||||
.
|
||||
|
||||
Hierarchy and Service Nodes
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes (compute) that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1. Note: the noderange is the compute node names, updatenode will figure out which service nodes need updating.
|
||||
|
||||
``updatenode compute -f``
|
||||
|
||||
Diskfull installation
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
The 'syncfiles' postscript is in the defaults section of the postscripts table. To enable the syn files postscript to sync files to the nodes during install the user need to do the following:
|
||||
|
||||
* Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label` )
|
||||
* Put the synclist into the proper location for the node type (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`)
|
||||
|
||||
Make sure your postscripts table has the syncfiles postscript listed
|
||||
|
||||
``tabdump postscripts`` ::
|
||||
|
||||
#node,postscripts,postbootscripts,comments,disable
|
||||
"xcatdefaults","syslog,remoteshell,syncfiles","otherpkgs",,
|
||||
|
||||
Diskless Installation
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The diskless boot is similar with the diskfull installation for the synchronizing files operation, except that the packimage commands will sync files to the root directories of image during the creating image process.
|
||||
|
||||
Creating the synclist file as the steps in Diskfull installation section, then the synced files will be synced to the os image during the packimage and mkdsklsnode commands running.
|
||||
|
||||
Also the files will always be re-synced during the booting up of the diskless node.
|
||||
|
@ -0,0 +1,24 @@
|
||||
Overview
|
||||
--------
|
||||
|
||||
Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes.
|
||||
|
||||
This function is supported for diskfull or RAMdisk-based diskless nodes.Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**.
|
||||
|
||||
The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage.
|
||||
|
||||
``xdcp`` command supplies the basic Syncing File function. If the **'-F synclist'** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **'-i PATH'** option is specified with **'-F synclist'**, it syncs files to the root image located in the PATH directory. (**Note: the '-i PATH' option is only supported for Linux nodes**)
|
||||
|
||||
``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are place in an intermediate directory on the service node defined by the SNsyncfiledir attribute in the site table. The default is **/var/xcat/syncfiles**.
|
||||
|
||||
Since ``updatenode -F`` calls the ``xdcp`` to handle the Syncing File function, the ``updatenode -F`` also supports the hierarchy.
|
||||
|
||||
For a new-installing nodes, the Syncing File action will be triggered when performing the postscripts for the nodes. A special postscript named **'syncfiles'** is used to initiate the Syncing File process.
|
||||
|
||||
The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node.
|
||||
|
||||
**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes.You can use the** ``updatenode <computenodes> -f`` **command to sync all the service nodes for range of compute nodes provided.**
|
||||
|
||||
For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes.
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
Run the Syncing File action periodically
|
||||
-----------------------------------------
|
||||
|
||||
If the admins want to run the Syncing File action automatically or periodically, the ``xdcp -F``, ``xdcp -i -F`` and ``updatenode -F`` commands can be used in the script, crontab or FAM directly.
|
||||
|
||||
For example:
|
||||
|
||||
Use the cron daemon to sync files in the **/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist** to the nodegroup 'compute' every 10 minutes by the xdcp command by adding this to crontab. : ::
|
||||
|
||||
*/10 * * * * root /opt/xcat/bin/xdcp compute -F /install/custom/<inst_type>/<distro>/<profile>.<distro>.synclist
|
||||
|
||||
Use the cron daemon to sync files for the nodegroup 'compute' every 10 minutes by updatenode command. ::
|
||||
|
||||
*/10 * * * * root /opt/xcat/bin/updatenode compute -F
|
||||
|
||||
** Related To do**
|
||||
Add reference
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,216 @@
|
||||
The synclist file
|
||||
-----------------
|
||||
|
||||
.. _The_Format_of_synclist_file_label:
|
||||
|
||||
The Format of synclist file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The synclist file contains the configuration entries that specify where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location of files on the target node.
|
||||
|
||||
The basic entry format looks like following: ::
|
||||
|
||||
path_of_src_file1 -> path_of_dst_file1
|
||||
path_of_src_file1 -> path_of_dst_directory
|
||||
path_of_src_file1 path_of_src_file2 ... -> path_of_dst_directory
|
||||
|
||||
The path_of_src_file* should be the full path of the source file on the Management Node.
|
||||
|
||||
The path_of_dst_file* should be the full path of the destination file on target node.
|
||||
|
||||
The path_of_dst_directory should be the full path of the destination directory.
|
||||
|
||||
Since the synclist file is for common purpose, the target node need not be configured in it.
|
||||
|
||||
Example: the following synclist formats are supported:
|
||||
|
||||
sync file **/etc/file2** to the file **/etc/file2** on the node (with same file name) ::
|
||||
|
||||
/etc/file2 -> /etc/file2
|
||||
|
||||
sync file **/etc/file2** to the file **/etc/file3** on the node (with different file name) ::
|
||||
|
||||
/etc/file2 -> /etc/file3
|
||||
|
||||
sync file **/etc/file4** to the file **/etc/tmp/file5** on the node( different file name and directory). The directory will be automatically created for you. ::
|
||||
|
||||
/etc/file4 -> /etc/tmp/file5
|
||||
|
||||
sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist,**xdcp** will create it. ::
|
||||
|
||||
/etc/file1 /etc/file2 /etc/file3 -> /tmp/etc
|
||||
|
||||
sync file **/etc/file2** to the file /etc/file2 on the node ::
|
||||
|
||||
/etc/file2 -> /etc/
|
||||
|
||||
sync all files in **/home/mikev** to directory **/home/mikev** on the node ::
|
||||
|
||||
/home/mikev/* -> /home/mikev/
|
||||
|
||||
Note: Don't try to sync files to the read only directory on the target node.
|
||||
|
||||
An example of synclist file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Assume a user wants to sync files to a node as following, the corresponding entries should be added in a synclist file.
|
||||
|
||||
Sync the file **/etc/common_hosts** to the two places on the target node: put one to the **/etc/hosts**, the other to the **/tmp/etc/hosts**. Following configuration entries should be added ::
|
||||
|
||||
/etc/common_hosts -> /etc/hosts
|
||||
/etc/common_hosts -> /tmp/etc/hosts
|
||||
|
||||
Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **'.tmpl'** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added ::
|
||||
|
||||
/tmp/prog1/conf1.tmpl -> /prog1/conf1
|
||||
/tmp/prog1/conf2.tmpl -> /prog1/conf2
|
||||
|
||||
Sync the files in the directory **/tmp/prog2** to the directory **/prog2** with same name on the target node. (directory **/tmp/prog2** contains two files: **conf1** and **conf2**) Following configuration entries should be added: ::
|
||||
|
||||
/tmp/prog2/conf1 /tmp/prog2/conf2 -> /prog2
|
||||
|
||||
Sample synclist file ::
|
||||
|
||||
/etc/common_hosts -> /etc/hosts
|
||||
/etc/common_hosts -> /tmp/etc/hosts
|
||||
/tmp/prog1/conf1.tmpl -> /prog1/conf1
|
||||
/tmp/prog1/conf2.tmpl -> /prog1/conf2
|
||||
/tmp/prog2/conf1 /tmp/prog2/conf2 -> /prog2
|
||||
/tmp/* -> /tmp/
|
||||
/etc/testfile -> /etc/
|
||||
|
||||
If the above syncfile is performed by the **updatenode/xdcp** commands, or performed in a node installation process, the following files will exist on the target node with the following contents. ::
|
||||
|
||||
/etc/hosts(It has the same content with /etc/common_hosts on the MN)
|
||||
/tmp/etc/hosts(It has the same content with /etc/common_hosts on the MN)
|
||||
/prog1/conf1(It has the same content with /tmp/prog1/conf1.tmpl on the MN)
|
||||
/prog1/conf2(It has the same content with /tmp/prog1/conf2.tmpl on the MN)
|
||||
/prog2/conf1(It has the same content with /tmp/prog2/conf1 on the MN)
|
||||
/prog2/conf2(It has the same content with /tmp/prog2/conf2 on the MN)
|
||||
|
||||
postscript support
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Putting the filename.post in the **rsyncfile** to ``rsync`` to the node is required for hierarchical clusters. It is optional for non-hierarchical cluster.
|
||||
|
||||
Advanced synclist file features
|
||||
''''''''''''''''''''''''''''''''''
|
||||
|
||||
After you define the files to rsync in the syncfile, you can add an **EXECUTEALWAYS** clause in the syncfile. The **EXECUTEALWAYS** clause will list all the postscripts you would always like to run after the files are sync'd, whether or not any file is actually updated. The files in this list must be added to the list of files to rsync, if hierarchical.
|
||||
|
||||
For example, your rsyncfile may look like this. **Note: the path to the file to EXECUTE, is the location of the *.post file on the MN**. ::
|
||||
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post (required for hierarchical clusters)
|
||||
/tmp/share/file3 -> /tmp/file3
|
||||
/tmp/share/file3.post -> /tmp/file3.post (required for hierarchical clusters)
|
||||
/tmp/myscript1 -> /tmp/myscript1
|
||||
/tmp/myscript2 -> /tmp/myscript2
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript1
|
||||
/tmp/myscript2
|
||||
|
||||
If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2**.post is automatically run on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3**.post is automatically run on that node.
|
||||
|
||||
You can add an **APPEND** clause to your syncfile.
|
||||
|
||||
The **APPEND** clause is used to append the contents of the input file to an existing file on the node. The file to be appended must already exist on the node and not be part of the synclist that contains the **APPEND** clause.
|
||||
|
||||
For example, your synclist file may look like this: ::
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
APPEND:
|
||||
/etc/myappenddir/appendfile -> /etc/mysetup/setup
|
||||
/etc/myappenddir/appendfile2 -> /etc/mysetup/setup2
|
||||
|
||||
When you use the **APPEND** clause, the file (left) of the arrow is appended to the file right of the arrow. In this example, **/etc/myappenddir/appendfile** is appended to **/etc/mysetup/setup** file, which must already exist on the node. The **/opt/xcat/share/xcat/scripts/xdcpappend.sh** is used to accomplish this.
|
||||
|
||||
The script creates a backup of the original file on the node in the directory defined by the site table nodesyncfiledir attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to rsync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use the ``xdsh -c`` flag. See man page for ``xdsh``.
|
||||
|
||||
Note:no order of execution may be assumed by the order that the **EXECUTE,EXECUTEALWAYS and APPEND** clause fall in the synclist file.
|
||||
|
||||
You can add an **MERGE** clause to your syncfile. This is only supported on Linux.
|
||||
|
||||
The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three file you should use a **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and insure that there are no duplicate entries in these files.
|
||||
|
||||
For example, your synclist file may look like this ::
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
MERGE:
|
||||
/etc/mydir/mergepasswd -> /etc/passwd
|
||||
/etc/mydir/mergeshadow -> /etc/shadow
|
||||
/etc/mydir/mergegroup -> /etc/group
|
||||
|
||||
When you use the **MERGE** clause, the file (left) of the arrow is merged into the file right of the arrow. It will replace any common userid's found in those files and add new userids. The /opt/xcat/share/xcat/scripts/xdcpmerge.sh is used to accomplish this.
|
||||
|
||||
Note: no order of execution may be assumed by the order that the **EXECUTE,EXECUTEALWAYS,APPEND and MERGE** clause fall in the synclist file.
|
||||
|
||||
.. _the_localtion_of_synclist_file_for_updatenode_label:
|
||||
|
||||
The location of synclist file for updatenode and install process
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In the installation process or updatenode process, xCAT needs to figure out the location of the synclist file automatically, so the synclist should be put into the specified place with the proper name.
|
||||
|
||||
If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition synclists attribute. You can display this information by running the following command, supplying your osimage name. ::
|
||||
|
||||
lsdef -t osimage -l <os>-<arch>-netboot-compute
|
||||
Object name: <os>-<arch>-netboot-compute
|
||||
exlist=/opt/xcat/share/xcat/netboot/<os>/compute.exlist
|
||||
imagetype=linux
|
||||
osarch=<arch>
|
||||
osname=Linux
|
||||
osvers=<os>
|
||||
otherpkgdir=/install/post/otherpkgs/<os>/<arch>
|
||||
pkgdir=/install/<os>/<arch>
|
||||
pkglist=/opt/xcat/share/xcat/netboot/<os>/compute.pkglist
|
||||
profile=compute
|
||||
provmethod=netboot
|
||||
rootimgdir=/install/netboot/<os>/<arch>/compute
|
||||
**synclists=/install/custom/netboot/compute.synclist**
|
||||
|
||||
You can set the synclist path using the following command ::
|
||||
|
||||
chdef -t osimage -o <os>-<arch>-netboot-compute synclists="/install/custom/netboot/compute.synclist
|
||||
|
||||
If the provisioning method for the node is install,or netboot then the path to the synclist should be of the following format ::
|
||||
|
||||
/install/custom/<inst_type>/<distro>/<profile>.<os>.<arch>.synclist
|
||||
<inst_type>: "install", "netboot"
|
||||
<distro>: "rh", "centos", "fedora", "sles"
|
||||
<profile>,<os>and <arch> are what you set for the node
|
||||
|
||||
For example:
|
||||
The location of synclist file for the diskfull installation of <os> with 'compute' as the profile ::
|
||||
|
||||
/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist
|
||||
|
||||
The location of synclist file for the diskless netboot of <os> with '<profile>' as the profile ::
|
||||
|
||||
/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
Run the Syncing File action in the updatenode process
|
||||
------------------------------------------------------
|
||||
|
||||
If run ``updatenode`` command with -F option, it syncs files which configured in the synclist to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` option to sync images.
|
||||
|
||||
``updatenode`` can be used to sync files to to diskfull or diskless nodes. ``updatenode`` cannot be used to sync files to statelite nodes.
|
||||
|
||||
Steps to make the Syncing File working in the ``updatenode -F`` command:
|
||||
|
||||
#. Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label`)
|
||||
#. Put the synclist into the proper location (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`).
|
||||
#. Run the ``updatenode node -F`` command to initiate the Syncing File action.
|
||||
|
||||
Note: Since Syncing File action can be initiated by the ``updatenode -F`` flag, the ``updatenode -P`` does NOT support to re-run the **'syncfiles'** postscript, even if you specify the **'syncfiles'** postscript in the ``updatenode`` command line or set the **'syncfiles'** in the **postscripts.postscripts** attribute.
|
||||
|
@ -0,0 +1,30 @@
|
||||
Run xdcp command to perform Syncing File action
|
||||
------------------------------------------------
|
||||
|
||||
``xdcp`` command supplies three options **'-F' , -s, and '-i'** to support the Syncing File function.
|
||||
|
||||
* -F|--File rsync input file
|
||||
|
||||
Specifies the full path to the synclist file that will be used to build the ``rsync`` command
|
||||
|
||||
* -s
|
||||
|
||||
Specifies to rsync to the service nodes only for the input compute noderange.
|
||||
|
||||
* -i|--rootimg install image for Linux
|
||||
|
||||
Specifies the full path to the install image on the local node. By default, if the -F option is specified, the **'rsync'** command is used to perform the syncing file function. For the ``rsync`` in ``xdcp``, only the ***ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **'-Lpotz'** as the default flags to call the rsync command. More flags for rsync command can be specified by adding **'-o'** flag to the call to ``xdcp``.
|
||||
|
||||
For example: ::
|
||||
|
||||
Using xdcp '-F' option to sync files which are listed in the /install/custom/commonsyncfiles/<profile>.synclist directory to the node group named 'compute'. If the node group compute is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in /var/xcat/syncfiles directory on the service nodes by default, or in the directory indicated in the site.SNsyncfiledir attribute. See -s option below.
|
||||
xdcp compute -F /install/custom/commonsynfiles/<profile>.synclist
|
||||
|
||||
For Linux nodes, using **xdcp '-i'** option with **'-F'** to sync files created in the **/install/custom/<inst_type>/<os><profile>.synclist** to the osimage in the directory **/install/<inst_type>/<os>/<arch>/<profile>/rootimg**: ::
|
||||
|
||||
xdcp -i /install/<inst_type>/<os>/<arch>/<profile>/rootimg -F /install/custom/<inst_type>/<os>/<profile>.synclist
|
||||
|
||||
Using the **xdcp '-s'** option to sync the files only to the service nodes for the node group named 'compute'. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/**. This can be setup before a node install, to have the files available to be synced during the install: ::
|
||||
|
||||
xdcp compute -s -F /install/custom/<inst_type>/<os>/<profile>.synclist
|
||||
|
@ -1,2 +1,9 @@
|
||||
.. include:: ../../../common/deployment/additional_pkg.rst
|
||||
|
||||
.. include:: ../../../common/deployment/additionalpkg/additional_pkg.rst
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
../../../common/deployment/additionalpkg/additional_pkg_overview.rst
|
||||
../../../common/deployment/additionalpkg/nonubuntu_os_pkg.rst
|
||||
../../../common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst
|
||||
|
||||
|
@ -1,2 +1,9 @@
|
||||
.. include:: ../../../common/deployment/pre_post_script.rst
|
||||
|
||||
.. include:: ../../../common/deployment/prepostscritps/pre_post_script.rst
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
../../../common/deployment/prepostscritps/pre_script.rst
|
||||
../../../common/deployment/prepostscritps/post_script.rst
|
||||
../../../common/deployment/prepostscritps/suggestions.rst
|
||||
|
||||
|
@ -1,2 +1,13 @@
|
||||
.. include:: ../../../common/deployment/syncfile.rst
|
||||
|
||||
.. include:: ../../../common/deployment/syncfile/syncfile.rst
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
../../../common/deployment/syncfile/syncfile_overview.rst
|
||||
../../../common/deployment/syncfile/syncfile_synclist_file.rst
|
||||
../../../common/deployment/syncfile/syncfile_xdcp.rst
|
||||
../../../common/deployment/syncfile/syncfile_install.rst
|
||||
../../../common/deployment/syncfile/syncfile_diskless.rst
|
||||
../../../common/deployment/syncfile/syncfile_updatenode.rst
|
||||
../../../common/deployment/syncfile/syncfile_periodically.rst
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user