=head1 NAME

B<mkdsklsnode> - Use this xCAT command to define and initialize AIX/NIM diskless machines.

=head1 SYNOPSIS

B<mkdsklsnode [-h|--help ]>

B<mkdsklsnode [-V|--verbose] [-f|--force] [-n|--newname] [-i> I<osimage_name>] [B<-l> I<location>] [B<-u>|B<--updateSN>] [B<-k>|B<--skipsync>] [B<-p>|B<--primarySN>] [B<-b>|B<--backupSN>] [B<-S>|B<--setuphanfs>] I<noderange> [I<attr=val [attr=val ...]>]

=head1 DESCRIPTION

This xCAT command can be used to define and/or initialize AIX/NIM diskless machines. Once this step is completed you can use either the xCAT B<rnetboot> command or the B<rbootseq/rpower> commands to initiate a network boot of the nodes.

The command can be used to define and initialize a new NIM machine object or it can be used to reinitialize an existing machine to use a different operating system image.

This command will also create a NIM resolv_conf resource to be used when installing the node.  If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes.

The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority.

The "search" field of the resolv.conf file will contain a list all the domains
listed in the xCAT network definitions and the xCAT site definition.

The "nameservers" value can either be set to a specific IP address or the "<xcatmaster>" key word.  The "<xcatmaster>" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file.  (I.e.  The name of the install server as known by the node.)

You can set the "domain" and "nameservers" attributes by using the B<chdef> command.  For example:

=over 3

chdef -t network -o clstr_net domain=cluster.com nameservers=<xcatmaster>

=back

If the "domain" and "nameservers" attributes are not set in either the nodes "network" definition or the "site" definition then no new NIM resolv_conf resource will be created.

If you are using xCAT service nodes the B<mkdsklsnode> command will automatically determine the correct server(s) for the node and create the NIM definitions on that server(s).

When creating a new NIM machine definition the default is to use the same name as the xCAT node name that is provided.

You can use the "-n" option of the mkdsklsnode command to create and initialize an alternate NIM machine definition for the same physical nodes. This option allows you to set up a new image to use when a node is next rebooted while the node is currently running.  This is possible because the NIM name for a machine definition does not have to be the hostname of the node.  This allows you to have multiple NIM machine definitions for the same physical node. The naming convention for the new NIM machine name is "<xcat_node_name>_<image_name>", (Ex. "node01_61spot"). Since all the NIM initialization can be done while the node is running the downtime for for the node is reduced to the time it takes to reboot.

B<Note:> When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes.  The NIM resources should not be shared between the old osimage and the new osimage.

You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running.

After the mkdsklsnode command completes you can use the B<lsnim> command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l <nim_node_name>").

You can supply your own scripts to be run on the management node  or on the service node (if their is hierarchy) for a node during the B<mkdsklsnode> command. Such scripts are called B<prescripts>. They should be copied to /install/prescripts directory. A table called I<prescripts> is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B<mkdsklsnode> command are stored in the 'begin' column of I<prescripts> table. The scripts to be run at the end of the B<mkdsklsnode> command are stored in the 'end' column of I<prescripts> table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I<diskless:myscript1,myscript2>. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I<number> of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes.


=head1 OPTIONS

=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. These are used to specify additional values that can be passed to the underlying NIM commands.

Valid values:

=over 3

=item B<duplex>

Specifies the duplex setting (optional). Used when defining the NIM machine. Use this setting to configure the client's network interface. This value can be full or half. The default is full. (ex. "duplex=full")

=item B<speed>

Specifies the speed setting (optional). Used when defining the NIM machine. This is the communication speed to use when configuring the client's network interface. This value can be 10, 100, or 1000. The default is 100. (ex. "speed=100")

=item B<psize>

Specifies the size in Megabytes of the paging space for the diskless node.(optional) Used when initializing the NIM machine. The minimum and default size is 64 MB of paging space. (ex. "psize=256")

=item B<sparse_paging>

Specifies that the paging file should be created as an AIX sparse file, (ex. "sparse_paging=yes").  The default is "no".

=item B<dump_iscsi_port>

The tcpip port number to use to communicate dump images from the client to the dump	resource server. Normally set by default. This port number is used by a dump resource server.

=item B<configdump>

Specifies the type dump to be collected from the client.  The values are
"selective", "full", and "none".  If the configdump attribute is set to "full"
or "selective" the client will automatically be configured to dump to an iSCSI
target device. The "selective" memory dump will avoid dumping user data. The
"full" memory dump will dump all the memory of the client partition. Selective
and full memory dumps will be stored in subdirectory of the dump resource
allocated to the client. This attribute is saved in the xCAT osimage
definition.

=back

=item B<-b |--backupSN>

When using backup service nodes only update the backup.  The default is to update both the primary and backup service nodes.

=item B<-f |--force>

Use the force option to reinitialize the NIM machines.

=item B<-h |--help>

Display usage message.

=item B<-i> I<image_name>

The name of an existing xCAT osimage definition. If this information is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute. If the "-i" value is provided on the command line then that value will be used to set the "provmethod" attribute of the node definitions.

=item B<-k|--skipsync>

Use this option to have the mkdsklsnode command skip the NIM sync_roots operation.  This option should only be used if you are certain that the shared_root resource does not have to be updated from the SPOT.  Normally, when the SPOT is updated, you should do a sync_roots on the shared_root resource.

=item B<-l|--location>

The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim.

=item B<-n|--newname>

Create a new NIM machine object name for the xCAT node. Use the naming convention "<xcat_node_name>_<image_name>" for the new NIM machine definition.

=item B<-p|--primarySN>

When using backup service nodes only update the primary.  The default is to update both the primary and backup service nodes.

=item B<-S|--setuphanfs>

Setup NFSv4 replication between the primary service nodes and backup service nodes to provide high availability NFS for the compute nodes. This option only exports the /install directory with NFSv4 replication settings, the data synchronization between the primary service nodes and backup service nodes needs to be taken care of through some mechanism.

=item B<-u|--updateSN>

Use this option if you wish to update the osimages but do not want to define or initialize the NIM client definitions. This option is only valid when the xCAT "site" definition attribute "sharedinstall" is set to either "sns" or "all".

=item I<noderange>

A set of comma delimited node names and/or group names. See the "noderange" man page for details on additional supported formats.

=item B<-V |--verbose>

Verbose mode.

=back

=head1 RETURN VALUE

=over 3

=item 0
The command completed successfully.

=item 1
An error has occurred.

=back

=head1 EXAMPLES

=over 3

=item 1.
Initialize an xCAT node named "node01" as an AIX diskless machine.  The xCAT osimage named "61spot" should be used to boot the node.

 mkdsklsnode -i 61spot node01

=item 2.
Initialize all AIX diskless nodes contained in the xCAT node group called "aixnodes" using the image definitions pointed to by the "provmethod" attribute of the xCAT node definitions.

 mkdsklsnode aixnodes

=item 3.
Initialize diskless node "clstrn29" using the xCAT osimage called "61dskls".  Also set the paging size to be 128M and specify the paging file be an AIX sparse file.

 mkdsklsnode -i 61dskls clstrn29 psize=128 sparse_paging=yes

=item 4.
Initialize an xCAT node called "node02" as an AIX diskless node.  Create a new NIM machine definition name with the osimage as an extension to the xCAT node name.

 mkdsklsnode -n -i 61spot node02

=back

=head1 FILES

/opt/xcat/bin/mkdsklsnode

=head1 NOTES

This command is part of the xCAT software product.

=head1 SEE ALSO

L<rmdsklsnode(1)|rmdsklsnode.1>


