2007-12-05 14:13:34 +00:00
=head1 NAME
2008-05-28 21:07:33 +00:00
2007-12-05 14:13:34 +00:00
B<chdef> - Change xCAT data object definitions.
2008-05-28 21:07:33 +00:00
2007-12-05 14:13:34 +00:00
=head1 SYNOPSIS
2008-05-28 21:07:33 +00:00
B<chdef> [B<-h>|B<--help>] [B<-t> I<object-types>]
2010-09-08 10:38:42 +00:00
B<chdef> [B<-t> I<object-types>] [B<-o> I<object-names>] [B<-n> I<new-name>] [I<node>]
2008-05-28 21:07:33 +00:00
B<chdef> [B<-V>|B<--verbose>] [B<-t> I<object-types>] [B<-o> I<object-names>]
2009-05-19 06:17:46 +00:00
[B<-d>|B<--dynamic>] [B<-p>|B<--plus>] [B<-m>|B<--minus>] [B<-z>|B<--stanza>]
2009-07-03 08:36:28 +00:00
[[B<-w> I<attr>==I<val>] [B<-w> I<attr>=~I<val>] ...] [I<noderange>] [I<attr>=I<val> [I<attr>=I<val...>]]
2007-12-05 14:13:34 +00:00
=head1 DESCRIPTION
This command is used to change xCAT object definitions which are stored in the xCAT database. The default is to replace any existing attribute value with the one specified on the command line. The command will also create a new definition if one doesn't exist.
2010-09-08 10:38:42 +00:00
This command also can be used to change the xCAT object name to a new name. Note: the site,monitoring types can NOT be supported.
2007-12-05 14:13:34 +00:00
=head1 OPTIONS
2008-05-28 21:07:33 +00:00
=over 10
=item I<attr=val [attr=val ...]>
Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. Use the help option to get a list of valid attributes for each object type.
2009-05-19 06:17:46 +00:00
=item B<-d|--dynamic>
Use the dynamic option to change dynamic node groups definition. This option must be used with -w option.
2008-05-28 21:07:33 +00:00
=item B<-h|--help>
Display usage message.
=item B<-m|--minus>
If the value of the attribute is a list then this option may be used to remove one or more items from the list.
2010-09-08 10:38:42 +00:00
=item B<-n> I<new-name>
Change the current object name to the new-name which is specified by the -n option.
The object of site, monitoring types cannot be supported.
2011-07-27 09:04:01 +00:00
Note: For the B<-n> option, only one node can be handled. For some special nodes such as fsp, bpa, frame, cec etc., usually their hcp attributes are their names, if you use B<-n> option, please check if you need to change the hcp attribute to their new names.
2010-09-08 10:38:42 +00:00
2008-05-28 21:07:33 +00:00
=item I<noderange>
A set of comma delimited node names and/or group names. (must be the first parameter) See the "noderange" man page for details on supported formats.
=item B<-o> I<object-names>
A set of comma delimited object names.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item B<-p|--plus>
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
This option will add the specified values to the existing value of the attribute. It will create a comma-separated list of values.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item B<-t> I<object-types>
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
A set of comma delimited object types. Use the help option to get a list of valid object types.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item B<-V|--verbose>
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
Verbose mode.
2007-12-05 14:13:34 +00:00
2009-07-03 08:36:28 +00:00
=item B<-w> I<attr==val> B<-w> I<attr=~val> ...
2007-12-05 14:13:34 +00:00
2009-07-06 02:43:01 +00:00
Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. Use the help option to get a list of valid attributes for each object type.
2009-06-30 09:47:48 +00:00
2009-07-15 19:50:53 +00:00
Operator descriptions:
== Select nodes where the attribute value is exactly this value.
!= Select nodes where the attribute value is not this specific value.
=~ Select nodes where the attribute value matches this regular expression.
!~ Select nodes where the attribute value does not match this regular expression.
2009-06-30 09:47:48 +00:00
Note: the operator !~ will be parsed by shell, if you want to use !~ in the selection string, use single quote instead. For example:-w 'mgt!~ipmi'.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item B<-z|--stanza>
2008-06-13 11:48:09 +00:00
Indicates that the file being piped to the command is in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files.
2008-05-28 21:07:33 +00:00
=back
2007-12-05 14:13:34 +00:00
=head1 RETURN VALUE
0 The command completed successfully.
1 An error has occurred.
=head1 EXAMPLES
2008-05-28 21:07:33 +00:00
=over 3
=item 1.
To change a site definition.
2011-09-06 17:04:00 +00:00
chdef -t site -o clustersite installdir=/xcatinstall
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item 2.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
To change a basic node definition.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
chdef -t node -o node01 groups="all,aix"
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
(The group definitions are also created if they don't already exist.)
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item 3.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
To add another group to the "groups" attribute in the previous example.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
chdef -p -t node -o node01 groups="compute"
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item 4.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
To remove the "all" group from the "groups" attribute in the previous example.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
chdef -m -t node -o node01 groups="all"
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
=item 5.
2007-12-05 14:13:34 +00:00
2008-05-28 21:07:33 +00:00
To replace the current "groups" attribute value of "node01".
chdef -t node -o node01 groups="linux"
=item 6.
2009-07-24 08:43:11 +00:00
To add "node01" to the "members" attribute of a group definition called "LinuxNodes".
2008-05-28 21:07:33 +00:00
2009-07-24 08:43:11 +00:00
chdef -p -t group -o LinuxNodes members="node01"
2008-05-28 21:07:33 +00:00
2008-07-22 14:11:09 +00:00
=item 7.
To update a set of definitions based on information contained in the stanza file mystanzafile.
cat mystanzafile | chdef -z
2009-06-03 09:04:05 +00:00
=item 8.
To update a dynamic node group definition to add the cons=hmc wherevals pair.
2009-07-03 08:36:28 +00:00
chdef -t group -o dyngrp -d -p -w cons==hmc
2009-06-03 09:04:05 +00:00
2010-09-08 10:38:42 +00:00
=item 9.
To change the node object name from node1 to node2.
chdef -t node -o node1 -n node2
2011-07-05 07:13:32 +00:00
=item 10.
To change the node hwtype, this command will change the value of ppc.nodetype.
chdef -t node -o node1 hwtype=lpar
2011-07-15 11:26:34 +00:00
2011-09-08 13:03:18 +00:00
=item 11.
To change the policy table for policy number 7.0 for admin1
chdef -t policy -o 7.0 name=admin1 rule=allow
2008-05-28 21:07:33 +00:00
=back
2007-12-05 14:13:34 +00:00
=head1 FILES
2008-05-28 21:07:33 +00:00
2008-02-05 12:43:44 +00:00
$XCATROOT/bin/chdef
(The XCATROOT environment variable is set when xCAT is installed. The
default value is "/opt/xcat".)
2007-12-05 14:13:34 +00:00
=head1 NOTES
This command is part of the xCAT software product.
=head1 SEE ALSO
2008-08-02 16:18:07 +00:00
L<mkdef(1)|mkdef.1>, L<lsdef(1)|lsdef.1>, L<rmdef(1)|rmdef.1>, L<xcatstanzafile(5)|xcatstanzafile.5>