2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-21 19:22:05 +00:00

Updating document for "chain"

This commit is contained in:
ertaozh 2015-11-29 22:28:20 -05:00
parent da3bb3038e
commit 5b5b32f664
11 changed files with 51 additions and 41 deletions

View File

@ -1,9 +1,14 @@
Understand chain table
======================
Understanding chain table
=========================
The **chain** table is designed to store the tasks(For example: 'runcmd=bmcsetup', 'runimage=<URL>', 'osimage=<image name>', 'install', 'boot', 'shell', 'standby' ...). There are three related attributes **currstate**,**currchain** and **chain** in the chain table which are used to perform the **chain** mechanism.
The chain table (``tabdump chain``) is an xCAT database table that holds the chain configuration. The following attributes can be defined to perform the chain function: ::
When genesis is running on the node, it will sends 'get_task/get_next_task' request to xcatd. Then, xcatd will first copies the **chain** attribute to the **currchain** attribute, then pops one task from the **currchain** attribute and puts it into the **currstate** attribute. The **currstate** attribute will be send back to the node as the current task. The **currstate** attribute always shows the current task that is running.
* currstate
* currchain
* chain
The pop function will continue if another 'get_next_task' request got by xCAT. It will continue until all tasks in the **currchain** attribute are completed (removed) then a 'standby' task will be send back. Then the node will standby for random time and send out 'get_task' again. It will keep in standby state until there is new task assign in ``chain`` for the node.
To know how are those three attributes used, pls reference the picture:
.. image:: chain_tasks_logic.png

View File

@ -3,38 +3,43 @@ Task Type
xCAT supports following types of task which could be set in the chain:
* runcmd::
* runcmd ::
runcmd=<cmd>
Currently only the ``bmcsetup`` command is officially supplied by xCAT to run to configure the bmc of the compute node. You can find the ``bmcsetup`` in /opt/xcat/share/xcat/netboot/genesis/<arch>/fs/bin/. You also could create your command in this directory and adding it to be run by ``runcmd=<you cmd>``. ::
e.g. runcmd=bmcsetup
runcmd=bmcsetup
**Note**: the command ``mknb <arch>`` is needed before reboot the node.
* runimage::
* runimage ::
runimage=<URL>
runimage=<URL>
**URL** is a string which can be run by ``wget`` to download the image from the URL. The example could be: ::
runimage=http://$MASTER/<dir>/image.tgz
runimage=http://<IP of xCAT Management Node>/<dir>/image.tgz
The image.tgz should can be uncompressed by ``tar xvf image.tgz``. And image.tgz should include a file named ``runme.sh`` which is a script to initiate the running of the image. Pls reference :ref:`creating image for runimage <create_image_for_runimage>` for more information about creating your own ``image``.
The ``image.tgz`` **must** have the following properties:
* Created using the ``tar zcvf`` command
* The tarball must include a ``runme.sh`` script to initiate the execution of the runimage
**Note**: You could try to run ``wget http://$MASTER/<dir>/image.tgz`` manually to make sure the path has been set correctly.
To create your own image, please reference :ref:`creating image for runimage <create_image_for_runimage>`.
* osimage::
**Tip**: You could try to run ``wget http://<IP of xCAT Management Node>/<dir>/image.tgz`` manually to make sure the path has been set correctly.
* osimage ::
osimage=<image name>
This task is used to specify that the compute node should run the OS deployment with osimage=<image name>.
This task is used to specify the image that should be deployed onto the compute node.
* shell
Make the genesis gets into the shell for admin to log in and run command.
Causes the genesis kernel to create a shell for the administrator to log in and execute commands.
* standby
Make the genesis gets into standby and waiting for the task from chain. If the compute node gets into this state, any new task set to chain.currstate will be run immediately.
Causes the genesis kernel to go into standby and wait for tasks from the chain. ...

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -18,22 +18,25 @@ How to prepare a image for ``runimage`` in ``chain``
* Create the directory for the image: ::
#mkdir -p /install/my_image
mkdir -p /install/my_image
* Go to the direcotry and copy the rpm file into it: ::
#cd /install/my_image
#cp /tmp/a.rpm /install/my_image
cd /install/my_image
cp /tmp/a.rpm /install/my_image
* Write the runme.sh script and modify the permission: ::
#cat runme.sh
echo "start installing a.rpm"
rpm -ivh a.rpm
#chmod +x runme.sh
cat runme.sh
echo "start installing a.rpm"
rpm -ivh a.rpm
* modify the runme.sh script permission: ::
chmod +x runme.sh
* Create the tar ball for the directory: ::
#tar -zcvf my_image.tar .
tar -zcvf my_image.tgz .

