2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 00:00:12 +00:00

Add postscript execution summary

This commit is contained in:
Mark Gurevich
2021-02-10 11:49:08 -05:00
parent a5f376ae23
commit 9918b96ffe
9 changed files with 73 additions and 23 deletions

View File

@ -61,7 +61,7 @@ Now set some of the common attributes for the SNs at the group level: ::
provmethod=rhels7-x86_64-install-service
Add Service Nodes to the ``servicenode`` Table
------------------------------------------
----------------------------------------------
An entry must be created in the ``servicenode`` table for each service node or the
**service** group. This table describes all the services you would like xcat to

View File

@ -1,8 +1,5 @@
.. _Using-Postscript-label:
Using Postscript
----------------
xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes.
Types of scripts
@ -358,7 +355,7 @@ THE ``#NETWORK_FOR_DISKLESS_EXPORT#`` line will provide diskless networks inform
..
#NETWORK_FOR_DISKLESS_EXPORT#
Note: the ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode <nodename> -P syslog``.
.. note:: The ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode <nodename> -P syslog``.
The ``#INCLUDE_POSTSCRIPTS_LIST#`` flag provides a list of postscripts defined for this ``$NODE``. ::

View File

@ -26,7 +26,7 @@ Identify the scripts to be run for each node by adding entries to the prescripts
Format for naming prescripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The general format for the prescripts-begin or prescripts-end attribute is: ::
The general format for the ``prescripts-begin`` or ``prescripts-end`` attribute is: ::
[action1:]s1,s2...[|action2:s3,s4,s5...]
@ -42,19 +42,17 @@ If actions are omitted, the scripts apply to all actions.
Examples:
* myscript1,myscript2 - run scripts for all supported commands
* install:myscript1,myscript2|netboot:myscript3
* ``myscript1,myscript2`` - run scripts for all supported commands
* ``install:myscript1,myscript2|netboot:myscript3`` - Run scripts ``myscript1`` and ``myscript2`` for nodeset(install), runs ``myscript3`` for nodeset(netboot).
Run scripts 1,2 for nodeset(install), runs script3 for nodeset(netboot).
All the scripts should be copied to /install/prescripts directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local /install directory (i.e. /install is not mounted from the xCAT management node to the service nodes), you will need to synchronize your /install/prescripts directory to your service node anytime you create new scripts or make changes to existing scripts.
All the scripts should be copied to ``/install/prescripts`` directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local ``/install`` directory (i.e. ``/install`` is not mounted from the xCAT management node to the service nodes), you will need to synchronize your ``/install/prescripts`` directory to your service node anytime you create new scripts or make changes to existing scripts.
The following two environment variables will be passed to each script:
* NODES - a comma separated list of node names on which to run the script
* ACTION - current nodeset action.
* ``NODES`` - a comma separated list of node names on which to run the script
* ``ACTION`` - current nodeset action.
By default, the script will be invoked once for all nodes. However, if **'#xCAT setting:MAX_INSTANCE=number'** is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in **number** will be invoked at at a time.
By default, the script will be invoked once for all nodes. However, if ``#xCAT setting:MAX_INSTANCE=<number>`` is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in ``<number>`` will be invoked at a time.
Exit values for prescripts
~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -67,7 +65,7 @@ If there is no error, a prescript should return with 0. If an error occurs, it s
If one of the prescripts returns 1, the command will finish the rest of the prescripts in that section and then exit out with value 1. For example, a node has three begin prescripts s1,s2 and s3, three end prescripts s4,s5,s6. If s2 returns 1, the prescript s3 will be executed, but other code and the end prescripts will not be executed by the command.
If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have **'#xCAT setting:MAX_INSTANCE=number'**.
If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have ``#xCAT setting:MAX_INSTANCE=<number>``.

View File

@ -72,7 +72,7 @@ You can use the ``updatenode`` command to perform the following functions after
* Rerun postscripts defined in the postscripts table.
* Run any additional postscript one time.
Go to :ref:`Using-Postscript-label` to see how to configure postscript.
Go to :ref:`Using Postscript <Using-Postscript-label>` to see how to configure postscript.
Go to :ref:`Using-Prescript-label` to see how to configure prepostscript.

