2007-12-05 14:14:45 +00:00
=head1 NAME
2008-05-28 21:07:33 +00:00
2007-12-05 14:14:45 +00:00
B<mkdef> - Use this command to create xCAT data object definitions.
2008-05-28 21:07:33 +00:00
2007-12-05 14:14:45 +00:00
=head1 SYNOPSIS
2008-05-28 21:07:33 +00:00
B<mkdef> [B<-h>|B<--help>] [B<-t> I<object-types>]
B<mkdef> [B<-V>|B<--verbose>] [B<-t> I<object-types>] [B<-o> I<object-names>]
2009-05-19 06:17:46 +00:00
[B<-z>|B<--stanza>] [B<-d>|B<--dynamic>] [B<-f>|B<--force>]
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...>]]
2008-05-28 21:07:33 +00:00
2007-12-05 14:14:45 +00:00
=head1 DESCRIPTION
This command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The force option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created.
2008-05-28 21:07:33 +00:00
2007-12-05 14:14:45 +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-12-01 05:27:57 +00:00
Note: when creating node object definitions, the 'groups' attribute is required.
2009-05-19 06:17:46 +00:00
=item B<-d|--dynamic>
Use the dynamic option to create dynamic node groups. This option must be used with -w option.
2008-05-28 21:07:33 +00:00
=item B<-f|--force>
Use the force option to re-create object definitions. This option removes the old definition before creating the new one.
=item B<-h|--help>
Display usage message.
=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:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item B<-t> I<object-types>
2007-12-05 14:14:45 +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:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item B<-V|--verbose>
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
Verbose mode.
2007-12-05 14:14:45 +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:14:45 +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. For mkdef commmand, the -w flag only makes sense for creating dynamic node group. 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-07-03 08:36:28 +00:00
Note: if the "val" fields includes spaces or any other characters that will be parsed by shell, the "attr<operator>val" needs to be quoted. If the operator is "!~", the "attr<operator>val" needs to be quoted using single quote.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item B<-z|--stanza>
2008-06-13 11:56:44 +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:14:45 +00:00
=head1 RETURN VALUE
0 The command completed successfully.
1 An error has occurred.
2008-05-28 21:07:33 +00:00
2007-12-05 14:14:45 +00:00
=head1 EXAMPLES
2008-05-28 21:07:33 +00:00
=over 3
=item 1.
To create a site definition.
2011-09-06 17:50:06 +00:00
mkdef -t site -o clustersite installdir=/xcatinstall
2008-05-28 21:07:33 +00:00
=item 2.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
To create a basic node definition.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
mkdef -t node -o node01 groups="all,aix"
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item 3.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
To re-create the current definition of "node01".
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
mkdef -f -t node -o node01 nodetype=osi groups="linux"
2007-12-05 14:14:45 +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:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item 4.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
To create a set of different types of definitions based on information contained in a stanza file.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
cat defstanzafile | mkdef -z
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item 5.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
To create a group definition called LinuxNodes containing the nodes clstrn01 and clstrn02.
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
mkdef -t group -o LinuxNodes members="clstrn01,clstrn02"
2007-12-05 14:14:45 +00:00
2008-05-28 21:07:33 +00:00
=item 6.
To create a node definition for an FSP node using the attributes provided by the group fspnodes.
mkdef -t node fspn1 groups=fspnodes nodetype=fsp
=item 7.
To create node definitions for a set of node host names contained in the node range "node1,node2,node3"
mkdef -t node node1,node2,node3 power=hmc groups="all,aix"
2009-06-03 09:04:05 +00:00
=item 8.
To create a dynamic node group definition called HMCMgtNodes containing all the HMC managed nodes"
2009-07-03 08:36:28 +00:00
mkdef -t group -o HMCMgtNodes -d -w mgt==hmc -w cons==hmc
2009-06-03 09:04:05 +00:00
=item 9.
To create a dynamic node group definition called SLESNodes containing all the SLES nodes
2009-06-30 09:47:48 +00:00
mkdef -t group -o SLESNodes -d -w "os=~^sles[0-9]+$"
2009-06-03 09:04:05 +00:00
2011-09-08 13:03:18 +00:00
=item 10.
To create a entry (7.0) in the policy table for user admin1
mkdef -t policy -o 7.0 name=admin1 rule=allow
2013-03-21 06:39:44 +00:00
=item 11.
To create a node definition with nic attributes
mkdef -t node cn1 groups=all nicips.eth0="1.1.1.1|1.2.1.1" nicnetworks.eth0="net1|net2" nictypes.eth0="Ethernet"
2008-05-28 21:07:33 +00:00
=back
2007-12-05 14:14:45 +00:00
=head1 FILES
2008-05-28 21:07:33 +00:00
2008-02-05 12:57:33 +00:00
$XCATROOT/bin/mkdef
(The XCATROOT environment variable is set when xCAT is installed. The
default value is "/opt/xcat".)
2007-12-05 14:14:45 +00:00
=head1 NOTES
This command is part of the xCAT software product.
=head1 SEE ALSO
2009-05-19 06:17:46 +00:00
L<chdef(1)|chdef.1>, L<lsdef(1)|lsdef.1>, L<rmdef(1)|rmdef.1>, L<xcatstanzafile(5)|xcatstanzafile.5>