View File

@ -1,7 +1,7 @@
Chain
=====
In xCAT, we introduced the **chain** mechanism which means a series of tasks that had been defined in it can be done one by one on the specified node.
The **chain** mechanism is created to allow the administrator to define a series of tasks or operations that will be executed in series on the target node.
The **chain** mechanism is implemented in xCAT genesis system. The genesis is a customized Linux system, if can be used to do discovery and configuration after booted on the specified node.

View File

@ -1,9 +1,9 @@
Run Task List During Discovery
==============================
If you want to run a list of tasks during the discovery, set the tasks in the chain table by using the chdef command to change the chain attribute, before powering on the nodes. For example: ::
To run a list of tasks during the discovery, set the tasks in the chain table by using the ``chdef`` command to change the chain attribute, before powering on the nodes. For example: ::
chdef <node range> chain='runcmd=bmcsetup,osimage=<osimage name>'
chdef <noderange> chain='runcmd=bmcsetup,osimage=<osimage name>'
These tasks will be run after the discovery.

View File

@ -1,12 +1,11 @@
Run Task List to Configure a Node
=================================
Run the ``nodeset`` command to set the tasks for the compute node and ``rpower <node> reset`` to initiate the running of tasks. ::
Run the ``nodeset`` command to set the tasks for the compute node and ``rpower <noderange> reset`` to initiate the running of tasks. ::
nodeset $node runimage=http://$MASTER/image.tgz,osimage=<image_name>
rpower $node reset
nodeset <noderange> runimage=http://<IP of xCAT Management Node>/image.tgz,osimage=<image_name>
rpower <noderange> reset
In this example, the ``runimage`` will be run first, and then the image <image_name> will be deployed to the node.
During ``nodeset`` your request is put into the ``currstate`` attribute. The ``chain`` attribute is not used. The task in the ``currstate`` attribute will be passed to genesis and executed. If additional tasks are defined in the ``currchain`` attribute, these tasks will be run after the tasks in the ``currstate`` attribute are run.

View File

@ -4,20 +4,20 @@ Advanced Topics
.. toctree::
:maxdepth: 2
confluent/index.rst
cluster_maintenance/index.rst
chain/index.rst
cluster_maintenance/index.rst
confluent/index.rst
docker/index.rst
gpu/index.rst
hamn/index.rst
hierarchy/index.rst
kit/index.rst
mixed_cluster/index.rst
networks/index.rst
ports/xcat_ports.rst
raid/index.rst
security/index.rst
softlayer/index.rst
kit/index.rst
switches/index.rst
sysclone/index.rst
webservices/index.rst

View File

@ -51,13 +51,11 @@ The server definition will be like this::
After the physical server is defined into xCATdb, the next thing is update the node definition with the example node attributes::
# chdef cn1 ip=10.0.101.1
1 object definitions have been created or modified.
chdef cn1 ip=10.0.101.1
In order to do BMC configuration during the discovery progress, the following command is needed, for more info about chain, pls refer the **Chain** document in **Advanced Topics** chapter::
In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. For more info about chain, please refer to :doc:`Chain <../../../../../advanced/chain/index>` ::
# chdef cn1 chain="runcmd=bmcsetup"
1 object definitions have been created or modified.
chdef cn1 chain="runcmd=bmcsetup"
Then, add node info into /etc/hosts and DNS::

View File

@ -18,7 +18,7 @@ Predefine a group of nodes with desired IP address for host and IP address for F
nodeadd cn1 groups=powerLE,all
chdef cn1 mgt=ipmi cons=ipmi ip=10.0.101.1 bmc=50.0.101.1 netboot=petitboot installnic=mac primarynic=mac
In order to do BMC configuration during the discovery progress, the following command is needed, for more info about chain, pls refer the **Chain** document in **Advanced Topics** chapter::
In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. For more info about chain, please refer to :doc:`Chain <../../../../../advanced/chain/index>` ::
chdef cn1 chain="runcmd=bmcsetup"

View File

@ -52,7 +52,7 @@ After switches are defined, the server node can be predefined with the following
chdef cn1 mgt=ipmi cons=ipmi ip=10.0.101.1 bmc=50.0.101.1 netboot=petitboot installnic=mac primarynic=mac
chdef cn1 switch=switch1 switchport=0
In order to do BMC configuration during the discovery progress, the following command is needed, for more info about chain, pls refer the **Chain** document in **Advanced Topics** chapter::
In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. For more info about chain, please refer to :doc:`Chain <../../../../../advanced/chain/index>` ::
chdef cn1 chain="runcmd=bmcsetup"