quattor NCM componentsintroduction tutorialGerman CancioCERN IT/FIOGerman.Cancio@cern.ch‹„‹„‹ContentsPreparationNCM ‘theory’Components – what are they, how to run themPackagingNCM exercisesDisclaimer:This is not a full quattor tutorial, but an introduction to the NCM framework. In particular, neither CDB/pan, nor SWRep/SPMA, nor AII are covered. A basic understanding of the PAN language is recommended.Quattor NCM tutorial – German.Cancio@cern.ch - n° 2„‹„„‹„‹„PreparationLogin onto your ‘worker node’ (see whiteboard) as rootPlease download the following tar.gz file, and uncompress it in your $HOME directory (~root):cd ~wget http://cern.ch/quattor/documentation/tutorials/cern-0404/ncm-tutorial.tgztar xvfz ncm-tutorial.tgzRun the setup script:~/ncm-tutorial/bin/tutorial_setup.shshould print [OK]Quattor NCM tutorial – German.Cancio@cern.ch - n° 3PXE DHCP KS/JSPackages(rpm, pkg)http nfs ftpNCM environmentSWRep ServerscachepackagesSPMAMgmt API(RPM, PKG)SPMA.cfgACL’sSPMANCMComponentsNode NCM(re)install?AII serverCdispdPXEMgmt APIhandlingRegistrationCCMNotification ACL’sNodeDHCPInstall handlingKS/JSgeneratorClient NodesCDBCCMQuattor NCM tutorial – German.Cancio@cern.ch - n° 4„‹„„„„‹‹‹„„„‹What are components? (1/2)“Components” (like SUE “features” or LCFG ‘objects’) are responsible for updating local config files, and notifying services if neededComponents do only configure the ...
This is not a full quattor tutorial, but an introduction to the NCM framework. In particular, neither CDB/pan, nor SWRep/SPMA, nor AII are covered. A basic understanding of the PAN language is recommended.
Preparation
Contents
rtoatQutotuMNCeGlairnaC.namrcio@cern.ch-n°3
Run the setup script:
~n/mct-turoai/lh.suptes_lairotut/nib
should print[OK]
cd ~
Please download the following tar.gz file, and uncompress it in your $HOME directory (~root):
Login onto your worker node (see whiteboard) asroot
Preparation
EXPrNCMtuQuattoeGmrnaC.otirla.crnn°h-cianceo@4
Node Install
Mgmt API ACLs
NCM environment
CCM
Client Nodes
CDB
SWRep Servers
Notification
SPMA
Mgmt API ACLs
AII server
Node (re)install?
handling DHCP handling
KS/JS generator
packages (RPM, PKG)
Components can be run manually via hooks (cron, boot time, etc) via CERN-CCs notification framework (notd) ydekocasuianotamitacll:fngrierguitsatoeirntnheeritrinterestincodnategsiesortrubs,eed(siegsdtabaelechanofCCN-ERC) inv
Use standard system facilities (SysV scripts) formanagingservices Components can notify services using SysV scripts when their configuration changes.
features or LCFG objects) are responsible forComponents (like SUE updating local config files, and notifying services if needed
Components do onlyconfigurethe system conf /Uestucal/lsy,shtdhisciomnfpliig)giifelse(.gnitarenero/dnaginatpdulcalogreges _
What are components? (1/2)
toatNCrtuMritouQo@cern.ch-n°5laeGmrnaC.naic
mreGlaicnaC.naNCrtoatritotuMuQo@cern.ch-n°6
Components are written as Perl OO class instances
What are components? (2/2)
Each component has to provide two methods:
Unconfigure():
Configure():
Optional method most of the components wont need to implement it.
invoked when a component is to be removed
Mandatory method
invoked when there was a CDB configuration change or on startup
hcn-°7oic@re.nman.CancialGer
Monitors the config profile, and invokes registered components viancm-ncdif there were changes
cdispd(Configuration Dispatch Daemon)
ncm-query
examining configuration information as cached on theTool for node
How to run components?
dependency ordering of components
framework and front-end for executing components (via cron, cdispd, or manually)
ncm-ncd(Node Configuration Deployer):
not described in this tutorial.
QCMtutoruattorN
8rn.ch-n°ancio@ceC.namreGlairottuMNCrtoatQu
my $arch=$config->getValue('/system/architecture); #NVA API
$element=$config->getElement($path); while ($element->hasNextElement()) { my $newel=$element->getNextElement(); ... }
NVA API: configuration access library
Components and CDB profile access
uaQortt°n-hc.n9ttuNMClGroain.Caerma@cerncio
Reporting functions: $self->log(@array):write @array to components log file $self->report(@array):write @array to log and stdout. $self->verbose(@array), $self->debug(level,@array):verbose/debug output
Component support libs
Advanced support libraries available (revamped from CERNs SUE): Configuration file manipulation Advanced file operations Process management Exception management libraries See /opt/edg/lib/perl/LC for details
Failures of reconfigurations are done using error(..). Components depending on a failed component arenotexecuted.
$self->warn(@array):writes a[WARN]message, increases # of warnings $self->error(@array):writes an[ERROR]message, increases # of errors