-Update documentation for nodech/nodels for new selection operators

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2095 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-09-08 02:11:55 +00:00
parent d97bf616bc
commit 7a658e6816
2 changed files with 101 additions and 4 deletions

View File

@ -23,6 +23,12 @@ there. If "^=" is used, the specified value will be removed from the attribute'
if it is there. You can also use "^=" and ",=" in the same command to essentially replace one item
in the list with another. (See the Examples section.)
Additionally, as in nodels, boolean expressions can be used to further limit the scope of nodech from
the given noderange. The operators supported are the same as nodels (=~, !~, ==, and !=).
With these operators in mind, the unambiguous assignment operator is '=@'. If you need, for example, to set
the nodelist.comments to =foo, you would have to do I<nodech n1 nodelist.comments=@=foo>.
See the B<xcatdb> man page for an overview of each table.
The nodech command also supports some short cut names as aliases to common attributes. See the
@ -75,6 +81,12 @@ B< nodech> I<node1-node4 groups=all>
=item *
To put all nodes with nodepos.rack value of 2 into a group called rack2:
B< nodech> I<all> nodepos.rack==2 groups,=rack2
=item *
To add nodes in noderange node1-node4 to the nodetype table with os=rhel5:
B< nodech> I<node1-node4 groups=all,rhel5 nodetype.os=rhel5>
@ -101,4 +113,4 @@ B< nodech> I<node1-node4 groups^=group1 groups,=group2>
=head1 SEE ALSO
L<nodels(1)|nodels.1>, L<nodeadd(8)|nodeadd.8>, L<noderange(3)|noderange.3>
L<nodels(1)|nodels.1>, L<nodeadd(8)|nodeadd.8>, L<noderange(3)|noderange.3>

View File

@ -34,12 +34,31 @@ nodelist.groups
nodehm.mgt
=item B<switch>
=back
switch.switch
nodels can also select based on table value criteria. The following operators are available:
=over 15
=item B<==>
Select nodes where the table.column value is exactly a certain value.
=item B<!=>
Select nodes where the table.column value is not a given specific value.
=item B<=~>
Select nodes where the table.column value matches a given regular expression.
=item B<!~>
Select nodes where the table.column value does not match a given regular expression.
=back
The B<nodels> command with a specific node and one or more table.attribute parameters is a good substitute
for grep'ing through the tab files, as was typically done in xCAT 1.x. This is because nodels will translate
any regular expression rows in the tables into their meaning for the specified node. The tab* commands
@ -156,7 +175,73 @@ To list the out-of-band mgt method for blade1:
Output is similar to:
blade1: nodehm.mgt: blade
blade1: blade
=item 7.
Listing blades managed through an AMM named 'amm1'
nodels all mp.mpa==amm1
Output is similar to:
blade1
blade10
blade11
blade12
blade13
blade2
blade3
blade4
blade5
blade6
blade7
blade8
blade9
=item 8.
Listing the switch.switch value for nodes in the second rack:
nodels all nodepos.rack==2 switch.switch
Output is similar to:
n41: switch.switch: switch2
n42: switch.switch: switch2
n43: switch.switch: switch2
n44: switch.switch: switch2
n45: switch.switch: switch2
n46: switch.switch: switch2
n47: switch.switch: switch2
n55: switch.switch: switch2
n56: switch.switch: switch2
n57: switch.switch: switch2
n58: switch.switch: switch2
n59: switch.switch: switch2
n60: switch.switch: switch2
=item 9.
Listing the blade slot number for anything managed through a device with a name beginning with amm:
nodels all mp.mpa=~/^amm.*/ mp.id
Output looks like:
blade1: mp.id: 1
blade10: mp.id: 10
blade11: mp.id: 11
blade12: mp.id: 12
blade13: mp.id: 13
blade2: mp.id: 2
blade3: mp.id: 3
blade4: mp.id: 4
blade5: mp.id: 5
blade6: mp.id: 6
blade7: mp.id: 7
blade8: mp.id: 8
blade9: mp.id: 9
=back