SYNOPSIS
oaradmin resources OPTIONSoaradmin rules OPTIONS
oaradmin conf OPTIONS
oaradmin version
DESCRIPTION
This command is used to manage OAR configuration.The command oaradmin resources manages resources in OAR database : add, update and delete many resources in a single command line.
The command oaradmin rules manages admission rules : list, add, edit/update, delete, export, enable or disable one or several admission rules. A versioning feature, using Subversion, allows one to keep all admission rules changes.
The command oaradmin conf is useful for modify OAR conf files, register changes in a Subversion repository and revert to a conf file at a particular revision if needed.
The command oaradmin version print the version of OAR.
Each subcommand has a long and an optional short form : oaradmin resources or oaradmin re, oaradmin rules or oaradmin ru for examples.
OPTIONS
Options for resources subcommand
- -a <EXPR> [--cpusetproperty=property] [-p <EXPR>]
-
These options can create and define many resources in OAR database. In a single command line, it is possible to create the whole cluster definition.
With -a option, <EXPR> form is like : (/property=value)+. Several <EXPR> can be used : /property=value/property=value... Property field correspond to the name of a property in OAR database : cpu, core, switch for example. A specific keyword ``node'' (or ``nodes'') is use to indicate nodes names. Order of <EXPR> expressions is important : it describes the resources properties hierarchy in the cluster. Properties used in <EXPR> must exist and must be created with oarproperty command before. '/' caracter is mandatory at the beginning of each expression, no space between two expressions.
Ex : oaradmin resources -a /node=mycluster{12}.local/cpu={2}/core={2}. Number in {} is the number of elements for one element of previous level. So in this example 12 nodes, each node has 2 cpus, each cpu has 2 cores. Oaradmin creates following resources : mycluster1.local cpu=1 core=1, mycluster1.local cpu=1 core=2, mycluster1.local cpu=2 core=3, mycluster1.local cpu=2 core=4, mycluster2.local cpu=3 core=5...
A second form is useful to name nodes. The expression -a /node=mycluster[1-100].local creates nodes mycluster1.local, mycluster2.local... mycluster100.local. It is possible to specify lists and groups for hosts. Ex : -a /node=mycluster[1-8,10,15,20-30],host_a,host_b/cpu={2}. Of course, in [...] only numeric values are allowed. Expression -a /node=chemistry_cluster[1-10,18],physics_cluster[1-50]/cpu={2} is also possible.
For nodes naming, a numeric format and an offset are available. The numeric format is specified with %xd where x is the number of digits. Ex : -a /node=mycluster-{%2d12} will create nodes mycluster-01, mycluster-02... The offset is specified with +x (or +xoffset) where x is the offset value. mycluster{12+20} will create mycluster21 as first node name. Remember that the first node name with mycluster{12} is mycluster1. So the first numeric value is increased by +20. Offset can be negative with -x. Numeric format and offset can be used anywhere in {} expression : {12%3d+20} or {+20offset12%3d}. With [] form in nodes names, offset is useless ; only numeric format can be used in this case. mycluster[1-100] define values of names. mycluster{12} defined at the same time a number of elements and values of names.
Some expressions does not match or are not allowed :
-a /switch={2}/node=mycluster[1-12]. If an expression uses [], it must be the first expression behind -a.
-a /node=cluster_a{12},cluster_b{12}. Only one argument must be used with {} form in each <EXPR>.
-a /node=cluster_a{12},cluster_b[1-10]. {} and [] forms are exclusive.--cpusetproperty option is useful to define the property used for numbers cpusets. Ex : -a /node=mycluster{12}/cpu={2}/core={2} --cpusetproperty=cpu means one cpuset per cpu. If the option is not used, one cpuset is created per resource_id.
-p option is useful to define other properties that are not in properties hierarchy : memory, project... With -p option <EXPR> form is as follows : property=value. Several expressions -p property=value can be used. -p is mandatory at the beginning of each <EXPR>. Ex : -p mem=1024 -p arch=amd_64 -p infiniband=YES. An operator {%} is available to increment by 1 a property value. Ex : -p ip=192.168.1.{%}
Witout -c option, oaradmin print only oarnodesetting commands. No changes are made in OAR database. Use -c option to execute commands and commit changes.
Other examples :
oaradmin resources -a /switch=sw{5}/node=mycluster{12}.domain/cpu={2}
Creates a cluster with 5 switchs, 12 nodes per switch, 2 cpus per node.oaradmin resources -a /node=mycluster-{%3d250}/cpu={2} oaradmin resources -a /node=mycluster-[%3d1-250]/cpu={2} Creates nodes from mycluster-001 to mycluster-250 with 2 cpus per node. oaradmin resources -a /node=mycluster[1-25]/cpu={2} -p mem=1024 -p arch=amd_64 -p infiniband=YES -c
- --auto-offset
- This option automatically computes the node, cpu, and core offsets for you based on what is already registered in the OAR database. Node names must be of the form <cluster>-<number><something> for oaradmin to automatically find the good <number>.
- -s <EXPR> -p <EXPR>
-
These options update several resources in OAR database. -s <EXPR> defines the condition to select resources and -p <EXPR> defines the data to update on the selected resources.
The <EXPR> form is : property=value. As add feature, property field corresponds to the name of a property in OAR database already created with oarproperty command. With -s option, only one <EXPR> expression can be specified. The boolean operators AND and OR cannot be used. With -p option, several <EXPR> expressions can be used. When digits are used in host names, the expression -s node=mycluster[%3d1-8] must be used instead of -s node=mycluster[001-008].
It is possible to group resources with {x} and {%} operators. {x} defines a group of x elements or means ``each x elements''. {%} means an increment of 1 to 1. Ex : oaradmin resources -s core={4} -p cpu={%}. Creates one cpu each 4 cores. {x} is allowed only in the selected expression. {%} is allowed only with -p option.
Offset can be used in this form : oaradmin resources -s core={4+56} -p cpu={%+56}.
Witout -c option, oaradmin prints only oarnodesetting commands. No changes are made in OAR database. Use -c option to execute commands and commit changes.
Other examples :
oaradmin resources -s node=mycluster-[%3d1-100] -p infiniband=YES -p project=chemistry
Update infiniband and project properties on nodes mycluster-001, mycluster-002...oaradmin resources -s v_node={4} -p p_node={%} Create one physical node (p_node property) every each 4 virtual nodes (v_node property).
- -d [<EXPR>]
-
Delete many resources in OAR database.
-d alone delete all resources.
-d <EXPR> delete selected resources by <EXPR> expression. It's form is property=value. As -s option, boolean operators does not match and only one <EXPR> expression can be specified.
Examples :
oaradmin resources -d -c
oaradmin resources -d node=mycluster[1-100] -c - -c
-
Execute commands specified with -a, -s -p... and commit changes in OAR database.
- -h, --help
- Print help message.
Options for rules subcommand
- -l, --list | -ll | -lll [rule_ids]
-
The recommended format is as follows. The first line commented with # is the title of the rule. The following lines also commented contains the description or algorithm of the rule. The following lines contains the content of the Perl script. This format is not mandatory. Admission rules can contains only Perl script lines without comments. The -l option prints only the title line. The -ll option prints title and description lines and -lll prints the entire contents. If no rules numbers given, it prints all admission rules. Ex :
oaradmin rules -l
oaradmin rules -lll 3 5 8 - -a, --add [rule_id] [-f file]
-
Add an admission rule with a text editor or directly from a file. $EDITOR variable environment is used to launch the preferred text editor. If not defined, vi is used. Without rule_id, the new rule is added at the end of the admission rules table in OAR database. If rule_id is defined, the new rule is inserted at the rule_id position. The numbers above or equals to rule_id are increased by 1. This is useful to group the rules that have the same type of treatment. The filename must be specified just after -f option. Ex :
oaradmin rules -a
oaradmin rules -a 10
oaradmin rules -a -f my_file - -d, --delete rule_id [rule_ids]
-
Delete one or more admission rules. Ex :
oaradmin rules -d 2
oaradmin rules -d 2 3 4 - -x, --export [rule_ids] | -x, --export rule_id -f file
-
Export admission rules into files. The default filename used for export is admission_rule_<rule_id> and these files are created in the current directory. The -x option alone exports all admission rules. With -f file option, only one rule can be exported. If files already exists, oaradmin asks confirmation to overwrite. Ex :
oaradmin rules -x
oaradmin rules -x 1 5 18
oaradmin rules -x 3 -f my_file
oaradmin rules -x 18 -f /my_directory/my_file - -e, --edit rule_id [-f file]
-
Edit the rule_id admission rule using a text editor. A temporary file is used to edit the admission rule. This file is stored in the directory specified by OAR_RUNTIME_DIRECTORY in the OAR configuration file. If this parameter is not defined, /tmp is used. Oaradmin asks user to commit in database only if changes are made in the rule. Editing differents admission rules at the same time, into two consoles is possible. Editing the same admission rule into two consoles at the same time is also possible. But careful, in this case, depending on manipulations some data can be lost. Like add feature, $EDITOR variable environment can specify a text editor. If a filename is specified whith -f option, oaradmin directly update the rule_id admission rule in database without editing. Ex :
oaradmin rules -e 3
oaradmin rules -e 3 -f my_file - -1, --enable rule_id
-
Enable the rule_id admission rule. The # comments character at the beginning of each line is deleted. So the admission rule is enabled and evaluated in oarsub command. Ex :
oaradmin rules -1 10 - -0, --disable rule_id
-
Disable the rule_id admission rule. The # comments character is added at the beginning of each line of the rule. So the admission rule is not evaluated and has no effect in oarsub command. Ex :
oaradmin rules -0 10 - -H, --history rule_id [-n number]
-
Show all changes made on the admission rule rule_id. Output is displayed in unified diff format. With -n number option, only the #number latest changes are displayed. Versioning feature can be activated with the parameter OARADMIN_VERSIONING in the OAR conf file. The repository is created when a change is made in an admission rule. Ex :
oaradmin rules -H 10 - -R, --revert rule_id rev
-
Revert to the admission rule rule_id as it existed in #rev revision. Ex :
oaradmin rules -R 10 3 - -h, --help
- Print help message.
Options for conf subcommand
- -e, --edit conf_file
-
Edit the file conf_file using a text editor. $EDITOR variable environment is used to launch the preferred text editor. If $EDITOR is not defined, vi is used. If the versioning feature is enabled, after editing the file, changes are registered in a Subversion repository. Versioning feature can be activated with the parameter OARADMIN_VERSIONING in the OAR conf file. The repository is created when a change is made in the file. Ex :
oaradmin conf -e /etc/oar/oar.conf - -H, --history conf_file [-n number]
-
Show all changes made on the file conf_file. Output is displayed in unified diff format. With -n number option, only the #number latest changes are displayed. Ex :
oaradmin conf -H oar.conf - -R, --revert conf_file rev
-
Revert to the file conf_file as it existed in #rev revision. Ex :
oaradmin conf -R /etc/oar/oar.conf 3 - -h, --help
- Print help message.
NOTES
Oaradmin resources subcommand uses oarnodes outputs with yaml format. So, Perl yaml and Ruby yaml packages must be installed.COPYRIGHTS
Copyright 2003 Laboratoire Id-Imag (http://www-id.imag.fr). This software is licensed under the GNU Library General Public License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.