View File

@ -0,0 +1,27 @@
Using Postscript
----------------
Postscript Execution Order Summary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------------------------------------------------------------------+
| Diskful |
+----------------+-------------------------+----------------------------------------+
| Stage | Scripts | Execute Order |
+================+=========================+========================================+
| N/A | postinstall | Does not execute for diskfull install |
+----------------+-------------------------+---+------------------------------------+
| Install/Create | | 1 | postscripts.xcatdefaults |
| | +---+------------------------------------+
| | postscripts | 2 | osimage |
| | (execute before reboot) +---+------------------------------------+
| | | 3 | node |
+----------------+-------------------------+---+------------------------------------+
| Boot/Reboot | postbootscripts | 4 | postscripts.xcatdefaults |
| | +---+------------------------------------+
| | | 5 | osimage |
| | +---+------------------------------------+
| | | 6 | node |
+----------------+-------------------------+---+------------------------------------+
.. include:: ../../../common/deployment/prepostscripts/post_script.rst

View File

@ -5,6 +5,6 @@ Prescripts and Postscripts
:maxdepth: 2
../../../common/deployment/prepostscripts/pre_script.rst
../../../common/deployment/prepostscripts/post_script.rst
./postscript_execution.rst
../../../common/deployment/prepostscripts/suggestions.rst

View File

@ -0,0 +1,28 @@
Using Postscript
----------------
Postscript Execution Order Summary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---------------------------------------------------------------------------+
| Diskless |
+----------------+-----------------+----------------------------------------+
| Stage | Scripts | Execute Order |
+================+=================+========================================+
| Install/Create | postinstall | genimage, after packages are installed |
+----------------+-----------------+---+------------------------------------+
| Boot/Reboot | | 1 | postscripts.xcatdefaults |
| | +---+------------------------------------+
| | postscripts | 2 | osimage |
| | +---+------------------------------------+
| | | 3 | node |
| +-----------------+---+------------------------------------+
| | postbootscripts | 4 | postscripts.xcatdefaults |
| | +---+------------------------------------+
| | | 5 | osimage |
| | +---+------------------------------------+
| | | 6 | node |
+----------------+-----------------+---+------------------------------------+
.. include:: ../../../common/deployment/prepostscripts/post_script.rst

View File

@ -5,7 +5,7 @@ Prescripts and Postscripts
:maxdepth: 2
../../../common/deployment/prepostscripts/pre_script.rst
../../../common/deployment/prepostscripts/post_script.rst
./postscript_execution.rst
../../../common/deployment/prepostscripts/postinstall_script.rst
../../../common/deployment/prepostscripts/suggestions.rst

View File

@ -19,7 +19,7 @@ Open a console to ``compute1``: ::
rcons compute1
**Note:** The keystroke ``ctrl+e c .`` will disconnect you from the console.
.. note:: The keystroke ``ctrl+e c .`` will disconnect you from the console.
Troubleshooting
@ -30,14 +30,14 @@ General
``xCAT`` has been integrated with 3 kinds of console server service, they are
- `conserver <http://www.conserver.com/>`_
- `conserver <http://www.conserver.com/>`_ **[Deprecated]**
- `goconserver <https://github.com/xcat2/goconserver/>`_
- `confluent <https://github.com/xcat2/confluent/>`_
``rcons`` command relies on one of them. The ``conserver`` and ``goconserver``
packages should have been installed with xCAT as they are part of the xCAT
dependency packages. If you hope to try ``confluent``,
see `confluent </advanced/confluent/>`_.
dependency packages. If you want to try ``confluent``,
see :doc:`confluent server </advanced/confluent/server/confluent_server>`.
For systemd based systems, ``goconserver`` is used by default. If you are
having problems seeing the console, try the following.
@ -56,7 +56,7 @@ having problems seeing the console, try the following.
#. Invoke the console again: ``rcons <node>``
More details for goconserver, see `goconserver documentation </advanced/goconserver/>`_.
More details for goconserver, see :doc:`goconserver documentation </advanced/goconserver/index>`.
**[Deprecated]** If ``conserver`` is used, try the following.