mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-05-17 19:57:18 +00:00
Merge pull request #6186 from xcat2/master
Merge master to 2.14 branch for 2.14.6 release
This commit is contained in:
@@ -4,6 +4,7 @@ Arif Ali <mail@arif-ali.co.uk>
|
||||
Arif Ali <mail@arif-ali.co.uk> <arifali@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
|
||||
Arif Ali <mail@arif-ali.co.uk> <arif-ali@users.noreply.github.com>
|
||||
BAI Yuan <bybai@cn.ibm.com>
|
||||
BAI Yuan <bybai@cn.ibm.com> <root@byubu01.cluster.com>
|
||||
Bill Wajda <billwajda@hotmail.com> <billwajda@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
|
||||
Bill Wajda <billwajda@hotmail.com>
|
||||
Brian Elliott Finley <brian@thefinleys.com> <brianfinley@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
|
||||
|
||||
@@ -189,7 +189,7 @@ xCAT includes a script, ``cuda_power9_setup`` as example, to help user handle th
|
||||
Diskful osimage
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postbootscrtips list. ::
|
||||
For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postscripts list. ::
|
||||
|
||||
chdef p9compute -p postscripts=cuda_power9_setup
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ If you had the following two service nodes: ::
|
||||
|
||||
You would add the following to ``/var/lib/pgsql/data/pg_hba.conf`` ::
|
||||
|
||||
host all all 192.168.1.10/24 md5
|
||||
host all all 192.168.1.11/24 md5
|
||||
host all all 192.168.1.10/32 md5
|
||||
host all all 192.168.1.11/32 md5
|
||||
|
||||
Restart PostgreSQL after editing the file: ::
|
||||
|
||||
|
||||
@@ -61,59 +61,63 @@ dhcp should be restarted after seting up dynamic IP range.
|
||||
Discover Switches
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
xCAT supports **switchdiscover** command to discover the switches that are attached to the subnets on xCAT management node. Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info.
|
||||
.. note:: Only BNT and Mellanox switches are supported for switch-based switch discovery
|
||||
|
||||
For the switch-based switch discovery, we add **–setup** flag: ::
|
||||
xCAT can automatically discover switches that are connected to the defined subnets from the management node using the ``switchdiscover`` command.
|
||||
|
||||
For switch-based switch discovery, use the ``--setup`` option::
|
||||
|
||||
|
||||
switchdiscover [noderange|--range ip_ranges][-s scan_methods] [--setup]
|
||||
|
||||
|
||||
if **--setup** flag is specified, the command will perform following steps:
|
||||
The ``--setup`` option will perform the following steps:
|
||||
|
||||
1. Use snmp or nmap scan methods to find all switches in the dynamic IP ranges specified by --range, the available switches will be stored in switch hash table with hostname, switchtype, vendor info and mac address.
|
||||
1. Scan the IP range using ``snmp`` or ``nmap`` to find all switches that respond. The available switches will be stored into the switch hash table with ``hostname``, ``switchtype``, ``mac``, and vendor information.
|
||||
|
||||
2. Based on MAC address for each switch defined in the hash table, call **find_mac** subroutine. The **find_mac** subroutine will go thought the switch and switch ports and find matched mac address.
|
||||
|
||||
* If discovered switch didn't find any predefined switch matches, it will log the message ``NO predefined switch matched``.
|
||||
* If discovered switch matched with one of pre-defined switch, it will update the predefined switch with ::
|
||||
|
||||
otherinterface=x.x.x.x (discovered ip)
|
||||
state=matched
|
||||
switchtype=type of switch
|
||||
usercomment=vendor information
|
||||
|
||||
|
||||
2. Based on mac address for each switch defined in the hash table, call **find_mac** subroutine. The **find_mac** subroutine will go thought the switch and switch ports and find matched mac address.
|
||||
3. If the switches are matched, the ``switchdiscover`` command will execute the following scripts to configure static IP address, hostname, and enable the snmpv3.
|
||||
|
||||
* If discovered switch didn't find any predefined switch matches, it will log the message ``NO predefined switch matched``.
|
||||
* If discovered switch matched with one of pre-defined switch, it will update the predefined switch with ::
|
||||
* ``/opt/xcat/share/xcat/scripts/configBNT``
|
||||
* ``/opt/xcat/share/xcat/scripts/configMellanox``
|
||||
|
||||
otherinterface=x.x.x.x (discovered ip)
|
||||
state=matched
|
||||
switchtype=type of switch
|
||||
usercomment=vendor information
|
||||
4. After discovery process the predefined node attribute in the xCAT database will be updated. ::
|
||||
|
||||
lsdef switch-192-168-5-22
|
||||
groups=switch
|
||||
ip=192.168.5.22
|
||||
mac=a8:97:dc:02:92:00
|
||||
mgt=switch
|
||||
nodetype=switch
|
||||
password=admin
|
||||
postbootscripts=otherpkgs
|
||||
postscripts=syslog,remoteshell,syncfiles
|
||||
protocol=telnet
|
||||
snmpauth=sha
|
||||
snmppassword=xcatadminpassw0rd@snmp
|
||||
snmpusername=xcatadmin
|
||||
snmpversion=3
|
||||
status=hostname_configured
|
||||
statustime=08-31-2016 15:35:49
|
||||
supportedarchs=ppc64
|
||||
switch=switch-10-5-23-1
|
||||
switchport=45
|
||||
switchtype=BNT
|
||||
usercomment=IBM Networking Operating System RackSwitch G8052
|
||||
username=root
|
||||
|
||||
|
||||
3. After switches are matched, the command will call config files to set up static IP address, hostname and enable the snmpv3. Currently, BNT and Mellanox switches are supported. The two config files are located in the **/opt/xcat/share/xcat/scripts/config.BNT** and **/opt/xcat/share/xcat/scripts/config.Mellanox**. the log message ``the switch type is not support for config`` is displayed if switchtype is something other than BNT or Mellanox.
|
||||
|
||||
4. After discovery process, the predefined node attribute in the xCATdb will be updated.
|
||||
|
||||
::
|
||||
|
||||
lsdef switch-192-168-5-22
|
||||
groups=switch
|
||||
ip=192.168.5.22
|
||||
mac=a8:97:dc:02:92:00
|
||||
mgt=switch
|
||||
nodetype=switch
|
||||
password=admin
|
||||
postbootscripts=otherpkgs
|
||||
postscripts=syslog,remoteshell,syncfiles
|
||||
protocol=telnet
|
||||
snmpauth=sha
|
||||
snmppassword=xcatadminpassw0rd@snmp
|
||||
snmpusername=xcatadmin
|
||||
snmpversion=3
|
||||
status=hostname_configured
|
||||
statustime=08-31-2016 15:35:49
|
||||
supportedarchs=ppc64
|
||||
switch=switch-10-5-23-1
|
||||
switchport=45
|
||||
switchtype=BNT
|
||||
usercomment=IBM Networking Operating System RackSwitch G8052
|
||||
username=root
|
||||
|
||||
.. tip:: Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info.
|
||||
|
||||
|
||||
Configure switches
|
||||
|
||||
@@ -8,21 +8,13 @@ The configuration is stored in the xCAT site table using the ``site.xcatsslversi
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
By default, xCAT ships with ``TLSv1`` configured. The current highest SSL version that can be supported is ``TLSv1.2``.
|
||||
``site.xcatsslversion`` is the ``SSL_version`` option ``xcatd`` used and passed to ``IO::Socket::SSL->start_SSL()``. By default, this value is set to empty. In this case, ``xcatd`` will use ``SSLv23:!SSLv2:!SSLv3:!TLSv1`` internally. For more detail, see https://metacpan.org/pod/IO::Socket::SSL
|
||||
By default, xCAT ships with an empty value for ``site.xcatsslversion``. In this case, ``xcatd`` will use ``SSLv23:!SSLv2:!SSLv3:!TLSv1`` internally.
|
||||
|
||||
* For rhels7.x and sles12.x and higher: ::
|
||||
|
||||
chtab key=xcatsslversion site.value=TLSv12
|
||||
|
||||
* For ubuntu 14.x and higher: ::
|
||||
Here is an example of change ``site.xcatsslversoin`` to a different value. Say, TLS 1.2 is preferred. ::
|
||||
|
||||
chtab key=xcatsslversion site.value=TLSv1_2
|
||||
|
||||
* For AIX 7.1.3.x: ::
|
||||
|
||||
chtab key=xcatsslversion site.value=TLSv1_2
|
||||
|
||||
|
||||
If running > ``TLSv1``, it is possible to disable insecure ciphers. Here's an example of one possible configuration: ::
|
||||
|
||||
"xcatsslciphers","kDH:kEDH:kRSA:!SSLv3:!SSLv2:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!EXPORT:!CAMELLIA:!ECDH",,
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'xCAT'
|
||||
copyright = u'2015, IBM Corporation'
|
||||
copyright = u'2015-2019, IBM Corporation'
|
||||
author = u'IBM Corporation'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
@@ -59,7 +59,7 @@ author = u'IBM Corporation'
|
||||
# The short X.Y version.
|
||||
version = '2'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '2.14.5'
|
||||
release = '2.14.6'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
By default, xCAT will install the operating system on the first disk and with default partitions layout in the node. However, you may choose to customize the disk partitioning during the install process and define a specific disk layout. You can do this in one of two ways: '**partition definition file**' or '**partition definition script**'.
|
||||
|
||||
**Notes**
|
||||
.. note:: ``partition definition file`` can be used for RedHat, SLES, and Ubuntu. Because disk configuraiton for Ubuntu is different from RedHat, there may be some special sections required for Ubuntu.
|
||||
|
||||
.. warning:: ``partition definition script`` has only been tested on RedHat and Ubuntu, use at your own risk for SLES.
|
||||
|
||||
+5
@@ -1,6 +1,8 @@
|
||||
Configure Additional Network Interfaces old version - confignics - (deprecated)
|
||||
===============================================================================
|
||||
|
||||
**"confignics" is deprecated, recommend using new version "confignetwork" instead.**
|
||||
|
||||
The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed.
|
||||
|
||||
The way the confignics postscript decides what IP address to give the secondary adapter is by checking the nics table, in which the nic configuration information is stored.
|
||||
@@ -74,12 +76,15 @@ Use command below to add confignics into the node's postscripts list ::
|
||||
|
||||
chdef cn1 -p postscripts=confignics
|
||||
|
||||
**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts=confignetwork`` instead above ``chdef`` command.
|
||||
|
||||
By default, confignics does not configure the install nic. if need, using flag "-s" to allow the install nic to be configured. ::
|
||||
|
||||
chdef cn1 -p prostscripts="confignics -s"
|
||||
|
||||
Option "-s" writes the install nic's information into configuration file for persistence. All install nic's data defined in nics table will be written also.
|
||||
|
||||
**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts="confignetwork -s"`` instead above ``chdef`` command.
|
||||
|
||||
Add network object into the networks table
|
||||
------------------------------------------
|
||||
|
||||
+10
-15
@@ -1,9 +1,7 @@
|
||||
Synchronizing Files during the installation process
|
||||
----------------------------------------------------
|
||||
---------------------------------------------------
|
||||
|
||||
The policy table must have the entry to allow syncfiles postscript to access the Management Node. Make sure this entry is in your table:
|
||||
|
||||
``tabdump policy`` ::
|
||||
The **policy** table must have the entry to allow **syncfiles** postscript to access the Management Node. Make sure this entry is in your **policy** table: ::
|
||||
|
||||
#priority,name,host,commands,noderange,parameters,time,rule,comments,disable
|
||||
.
|
||||
@@ -15,23 +13,21 @@ The policy table must have the entry to allow syncfiles postscript to access the
|
||||
Hierarchy and Service Nodes
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes (compute) that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1. Note: the noderange is the compute node names, updatenode will figure out which service nodes need updating.
|
||||
If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes **compute** that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1.::
|
||||
|
||||
``updatenode compute -f``
|
||||
updatenode compute -f
|
||||
|
||||
.. note:: ``updatenode`` will figure out which service nodes need updating.
|
||||
|
||||
Diskful installation
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
The 'syncfiles' postscript is in the defaults section of the postscripts table. To enable the syn files postscript to sync files to the nodes during install the user need to do the following:
|
||||
The **syncfiles** postscript is in the defaults section of the **postscripts** table. To enable the **syncfiles** postscript to sync files to the nodes during install the user need to do the following:
|
||||
|
||||
* Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label` )
|
||||
* Put the synclist into the proper location for the node type (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`)
|
||||
|
||||
Make sure your postscripts table has the syncfiles postscript listed
|
||||
|
||||
``tabdump postscripts`` ::
|
||||
Make sure your **postscripts** table has the syncfiles postscript listed::
|
||||
|
||||
#node,postscripts,postbootscripts,comments,disable
|
||||
"xcatdefaults","syslog,remoteshell,syncfiles","otherpkgs",,
|
||||
@@ -39,9 +35,8 @@ Make sure your postscripts table has the syncfiles postscript listed
|
||||
Diskless Installation
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The diskless boot is similar with the diskful installation for the synchronizing files operation, except that the packimage commands will sync files to the root directories of image during the creating image process.
|
||||
The diskless boot is similar with the diskful installation for the synchronizing files operation, except that the ``packimage`` command will sync files to the root directories of image during the creating image process.
|
||||
|
||||
Creating the synclist file as the steps in Diskful installation section, then the synced files will be synced to the os image during the packimage and mkdsklsnode commands running.
|
||||
Creating the synclist file as the steps in Diskful installation section, then the synced files will be synced to the os image during the ``packimage`` and ``mkdsklsnode`` commands running.
|
||||
|
||||
Also the files will always be re-synced during the booting up of the diskless node.
|
||||
|
||||
|
||||
+11
-9
@@ -1,24 +1,26 @@
|
||||
Overview
|
||||
--------
|
||||
|
||||
Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes.
|
||||
Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the newly-deploying or deployed nodes.
|
||||
|
||||
This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**.
|
||||
This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc** directory, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the files to be synced in a configuration file, called "synclist".
|
||||
|
||||
The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage.
|
||||
The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the unique for each particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage.
|
||||
|
||||
``xdcp`` command supplies the basic Syncing File function. If the **'-F synclist'** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **'-i PATH'** option is specified with **'-F synclist'**, it syncs files to the root image located in the PATH directory. (**Note: the '-i PATH' option is only supported for Linux nodes**)
|
||||
``xdcp`` command supplies the basic Syncing File function. If the **-F synclist** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **-i <install image path>** option is specified with **-F synclist**, it syncs files to the root image located in the <install image path> directory.
|
||||
|
||||
``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are place in an intermediate directory on the service node defined by the SNsyncfiledir attribute in the site table. The default is **/var/xcat/syncfiles**.
|
||||
.. note:: The **-i <install image path>** option is only supported for Linux nodes
|
||||
|
||||
``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are placed in an intermediate directory on the service node defined by the **SNsyncfiledir** attribute in the **site** table. The default is **/var/xcat/syncfiles**.
|
||||
|
||||
Since ``updatenode -F`` calls the ``xdcp`` to handle the Syncing File function, the ``updatenode -F`` also supports the hierarchy.
|
||||
|
||||
For a new-installing nodes, the Syncing File action will be triggered when performing the postscripts for the nodes. A special postscript named **'syncfiles'** is used to initiate the Syncing File process.
|
||||
For a new-installing nodes, the Syncing File action will be triggered when running the postscripts for the nodes. A special postscript named **syncfiles** is used to initiate the Syncing File process.
|
||||
|
||||
The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node.
|
||||
The postscript **syncfiles** is located in the **/install/postscripts/**. When running, it sends a message to the **xcatd** on the management node or service node, then the **xcatd** figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node.
|
||||
|
||||
**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes. You can use the** ``updatenode <computenodes> -f`` **command to sync all the service nodes for range of compute nodes provided.**
|
||||
If installing nodes in a hierarchical configuration, you must sync the service nodes first to make sure they are updated. The compute nodes will be synced from their service nodes. You can use the ``updatenode <computenodes> -f`` command to sync all the service nodes for range of compute nodes provided.
|
||||
|
||||
For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes.
|
||||
For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. While performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and groups the nodes which will be using the same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes.
|
||||
|
||||
|
||||
|
||||
+3
-12
@@ -1,24 +1,15 @@
|
||||
Run the Syncing File action periodically
|
||||
-----------------------------------------
|
||||
----------------------------------------
|
||||
|
||||
If the admins want to run the Syncing File action automatically or periodically, the ``xdcp -F``, ``xdcp -i -F`` and ``updatenode -F`` commands can be used in the script, crontab or FAM directly.
|
||||
|
||||
For example:
|
||||
|
||||
Use the cron daemon to sync files in the **/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist** to the nodegroup 'compute' every 10 minutes by the xdcp command by adding this to crontab. : ::
|
||||
Use the **cron** daemon to sync files in the **/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist** to the nodegroup **compute** every 10 minutes with the **xdcp** command by adding this to **crontab**. : ::
|
||||
|
||||
*/10 * * * * root /opt/xcat/bin/xdcp compute -F /install/custom/<inst_type>/<distro>/<profile>.<distro>.synclist
|
||||
|
||||
Use the cron daemon to sync files for the nodegroup 'compute' every 10 minutes by updatenode command. ::
|
||||
Use the **cron** daemon to sync files for the nodegroup **compute** every 10 minutes with ``updatenode`` command. ::
|
||||
|
||||
*/10 * * * * root /opt/xcat/bin/updatenode compute -F
|
||||
|
||||
** Related To do**
|
||||
Add reference
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+49
-48
@@ -6,7 +6,7 @@ The synclist file
|
||||
.. _The_Format_of_synclist_file_label:
|
||||
|
||||
The Format of synclist file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The synclist file contains the configuration entries that specify where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location of files on the target node.
|
||||
|
||||
The basic entry format looks like following: ::
|
||||
@@ -21,9 +21,9 @@ The ``path_of_dst_file*`` should be the full path of the destination file on tar
|
||||
|
||||
The ``path_of_dst_directory`` should be the full path of the destination directory. Make ``sure path_of_dst_directory`` is not a existing file on target node, otherwise, the file sync with ``updatenode -r /usr/bin/scp`` or ``xdcp -r /usr/bin/scp`` will fail.
|
||||
|
||||
Since the synclist file is for common purpose, the target node need not be configured in it.
|
||||
If no target node is specified, the files will be synced to all nodes in the cluster. See "Support nodes in synclist file" below for how to specify a noderange.
|
||||
|
||||
Example: the following synclist formats are supported:
|
||||
The following synclist formats are supported:
|
||||
|
||||
sync file **/etc/file2** to the file **/etc/file2** on the node (with same file name) ::
|
||||
|
||||
@@ -33,35 +33,35 @@ sync file **/etc/file2** to the file **/etc/file3** on the node (with different
|
||||
|
||||
/etc/file2 -> /etc/file3
|
||||
|
||||
sync file **/etc/file4** to the file **/etc/tmp/file5** on the node( different file name and directory). The directory will be automatically created for you. ::
|
||||
sync file **/etc/file4** to the file **/etc/tmp/file5** on the node (different file name and directory). The directory will be automatically created for you. ::
|
||||
|
||||
/etc/file4 -> /etc/tmp/file5
|
||||
|
||||
sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist, **xdcp** will create it. ::
|
||||
sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist, it will be created. ::
|
||||
|
||||
/etc/file1 /etc/file2 /etc/file3 -> /tmp/etc
|
||||
|
||||
sync file **/etc/file2** to the file /etc/file2 on the node ::
|
||||
sync file **/etc/file2** to the file **/etc/file2** on the node ::
|
||||
|
||||
/etc/file2 -> /etc/
|
||||
|
||||
sync all files in **/home/mikev** to directory **/home/mikev** on the node ::
|
||||
sync all files, including subdirectories, in **/home/mikev** to directory **/home/mikev** on the node ::
|
||||
|
||||
/home/mikev/* -> /home/mikev/
|
||||
or
|
||||
/home/mikev -> /home/mikev/
|
||||
|
||||
Note: Don't try to sync files to the read only directory on the target node.
|
||||
.. note:: Don't try to sync files to the read only directory on the target node.
|
||||
|
||||
An example of synclist file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Assume a user wants to sync files to a node as following, the corresponding entries should be added in a synclist file.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sync the file **/etc/common_hosts** to the two places on the target node: put one to the **/etc/hosts**, the other to the **/tmp/etc/hosts**. Following configuration entries should be added ::
|
||||
|
||||
/etc/common_hosts -> /etc/hosts
|
||||
/etc/common_hosts -> /tmp/etc/hosts
|
||||
|
||||
Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **'.tmpl'** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added ::
|
||||
Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **.tmpl** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added ::
|
||||
|
||||
/tmp/prog1/conf1.tmpl -> /prog1/conf1
|
||||
/tmp/prog1/conf2.tmpl -> /prog1/conf2
|
||||
@@ -80,7 +80,7 @@ Sample synclist file ::
|
||||
/tmp/* -> /tmp/
|
||||
/etc/testfile -> /etc/
|
||||
|
||||
If the above syncfile is performed by the **updatenode/xdcp** commands, or performed in a node installation process, the following files will exist on the target node with the following contents. ::
|
||||
If the above syncfile is used by the ``updatenode``/``xdcp`` commands, or used in a node installation process, the following files will exist on the target node with the following contents. ::
|
||||
|
||||
/etc/hosts(It has the same content with /etc/common_hosts on the MN)
|
||||
/tmp/etc/hosts(It has the same content with /etc/common_hosts on the MN)
|
||||
@@ -93,40 +93,41 @@ If the above syncfile is performed by the **updatenode/xdcp** commands, or perfo
|
||||
Support nodes in synclist file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Note: From xCAT 2.9.2 on AIX and from xCAT 2.12 on Linux, xCAT support a new format for syncfile. The new format is ::
|
||||
Starting with xCAT 2.9.2 on AIX and with xCAT 2.12 on Linux, xCAT supports a new format for syncfile. The new format is ::
|
||||
|
||||
file -> (noderange for permitted nodes) file
|
||||
|
||||
The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specified before the file name ::
|
||||
The noderange can have several formats. Following examples show that **/etc/hosts** file is synced to the nodes which are specified before the file name ::
|
||||
|
||||
/etc/hosts -> (node1,node2) /etc/hosts # The /etc/hosts file is synced to node1 and node2
|
||||
/etc/hosts -> (node1-node4) /etc/hosts # The /etc/hosts file is synced to node1,node2,node3 and node4
|
||||
/etc/hosts -> (node[1-4]) /etc/hosts # The /etc/hosts file is synced to node1, node2, node3 and node4
|
||||
/etc/hosts -> (node1,node[2-3],node4) /etc/hosts # The /etc/hosts file is synced to node1, node2, node3 and node4
|
||||
/etc/hosts -> (group1) /etc/hosts # The /etc/hosts file is synced to nodes in group1
|
||||
/etc/hosts -> (group1,group2) /etc/hosts # The /etc/hosts file is synced to nodes in group1 and group2
|
||||
|
||||
postscript support
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Putting the filename.post in the **rsyncfile** to ``rsync`` to the node is required for hierarchical clusters. It is optional for non-hierarchical cluster.
|
||||
/etc/hosts -> (group1,group2) /etc/hosts # The /etc/hosts file is synced to nodes in group1 and group2
|
||||
|
||||
Advanced synclist file features
|
||||
''''''''''''''''''''''''''''''''''
|
||||
'''''''''''''''''''''''''''''''
|
||||
|
||||
After you define the files to rsync in the syncfile, you can add an **EXECUTEALWAYS** clause in the syncfile. The **EXECUTEALWAYS** clause will list all the postscripts you would always like to run after the files are sync'd, whether or not any file is actually updated. The files in this list must be added to the list of files to rsync, if hierarchical.
|
||||
**EXECUTE**
|
||||
|
||||
For example, your rsyncfile may look like this.
|
||||
.. note:: the path to the file to EXECUTE, is the location of the *.post file on the MN**. ::
|
||||
The **EXECUTE** clause is used to list all the postsync scripts (<filename>.post) you would like to run after the files are synced, only if the file <filename> is updated. For hierarchical clusters, the postsync files in this list must also be added to the list of files to sync. It is optional for non-hierarchical clusters. If noderange is used in the synclist for the file listed in the **EXECUTE** clause, the postsync script will only be executed on the nodes in that noderange. The **EXECUTE** clause is not supported oif ``-r /usr/bin/scp`` option is used with ``xdcp`` or ``updatenode`` command.
|
||||
|
||||
**EXECUTEALWAYS**
|
||||
|
||||
The **EXECUTEALWAYS** clause is used to list all the postsync scripts you would like to run after the files are synced, whether or not any file is actually updated. The files in this list must be added to the list of files to sync. If noderange is used in the synclist for the file listed in the **EXECUTEALWAYS** clause, the script will only be exectuted on the nodes in that noderange.
|
||||
|
||||
.. note:: The path to the file to EXECUTE or EXECUTEALWAYS, is the location of the file on the MN.
|
||||
|
||||
For example, your syncfile may look like this.::
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post (required for hierarchical clusters)
|
||||
/tmp/share/file3 -> /tmp/file3
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post (required for hierarchical clusters)
|
||||
/tmp/myscript1 -> /tmp/myscript1
|
||||
/tmp/myscript2 -> /tmp/myscript2
|
||||
# the below are postscripts
|
||||
# Postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
@@ -134,9 +135,9 @@ For example, your rsyncfile may look like this.
|
||||
/tmp/myscript1
|
||||
/tmp/myscript2
|
||||
|
||||
If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2**.post is automatically run on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3**.post is automatically run on that node.
|
||||
If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2.post** is automatically executed on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3.post** is automatically executed on that node.
|
||||
|
||||
You can add an **APPEND** clause to your syncfile.
|
||||
**APPEND**
|
||||
|
||||
The **APPEND** clause is used to append the contents of the input file to an existing file on the node. The file to be appended must already exist on the node and not be part of the synclist that contains the **APPEND** clause.
|
||||
|
||||
@@ -147,7 +148,7 @@ For example, your synclist file may look like this: ::
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
# Postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
@@ -157,15 +158,13 @@ For example, your synclist file may look like this: ::
|
||||
/etc/myappenddir/appendfile -> /etc/mysetup/setup
|
||||
/etc/myappenddir/appendfile2 -> /etc/mysetup/setup2
|
||||
|
||||
When you use the **APPEND** clause, the file (left) of the arrow is appended to the file right of the arrow. In this example, **/etc/myappenddir/appendfile** is appended to **/etc/mysetup/setup** file, which must already exist on the node. The **/opt/xcat/share/xcat/scripts/xdcpappend.sh** is used to accomplish this.
|
||||
When you use the **APPEND** clause, the source file to the left of the arrow is appended to the file to the right of the arrow. In this example, **/etc/myappenddir/appendfile** is appended to **/etc/mysetup/setup** file, which must already exist on the node. The **/opt/xcat/share/xcat/scripts/xdcpappend.sh** is used to accomplish this.
|
||||
|
||||
The script creates a backup of the original file on the node in the directory defined by the site table nodesyncfiledir attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to rsync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use the ``xdsh -c`` flag. See man page for ``xdsh``.
|
||||
The script creates a backup of the original file on the node in the directory defined by the **site** table **nodesyncfiledir** attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to sync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use ``xdsh -c`` command. See man page for ``xdsh``.
|
||||
|
||||
.. note:: no order of execution may be assumed by the order that the **EXECUTE,EXECUTEALWAYS and APPEND** clause fall in the synclist file.
|
||||
**MERGE** (supported on Linux only).
|
||||
|
||||
You can add an **MERGE** clause to your syncfile. This is only supported on Linux.
|
||||
|
||||
The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three file you should use a **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and insure that there are no duplicate entries in these files.
|
||||
The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three files you should use the **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and ensure that there are no duplicate entries in these files.
|
||||
|
||||
For example, your synclist file may look like this ::
|
||||
|
||||
@@ -174,7 +173,7 @@ For example, your synclist file may look like this ::
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
# Postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
@@ -185,20 +184,21 @@ For example, your synclist file may look like this ::
|
||||
/etc/mydir/mergeshadow -> /etc/shadow
|
||||
/etc/mydir/mergegroup -> /etc/group
|
||||
|
||||
When you use the **MERGE** clause, the file (left) of the arrow is merged into the file right of the arrow. It will replace any common userid's found in those files and add new userids. The **/opt/xcat/share/xcat/scripts/xdcpmerge.sh** is used to accomplish this.
|
||||
When you use the **MERGE** clause, the source file to the left of the arrow is merged into the file to the right of the arrow. It will replace any common userids found in those files and add new userids. The **/opt/xcat/share/xcat/scripts/xdcpmerge.sh** is used to accomplish this.
|
||||
|
||||
.. note:: no order of execution may be assumed by the order that the **EXECUTE,EXECUTEALWAYS,APPEND and MERGE** clause fall in the synclist file.
|
||||
.. note:: no order of execution may be assumed by the order of **EXECUTE, EXECUTEALWAYS, APPEND and MERGE** clauses in the synclist file.
|
||||
|
||||
.. _the_localtion_of_synclist_file_for_updatenode_label:
|
||||
|
||||
The location of synclist file for updatenode and install process
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In the installation process or updatenode process, xCAT needs to figure out the location of the synclist file automatically, so the synclist should be put into the specified place with the proper name.
|
||||
In the installation process or **updatenode** process, xCAT needs to figure out the location of the synclist file automatically, so the synclist should be put into the specified place with the proper name.
|
||||
|
||||
If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition synclists attribute. You can display this information by running the following command, supplying your osimage name. ::
|
||||
If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition **synclists** attribute. You can display this information by running the following command, supplying your osimage name. ::
|
||||
|
||||
lsdef -t osimage -l <os>-<arch>-netboot-compute
|
||||
|
||||
Object name: <os>-<arch>-netboot-compute
|
||||
exlist=/opt/xcat/share/xcat/netboot/<os>/compute.exlist
|
||||
imagetype=linux
|
||||
@@ -217,20 +217,21 @@ You can set the synclist path using the following command ::
|
||||
|
||||
chdef -t osimage -o <os>-<arch>-netboot-compute synclists="/install/custom/netboot/compute.synclist
|
||||
|
||||
If the provisioning method for the node is install,or netboot then the path to the synclist should be of the following format ::
|
||||
If the provisioning method for the node is `install`, or `netboot` then the path to the synclist should be in the following format ::
|
||||
|
||||
/install/custom/<inst_type>/<distro>/<profile>.<os>.<arch>.synclist
|
||||
|
||||
<inst_type>: "install", "netboot"
|
||||
<distro>: "rh", "centos", "fedora", "sles"
|
||||
<profile>,<os>and <arch> are what you set for the node
|
||||
<profile>, <os> and <arch> are what you set for the node
|
||||
|
||||
For example:
|
||||
The location of synclist file for the diskful installation of <os> with 'compute' as the profile ::
|
||||
The location of synclist file for the diskful installation of RedHat 7.5 with **compute** as the profile ::
|
||||
|
||||
/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist
|
||||
/install/custom/install/rh/compute.rhels7.5.synclist
|
||||
|
||||
The location of synclist file for the diskless netboot of <os> with '<profile>' as the profile ::
|
||||
The location of synclist file for the diskless netboot of SLES 12.3 with **service** as the profile ::
|
||||
|
||||
/install/custom/<inst_type>/<distro>/<profile>.<os>.synclist
|
||||
/install/custom/netboot/sles/service.sles12.3.synclist
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
Run the Syncing File action in the updatenode process
|
||||
------------------------------------------------------
|
||||
-----------------------------------------------------
|
||||
|
||||
If run ``updatenode`` command with -F option, it syncs files which configured in the synclist to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` option to sync images.
|
||||
Running ``updatenode`` command with **-F** option, will sync files configured in the synclist file to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` command to sync images.
|
||||
|
||||
``updatenode`` can be used to sync files to to diskful or diskless nodes. ``updatenode`` cannot be used to sync files to statelite nodes.
|
||||
|
||||
@@ -9,7 +9,7 @@ Steps to make the Syncing File working in the ``updatenode -F`` command:
|
||||
|
||||
#. Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label`)
|
||||
#. Put the synclist into the proper location (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`).
|
||||
#. Run the ``updatenode node -F`` command to initiate the Syncing File action.
|
||||
#. Run the ``updatenode <noderange> -F`` command to initiate the Syncing File action.
|
||||
|
||||
Note: Since Syncing File action can be initiated by the ``updatenode -F`` flag, the ``updatenode -P`` does NOT support to re-run the **'syncfiles'** postscript, even if you specify the **'syncfiles'** postscript in the ``updatenode`` command line or set the **'syncfiles'** in the **postscripts.postscripts** attribute.
|
||||
.. note:: Since Syncing File action can be initiated by the ``updatenode -F``, the ``updatenode -P`` does NOT support to re-run the **syncfiles** postscript, even if you specify the **syncfiles** postscript on the ``updatenode`` command line or set the **syncfiles** in the **postscripts.postscripts** attribute.
|
||||
|
||||
|
||||
+12
-11
@@ -1,30 +1,31 @@
|
||||
Run xdcp command to perform Syncing File action
|
||||
------------------------------------------------
|
||||
|
||||
``xdcp`` command supplies three options **'-F' , -s, and '-i'** to support the Syncing File function.
|
||||
``xdcp`` command supplies three options **-F** , **-s**, and **-i** to support the Syncing File function.
|
||||
|
||||
* -F|--File rsync input file
|
||||
* -F|--File <synclist input file>
|
||||
|
||||
Specifies the full path to the synclist file that will be used to build the ``rsync`` command
|
||||
Specifies the full path to the synclist file
|
||||
|
||||
* -s
|
||||
* -s
|
||||
|
||||
Specifies to rsync to the service nodes only for the input compute noderange.
|
||||
Specifies to sync to the service nodes only for the input compute noderange.
|
||||
|
||||
* -i|--rootimg install image for Linux
|
||||
* -i | --rootimg <install image for Linux>
|
||||
|
||||
Specifies the full path to the install image on the local node. By default, if the -F option is specified, the **'rsync'** command is used to perform the syncing file function. For the ``rsync`` in ``xdcp``, only the ***ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **'-Lpotz'** as the default flags to call the rsync command. More flags for rsync command can be specified by adding **'-o'** flag to the call to ``xdcp``.
|
||||
Specifies the full path to the install image on the local node.
|
||||
|
||||
For example: ::
|
||||
By default, if the **-F** option is specified, the ``rsync`` command is used to perform the syncing file function. Only the **ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **-Lpotz** as the default flags to call the ``rsync`` command. More flags for ``rsync`` command can be specified by adding **-o** flag to the call to ``xdcp``.
|
||||
|
||||
For example you can use ``xdcp`` **-F** option to sync files which are listed in the **/install/custom/commonsyncfiles/<profile>.synclist** file to the node group named **compute**. If the node group **compute** is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in **/var/xcat/syncfiles** directory on the service nodes by default, or in the directory indicated in the **site.SNsyncfiledir** attribute. See **-s** option below. ::
|
||||
|
||||
Using xdcp '-F' option to sync files which are listed in the /install/custom/commonsyncfiles/<profile>.synclist directory to the node group named 'compute'. If the node group compute is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in /var/xcat/syncfiles directory on the service nodes by default, or in the directory indicated in the site.SNsyncfiledir attribute. See -s option below.
|
||||
xdcp compute -F /install/custom/commonsynfiles/<profile>.synclist
|
||||
|
||||
For Linux nodes, using **xdcp '-i'** option with **'-F'** to sync files created in the **/install/custom/<inst_type>/<os><profile>.synclist** to the osimage in the directory **/install/<inst_type>/<os>/<arch>/<profile>/rootimg**: ::
|
||||
For Linux nodes, you can use ``xdcp`` command **-i** option with **-F** to sync files specified in the **/install/custom/<inst_type>/<os><profile>.synclist** file to the osimage in the directory **/install/<inst_type>/<os>/<arch>/<profile>/rootimg**: ::
|
||||
|
||||
xdcp -i /install/<inst_type>/<os>/<arch>/<profile>/rootimg -F /install/custom/<inst_type>/<os>/<profile>.synclist
|
||||
|
||||
Using the **xdcp '-s'** option to sync the files only to the service nodes for the node group named 'compute'. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/**. This can be setup before a node install, to have the files available to be synced during the install: ::
|
||||
You can use the ``xdcp`` **-s** option to sync the files only to the service nodes for the node group named **compute**. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/** attribute. This can be setup before a node install, to have the files available to be synced during the install: ::
|
||||
|
||||
xdcp compute -s -F /install/custom/<inst_type>/<os>/<profile>.synclist
|
||||
|
||||
|
||||
+1
-6
@@ -6,17 +6,12 @@ Unattended flash of OpenBMC firmware will do the following events:
|
||||
#. Activate both BMC firmware and Host firmware
|
||||
#. If BMC firmware becomes activate, reboot BMC to apply new BMC firmware, or else, ``rflash`` will exit
|
||||
#. If BMC itself state is ``NotReady``, ``rflash`` will exit
|
||||
#. If BMC itself state is ``Ready``, and use ``--no-host-reboot`` option, ``rflash`` will not reboot the compute node
|
||||
#. If BMC itself state is ``Ready``, and do not use ``--no-host-reboot`` option, ``rflash`` will reboot the compute node to apply Host firmware
|
||||
#. If BMC itself state is ``Ready``, ``rflash`` will reboot the compute node to apply Host firmware
|
||||
|
||||
Use the following command to flash the firmware unattended: ::
|
||||
|
||||
rflash <noderange> -d /path/to/directory
|
||||
|
||||
Use the following command to flash the firmware unattended and not reboot the compute node: ::
|
||||
|
||||
rflash <noderange> -d /path/to/directory --no-host-reboot
|
||||
|
||||
If there are errors encountered during the flash process, take a look at the manual steps to continue flashing the BMC.
|
||||
|
||||
.. END_unattended_OpenBMC_flashing
|
||||
|
||||
@@ -48,13 +48,13 @@ OPTIONS
|
||||
|
||||
\ **-**\ **-range**\
|
||||
|
||||
Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return.
|
||||
Specify one or more IP ranges acceptable to \ **nmap**\ . IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return.
|
||||
|
||||
|
||||
|
||||
\ **-**\ **-sn**\
|
||||
|
||||
Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node.
|
||||
Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, \ **bmcdiscover**\ will be dispatched to the specified SNs. Then, the nodename of the service node that \ **bmcdiscover**\ is running on will be set to the 'servicenode' attribute of the discovered BMC node.
|
||||
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ Output is similar to:
|
||||
conserver=sn01
|
||||
|
||||
|
||||
4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console:
|
||||
4. Discover the BMCs and write the discovered node definitions into the xCAT database and write out the stanza format to the console:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
@@ -21,13 +21,13 @@ SYNOPSIS
|
||||
|
||||
\ **lsdef**\ [\ **-h | -**\ **-help**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-i**\ \ *attr-list*\ ]
|
||||
|
||||
\ **lsdef**\ [\ **-V | -**\ **-verbose**\ ] [\ **-l | -**\ **-long**\ ] [\ **-s | -**\ **-short**\ ] [\ **-a | -**\ **-all**\ ] [\ **-S**\ ]
|
||||
[\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ] [\ **-z | -**\ **-stanza**\ ] [\ **-i**\ \ *attr-list*\ ]
|
||||
\ **lsdef**\ [\ **-V | -**\ **-verbose**\ ] [\ **-a | -**\ **-all**\ ] [\ **-S**\ ]
|
||||
[\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ] [\ **-z | -**\ **-stanza**\ ] [\ **-i**\ \ *attr-list*\ | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]]
|
||||
[\ **-c | -**\ **-compress**\ ] [\ **-**\ **-osimage**\ ] [\ **-**\ **-nics**\ ] [[\ **-w**\ \ *attr*\ ==\ *val*\ ]
|
||||
[\ **-w**\ \ *attr*\ =~\ *val*\ ] ...] [\ *noderange*\ ]
|
||||
|
||||
\ **lsdef**\ [\ **-l | -**\ **-long**\ ] [\ **-a | -**\ **-all**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-z | -**\ **-stanza**\ ]
|
||||
[\ **-i**\ \ *attr-list*\ ] [\ **-**\ **-template**\ [\ *template-object-name*\ ]]
|
||||
\ **lsdef**\ [\ **-a | -**\ **-all**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-z | -**\ **-stanza**\ ]
|
||||
[\ **-i**\ \ *attr-list*\ | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] [\ **-**\ **-template**\ [\ *template-object-name*\ ]]
|
||||
|
||||
|
||||
***********
|
||||
@@ -49,15 +49,15 @@ OPTIONS
|
||||
|
||||
Display all definitions.
|
||||
For performance consideration, the auditlog and eventlog objects will not be listed.
|
||||
To list auditlog or eventlog objects, use lsdef -t auditlog or lsdef -t eventlog instead.
|
||||
To list auditlog or eventlog objects, use \ **lsdef -t auditlog**\ or \ **lsdef -t eventlog**\ instead.
|
||||
|
||||
|
||||
|
||||
\ **-c|-**\ **-compress**\
|
||||
|
||||
Display information in compressed mode, each output line has format "<object name>: <data>".
|
||||
The output can be passed to command xcoll or xdshbak for formatted output.
|
||||
The -c flag must be used with -i flag.
|
||||
The output can be passed to command \ **xcoll**\ or \ **xdshbak**\ for formatted output.
|
||||
The \ **-c**\ flag must be used with \ **-i**\ flag.
|
||||
|
||||
|
||||
|
||||
@@ -136,13 +136,18 @@ OPTIONS
|
||||
|
||||
\ **-w**\ \ *attr==val*\ \ **-w**\ \ *attr=~val*\ ...
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
== 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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
@@ -150,7 +155,7 @@ OPTIONS
|
||||
|
||||
\ **-z|-**\ **-stanza**\
|
||||
|
||||
Display output in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files.
|
||||
Display output in stanza format. See the "xcatstanzafile" man page for details on using xCAT stanza files. And default is to list complete object definition, use \ **-i**\ to specify the attribute scope.
|
||||
|
||||
|
||||
|
||||
@@ -191,8 +196,6 @@ EXAMPLES
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
lsdef
|
||||
OR
|
||||
lsdef -a
|
||||
|
||||
|
||||
@@ -350,7 +353,7 @@ EXAMPLES
|
||||
|
||||
15.
|
||||
|
||||
To list the nodes status and use xcoll to format the output.
|
||||
To list the nodes status and use \ **xcoll**\ to format the output.
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
@@ -19,7 +19,7 @@ SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **updatenode**\ \ *noderange*\ [\ **-V | -**\ **-verbose**\ ] [\ **-F | -**\ **-sync**\ ] [\ **-f | -**\ **-snsync**\ ] [\ **-r | -**\ **-node-rcp**\ [\ *full_path_to_remote_copy_command*\ ]] [\ **-S | -**\ **-sw**\ ] [\ **-l**\ \ *userID*\ ] [\ **-P | -**\ **-scripts**\ [\ *script1,script2...*\ ]] [\ **-s | -**\ **-sn**\ ] [\ **-A | -**\ **-updateallsw**\ ] [\ **-c | -**\ **-cmdlineonly**\ ] [\ **-d**\ \ *alt_source_dir*\ ] [\ **-**\ **-fanout**\ =\ *fanout_value*\ ] [\ **-t**\ \ *timeout*\ } [\ *attr=val*\ [\ *attr=val...*\ ]] [\ **-n | -**\ **-noverify**\ ]
|
||||
\ **updatenode**\ \ *noderange*\ [\ **-V | -**\ **-verbose**\ ] [\ **-F | -**\ **-sync**\ ] [\ **-f | -**\ **-snsync**\ ] [\ **-r | -**\ **-node-rcp**\ [\ *node_remote_copy_command*\ ]] [\ **-S | -**\ **-sw**\ ] [\ **-l**\ \ *userID*\ ] [\ **-P | -**\ **-scripts**\ [\ *script1,script2...*\ ]] [\ **-s | -**\ **-sn**\ ] [\ **-A | -**\ **-updateallsw**\ ] [\ **-c | -**\ **-cmdlineonly**\ ] [\ **-d**\ \ *alt_source_dir*\ ] [\ **-**\ **-fanout**\ =\ *fanout_value*\ ] [\ **-t**\ \ *timeout*\ } [\ *attr=val*\ [\ *attr=val...*\ ]] [\ **-n | -**\ **-noverify**\ ]
|
||||
|
||||
\ **updatenode**\ \ **noderange**\ [\ **-k | -**\ **-security**\ ] [\ **-t**\ \ *timeout*\ ]
|
||||
|
||||
@@ -37,7 +37,7 @@ DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
The updatenode command is run on the xCAT management node and can be used
|
||||
The \ **updatenode**\ command is run on the xCAT management node and can be used
|
||||
to perform the following node updates:
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@ Update the ca and credentials for the service nodes.
|
||||
|
||||
|
||||
|
||||
The default behavior when no options are input to updatenode will be to run
|
||||
The default behavior when no options are input to \ **updatenode**\ will be to run
|
||||
the following options \ **-S**\ , \ **-P**\ and \ **-F**\ options in this order.
|
||||
If you wish to limit updatenode to specific
|
||||
actions you can use combinations of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags.
|
||||
If you wish to limit \ **updatenode**\ to specific
|
||||
actions you can use combination of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags.
|
||||
|
||||
For example, If you just want to synchronize configuration file you could
|
||||
specify the \ **-F**\ flag. If you want to synchronize files and update
|
||||
@@ -74,7 +74,7 @@ The flag \ **-f**\ (\ **-**\ **-snsync**\ ) can NOT be used together with \ **-
|
||||
|
||||
Note: In a large cluster environment the updating of nodes in an ad hoc
|
||||
manner can quickly get out of hand, leaving the system administrator with
|
||||
a very confusing environment to deal with. The updatenode command is
|
||||
a very confusing environment to deal with. The \ **updatenode**\ command is
|
||||
designed to encourage users to handle cluster updates in a manner that
|
||||
is recorded and easily repeatable.
|
||||
|
||||
@@ -93,14 +93,14 @@ The basic process for distributing and synchronizing nodes is:
|
||||
|
||||
|
||||
|
||||
\* Run the updatenode command to update the nodes.
|
||||
\* Run the \ **updatenode**\ command to update the nodes.
|
||||
|
||||
|
||||
|
||||
Files may be distributed and synchronized for both diskless and
|
||||
diskful nodes. Syncing files to NFS-based statelite nodes is not supported.
|
||||
|
||||
More information on using the synchronization file function is in the following doc: Using_Updatenode.
|
||||
More information on using the synchronization file function is in the following document: <https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.html>
|
||||
|
||||
Create the synclist file
|
||||
------------------------
|
||||
@@ -111,9 +111,7 @@ where the files should be synced to. In the synclist file, each
|
||||
line is an entry which describes the location of the source files
|
||||
and the destination location for the files on the target node.
|
||||
|
||||
For more information on creating your synclist files and where to put them, read:
|
||||
|
||||
Sync-ing_Config_Files_to_Nodes
|
||||
For more information on creating your synclist files and where to put them, read here: <https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.html>
|
||||
|
||||
|
||||
Run updatenode to synchronize the files
|
||||
@@ -382,12 +380,12 @@ OPTIONS
|
||||
\ **-F|-**\ **-sync**\
|
||||
|
||||
Specifies that file synchronization should be
|
||||
performed on the nodes. rsync/scp and ssh must
|
||||
performed on the nodes. \ **rsync/scp**\ and \ **ssh**\ must
|
||||
be installed and configured on the nodes.
|
||||
The function is not supported for NFS-based statelite installations.
|
||||
For NFS-based statelite installations to sync files, you should use the
|
||||
read-only option for files/directories listed in
|
||||
litefile table with source location specified in the litetree table.
|
||||
\ **litefile**\ table with source location specified in the \ **litetree**\ table.
|
||||
|
||||
|
||||
|
||||
@@ -396,33 +394,33 @@ OPTIONS
|
||||
Specifies that file synchronization should be
|
||||
performed to the service nodes that service the
|
||||
nodes in the noderange. This updates the service
|
||||
nodes with the data to sync to the nodes. rsync/scp and ssh must
|
||||
nodes with the data to sync to the nodes. \ **rsync/scp**\ and \ **ssh**\ must
|
||||
be installed and configured on the service nodes.
|
||||
For hierarchy, this optionally can be done before syncing the files
|
||||
to the nodes with the -F flag. If the -f flag is not used, then
|
||||
the -F flag will sync the servicenodes before the nodes automatically.
|
||||
to the nodes with the \ **-F**\ flag. If the \ **-f**\ flag is not used, then
|
||||
the \ **-F**\ flag will sync the service nodes before the nodes automatically.
|
||||
When installing nodes in a hierarchical cluster, this flag should be
|
||||
used to sync the service nodes before the install, since the files will
|
||||
be sync'd from the service node by the syncfiles postscript during the
|
||||
be synced from the service node by the \ **syncfiles**\ postscript during the
|
||||
install.
|
||||
The function is not supported for NFS-based statelite installations.
|
||||
For statelite installations to sync files, you should use the
|
||||
read-only option for files/directories listed in
|
||||
litefile table with source location specified in the litetree table.
|
||||
\ **litefile**\ table with source location specified in the \ **litetree**\ table.
|
||||
|
||||
|
||||
|
||||
[\ **-r | -**\ **-node-rcp**\ [\ *full_path_to_remote_copy_command*\ ]]
|
||||
[\ **-r | -**\ **-node-rcp**\ [\ *node_remote_copy_command*\ ]]
|
||||
|
||||
Specifies the full path of the remote copy command used for syncing files to node targets, such as "/usr/bin/rsync" or "/usr/bin/scp". If not specified, rsync will be used by default.
|
||||
Specifies the full path of the remote copy command used for syncing files to node targets, such as \ **/usr/bin/rsync**\ or \ **/usr/bin/scp**\ . If not specified, \ **rsync**\ will be used by default.
|
||||
|
||||
Notice: The synclist for "-r /usr/bin/scp" has some differences with "-r /usr/bin/rsync":
|
||||
Note: The synclist processing for \ **-r /usr/bin/scp**\ has some differences with \ **-r /usr/bin/rsync**\ :
|
||||
|
||||
1) the \`\`EXECUTE\`\` clause is not supported in "-r /usr/bin/scp"
|
||||
1) the \ **EXECUTE**\ clause in synclist file is not supported with \ **-r /usr/bin/scp**\ flag
|
||||
|
||||
2) if the destination directory specified in synclist is an existing file on target node, "updatenode -r /usr/bin/scp" will fail with \`\`scp: <destination directory>: Not a directory\`\`
|
||||
2) if the destination directory specified in synclist file is an existing file on target node, \ **updatenode -r /usr/bin/scp**\ will fail with "scp: <destination directory>: Not a directory"
|
||||
|
||||
3) if the destination file specified in synclist is an existing directory on target node, "updatenode -r /usr/bin/scp" will fail with \`\`scp: <destination file>: Is a directory\`\`
|
||||
3) if the destination file specified in synclist file is an existing directory on target node, \ **updatenode -r /usr/bin/scp**\ will fail with "scp: <destination file>: Is a directory"
|
||||
|
||||
|
||||
|
||||
@@ -461,8 +459,8 @@ OPTIONS
|
||||
\ **-P|-**\ **-scripts**\
|
||||
|
||||
Specifies that postscripts and postbootscripts should be run on the nodes.
|
||||
updatenode -P syncfiles is not supported. The syncfiles postscript can only
|
||||
be run during install. You should use updatenode <noderange> -F instead.
|
||||
File sync with \ **updatenode -P syncfiles**\ is not supported. The \ **syncfiles**\ postscript can only
|
||||
be run during install. You should use \ **updatenode -F**\ instead.
|
||||
|
||||
|
||||
|
||||
@@ -546,14 +544,14 @@ EXAMPLES
|
||||
|
||||
|
||||
|
||||
3. Running updatenode -P with the syncfiles postscript is not supported. You should use updatenode -F instead.
|
||||
3. Running \ **updatenode -P**\ with the \ **syncfiles**\ postscript is not supported. You should use \ **updatenode -F**\ instead.
|
||||
|
||||
Do not run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
updatenode clstrno1 -P syncfiles
|
||||
updatenode clstrn01 -P syncfiles
|
||||
|
||||
|
||||
Run:
|
||||
|
||||
@@ -21,6 +21,8 @@ SYNOPSIS
|
||||
|
||||
\ **xcatperftest**\ [\ **-?|-h**\ ]
|
||||
|
||||
[\ **PERF_DRYRUN**\ =y] \ **xcatperftest run**\ [\ *command-list-file*\ ]
|
||||
|
||||
[\ **PERF_DRYRUN**\ =y] [\ **PERF_NOCREATE**\ =y] \ **xcatperftest**\ <total> [\ *command-list-file*\ ]
|
||||
|
||||
|
||||
@@ -29,23 +31,23 @@ DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
The xcatperftest command runs commandes defined in a command list file and get their execution response time baseline for performance purpose.
|
||||
The xcatperftest command is part of the xCAT package xCAT-test, and you can run it standalone or leverage it to build up your automation test cases.
|
||||
The \ **xcatperftest**\ command runs commands defined in a command list file and get their execution response time baseline for performance purpose.
|
||||
The \ **xcatperftest**\ command is part of the xCAT package \ **xCAT-test**\ , and you can run it standalone or leverage it to build up your automation test cases.
|
||||
|
||||
Any commands could be defined in the command list file, however, it is recommended that the one-time initial configuration are well prepared prior to run xcatperftest command.
|
||||
For example, the network object, osdistor and osimage image objects.
|
||||
Any command could be defined in the command list file, however, it is recommended that the one-time initial configuration is well prepared prior to running \ **xcatperftest**\ command.
|
||||
For example, the network object, osdistro and osimage image objects.
|
||||
|
||||
Follow the below steps to run xcatperftest command:
|
||||
Follow the steps below to run \ **xcatperftest**\ command:
|
||||
|
||||
1, Install xCAT-test on a xCAT management nodes.
|
||||
1. Install \ **xCAT-test**\ on a xCAT management node.
|
||||
|
||||
2, Prepare a command list in which the commands are what you want to messure.
|
||||
2. Prepare a command list with the commands you want to measure.
|
||||
|
||||
3, Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal.
|
||||
3. Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal.
|
||||
|
||||
4, Run xcatperftest with the total fake nodes number and the above command list file.
|
||||
4. Run \ **xcatperftest**\ with the total fake nodes number and the above command list file.
|
||||
|
||||
Node: It is suggested to run the command in background as it normally takes long time to finish all the performanc testing with large amount of fake nodes.
|
||||
Node: It is suggested to run the command in background as it normally takes long time to finish all the performance testing with large amount of fake nodes.
|
||||
|
||||
|
||||
*******
|
||||
@@ -60,7 +62,7 @@ OPTIONS
|
||||
|
||||
|
||||
|
||||
<command-list-file>
|
||||
\ *command-list-file*\
|
||||
|
||||
Specifies the command list file with full-path. xCAT supports an example command file: /opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
|
||||
@@ -88,7 +90,7 @@ COMMAND LIST FILE
|
||||
*****************
|
||||
|
||||
|
||||
The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the commannd list file:
|
||||
The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the command list file:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@@ -110,13 +112,13 @@ The command list file is in flat text format, the testing framework will parse t
|
||||
|
||||
|
||||
\ **Note**\ : Each line defines one command, and the commands dependency should be handled by the line order.
|
||||
If you define a node range series line (started with #SERIES#) in this file, xcatperftest will run the command for each node range defined in series line.
|
||||
If you define a node range series line (started with \ **#SERIES#**\ ) in this file, xcatperftest will run the command for each node range defined in series line.
|
||||
|
||||
\ **#SERIES#**\ To define a node range series, and the series should be an comma split incremental number sequence.
|
||||
|
||||
\ **#STANZ#**\ It will be replaced with real stanz file path when this command line runs.
|
||||
|
||||
\ **#NODES#**\ It will be replaced with real node range defined in #SERIES# line when this command line runs. If no series line, the node group will be used.
|
||||
\ **#NODES#**\ It will be replaced with real node range defined in \ **#SERIES#**\ line when this command line runs. If no series line, the node group will be used.
|
||||
|
||||
\ **#PERFGRP#**\ It will be replaced with node group when this command line runs.
|
||||
|
||||
@@ -126,7 +128,7 @@ ENVIRONMENT VARIABLE
|
||||
********************
|
||||
|
||||
|
||||
The xcatperftest command supports be customized by some environment variables.
|
||||
The \ **xcatperftest**\ command supports customization by some environment variables.
|
||||
|
||||
\ **FAKE_NODE_PREFIX**\
|
||||
|
||||
@@ -148,15 +150,15 @@ It must be a string like 'A.B' and no need to be defined in 'networks' table.
|
||||
|
||||
\ **PERF_NODETEMPL**\
|
||||
|
||||
Optional, The node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch.
|
||||
Optional, the node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch.
|
||||
|
||||
\ **PERF_DRYRUN**\
|
||||
|
||||
Optional, Indicate no real commands will be executed if the environment variable is set.
|
||||
Optional, indicate no real commands will be executed if the environment variable is set.
|
||||
|
||||
\ **PERF_NOCREATE**\
|
||||
|
||||
Optional, Indicate no new fake nodes will be created if the environment variable is set.
|
||||
Optional, indicate no new fake nodes will be created if the environment variable is set.
|
||||
|
||||
|
||||
********
|
||||
@@ -201,6 +203,18 @@ EXAMPLES
|
||||
|
||||
|
||||
|
||||
4.
|
||||
|
||||
To run the performance testing for the commands defined in /tmp/cmd.lst in existing xCAT environment:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
xcatperftest run /tmp/cmd.lst
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*****
|
||||
FILES
|
||||
|
||||
@@ -11,7 +11,7 @@ xdcp.1
|
||||
************
|
||||
|
||||
|
||||
\ **xdcp**\ - Concurrently copies files to or from multiple nodes. In addition, provides an option to use rsync to update the files on the nodes, or to an installation image on the local node.
|
||||
\ **xdcp**\ - Concurrently copies files to or from multiple nodes. In addition, provides an option to use \ **rsync**\ to update the files on the managed nodes, or to an installation image on the local node.
|
||||
|
||||
|
||||
****************
|
||||
@@ -19,13 +19,13 @@ xdcp.1
|
||||
****************
|
||||
|
||||
|
||||
\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node_remote_shell*\ ] [\ **-R**\ ] [\ **-t**\ \ *timeout*\ ] [\ **-T**\ ] [\ **-v**\ ] [\ **-q**\ ] [\ **-X**\ \ *env_list*\ ] \ *sourcefile.... targetpath*\
|
||||
\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command] [\ \*\*-R\*\*\ ] [\ \*\*-t\*\*\ \ \*timeout\*\ ] [\ \*\*-T\*\*\ ] [\ \*\*-v\*\*\ ] [\ \*\*-q\*\*\ ] [\ \*\*-X\*\*\ \ \*env_list\*\ ] \ \*sourcefile.... targetpath\*\ *\
|
||||
|
||||
\ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsync input file*\ ]
|
||||
\ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsynclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ]
|
||||
|
||||
\ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *rsync input file*\ ]
|
||||
\ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ]
|
||||
|
||||
\ **xdcp**\ [\ **-i**\ \ *path to install image*\ ] [\ **-F**\ \ *rsync input file*\ ]
|
||||
\ **xdcp**\ [\ **-i**\ \ *install image*\ ] [\ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ]
|
||||
|
||||
\ **xdcp**\ [\ **-h**\ | \ **-V**\ | \ **-q**\ ]
|
||||
|
||||
@@ -36,33 +36,32 @@ xdcp.1
|
||||
|
||||
|
||||
The \ **xdcp**\ command concurrently copies files to or from remote target
|
||||
nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the target_path with the name of the
|
||||
remote node or device appended to the copied source_file name. The
|
||||
/usr/bin/rcp command is the model for syntax and security.
|
||||
If using hierarchy, then xdcp runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, SNsyncfiledir attribute, or the default path /var/xcat/syncfiles on the service node, if the attribute is not defined. The -P flag will not automatically copy
|
||||
nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the \ *targetpath*\ with the name of the
|
||||
remote node or device appended to the copied \ *sourcefile*\ name. The
|
||||
\ **/usr/bin/rcp**\ command is the model for syntax and security.
|
||||
If using hierarchy, then \ **xdcp**\ runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, \ **SNsyncfiledir**\ attribute, or the default path \ **/var/xcat/syncfiles**\ on the service node, if the attribute is not defined. The \ **-P**\ flag will not automatically copy
|
||||
the files from the compute node to the Management node, hierarchically. There
|
||||
is a two step process, see \ **-P**\ flag.
|
||||
If the Management Node is target node, it must be defined in the xCAT database with nodetype=mn. When the \ **xdcp**\ command runs the Management Node as the target, it does not use remote commands but uses the local OS copy (\ **cp**\ ) command.
|
||||
If the Management Node is target node, it must be defined in the xCAT database with \ **nodetype=mn**\ . When the \ **xdcp**\ command runs with the Management Node as the target, it does not use remote commands but uses the local OS copy (\ **cp**\ ) command.
|
||||
|
||||
\ **REMOTE**\ \ **USER**\ :
|
||||
|
||||
A user_ID can be specified for the remote copy command. Remote user
|
||||
specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. See the \ **xdsh**\
|
||||
command for more information.
|
||||
A user_ID can be specified for the remote copy command. Remote user
|
||||
specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands.
|
||||
See the \ **xdsh**\ command for more information.
|
||||
|
||||
\ **REMOTE**\ \ **COMMAND**\ \ **COPY**\ :
|
||||
|
||||
The \ **xdcp**\ command uses a configurable remote copy command to execute
|
||||
remote copies on remote targets. Support is explicitly provided for
|
||||
Remote Shell rcp command, the OpenSSH scp command and the
|
||||
/usr/bin/rsync command.
|
||||
Remote Shell \ **rcp**\ command, the OpenSSH \ **scp**\ command and the
|
||||
\ **/usr/bin/rsync**\ command.
|
||||
|
||||
For node targets, the remote copy command is determined by the follow-
|
||||
ing order of precedence:
|
||||
For node targets, the remote copy command is determined by the following order of precedence:
|
||||
|
||||
1. The \ **-r**\ flag.
|
||||
|
||||
2. The \ **/usr/bin/scp**\ command.
|
||||
2. The \ **/usr/bin/rsync**\ command.
|
||||
|
||||
\ **COMMAND**\ \ **EXECUTIONS**\ :
|
||||
|
||||
@@ -75,10 +74,10 @@ appropriate.
|
||||
|
||||
A timeout value for remote copy command execution can be specified with
|
||||
the \ **-t**\ flag or DSH_TIMEOUT environment variable. If any remote target
|
||||
does not respond within the timeout value, the xdcp command displays an
|
||||
does not respond within the timeout value, the \ **xdcp**\ command displays an
|
||||
error message and exits.
|
||||
|
||||
The \ **-T**\ flag provides diagnostic trace information for dcp command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed.
|
||||
The \ **-T**\ flag provides diagnostic trace information for \ **xdcp**\ command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed.
|
||||
|
||||
The \ **xdcp**\ command can be executed silently using the \ **-Q**\ flag; no target
|
||||
standard output or standard error is displayed.
|
||||
@@ -94,170 +93,45 @@ standard output or standard error is displayed.
|
||||
|
||||
Specifies the complete path for the file to be copied to or
|
||||
from the target. Multiple files can be specified. When used
|
||||
with the -R flag, only a single directory can be specified.
|
||||
When used with the -P flag, only a single file can be specified.
|
||||
with the \ **-R**\ flag, only a single directory can be specified.
|
||||
When used with the \ **-P**\ flag, only a single file can be specified.
|
||||
|
||||
|
||||
|
||||
\ *targetpath*\
|
||||
|
||||
If one source_file file, then it specifies the file to copy the source_file
|
||||
file to on the target. If multiple source_file files, it specifies
|
||||
the directory to copy the source_file files to on the target.
|
||||
If the -P flag is specified, the target_path is the local host location
|
||||
If one source file, then it specifies the file to copy the source
|
||||
file to on the target. If multiple source files, it specifies
|
||||
the directory to copy the source files to on the target.
|
||||
If the \ **-P**\ flag is specified, the \ *targetpath*\ is the local host location
|
||||
for the copied files. The remote file directory structure is recreated
|
||||
under target_path and the remote target name is appended
|
||||
to the copied source_file name in the target_path directory.
|
||||
Note: the targetpath directory must exist.
|
||||
under \ *targetpath*\ and the remote target name is appended
|
||||
to the copied \ *sourcefile*\ name in the \ *targetpath*\ directory.
|
||||
Note: the \ *targetpath*\ directory must exist.
|
||||
|
||||
|
||||
|
||||
\ **-B | -**\ **-bypass**\
|
||||
|
||||
Runs in bypass mode, use if the xcatd daemon is hung.
|
||||
Runs in bypass mode, use if the \ **xcatd**\ daemon is not responding.
|
||||
|
||||
|
||||
|
||||
\ **-f | -**\ **-fanout**\ \ *fanout_value*\
|
||||
|
||||
Specifies a fanout value for the maximum number of concur-
|
||||
rently executing remote shell processes. Serial execution
|
||||
Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution
|
||||
can be specified by indicating a fanout value of \ **1**\ .
|
||||
If \ **-f**\ is not specified, a default fanout value of \ **64**\ is used.
|
||||
|
||||
|
||||
|
||||
\ **-F | -**\ **-File**\ \ *rsync input file*\
|
||||
\ **-F | -**\ **-File**\ \ *synclist input file*\
|
||||
|
||||
Specifies the path to the file that will be used to
|
||||
build the \ **rsync**\ command.
|
||||
The format of the input file is as follows, each line contains:
|
||||
The format of the input file is described here: <https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.html>
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
<path to source file1> <path to source file2> ... -> < path to destination file/directory>
|
||||
|
||||
|
||||
or
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
<path to source file> -> <path to destination file>
|
||||
|
||||
|
||||
or
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
<path to source file> -> <path to destination directory ( must end in /)>
|
||||
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/password /etc/hosts -> /etc
|
||||
|
||||
/tmp/file2 -> /tmp/file2
|
||||
|
||||
/tmp/file2 -> /tmp/
|
||||
|
||||
/tmp/filex -> /tmp/source/filey
|
||||
|
||||
/etc/* -> /etc/
|
||||
|
||||
|
||||
\ **Running postscripts after files are sync'd to the nodes**\ :
|
||||
|
||||
After you define the files to rsync, you can add an \ **EXECUTE:**\ clause in the synclist file. The \ **EXECUTE:**\ clause will list all the postscripts that you would like to run after the files are sync'd to the node.
|
||||
The postscript file must be of the form \ **filename.post**\ , where the <filename>
|
||||
is the <filename> is the from <filename>, reside in the same
|
||||
directory as \ **filename**\ , and be executable.
|
||||
If the file \ **filename**\ is rsync'd to the node, then the \ **filename.post**\
|
||||
will automatically be run on the node.
|
||||
If the file \ **filename**\ is not updated on the node, the \ **filename.post**\ will not be run.
|
||||
|
||||
Putting the \ **filename.post**\ in the file list to rsync to the node is required
|
||||
for hierarchical clusters. It is optional for non-hierarchical clusters.
|
||||
|
||||
Another option is the \ **EXECUTEALWAYS:**\ clause in the synclist file. The \ **EXECUTEALWAYS:**\ will list all the postscripts that you would like to run after the files are sync'd to the nodes. These scripts will run whether or not any files are sync'd to the nodes. The scripts have no special format, but must contain the fully qualified path.
|
||||
|
||||
The scripts must be also added to the file list to rsync to the node for hierarchical clusters. It is optional for non-hierarchical clusters.
|
||||
|
||||
For example, your rsynclist file may look like this:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
|
||||
|
||||
If /tmp/file2 and /tmp/file3 update /tmp/file2 and /tmp/filex on the node, then the postscripts /tmp/file2.post and /tmp/file3.post are automatically run on
|
||||
the node. /tmp/myscript will always be run on the node.
|
||||
|
||||
Another option is the \ **APPEND:**\ clause in the synclist file. The \ **APPEND:**\ clause is used to append the contents of the input file to an existing file on the node. The file to append \ **must**\ already exist on the node and not be part of the synclist that contains the \ **APPEND:**\ clause.
|
||||
|
||||
For example, your rsynclist file may look like this:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
APPEND:
|
||||
/etc/myappenddir/appendfile -> /etc/mysetup/setup
|
||||
/etc/myappenddir/appendfile2 -> /etc/mysetup/setup2
|
||||
|
||||
|
||||
When you use the append script, the file (left) of the arrow is appended to the file right of the arrow. In this example, /etc/myappenddir/appendfile is appended to /etc/mysetup/setup file, which must already exist on the node. The /opt/xcat/share/xcat/scripts/xdcpappend.sh is used to accomplish this.
|
||||
|
||||
Another option is the \ **MERGE:**\ clause in the synclist file. The \ **MERGE:**\ clause is used to append the contents of the input file to /etc/passwd, /etc/group, or /etc/shadow on a Linux node. It is only supported for those files and only on Linux. You must not use both the APPEND and MERGE funcion for these three files. The processing could end up not creating the file you desire. The MERGE function is the preferred method, because APPEND only adds to the file. MERGE will add to the file but also insure there are no duplicate entries.
|
||||
|
||||
For example, your rsynclist file may look like this:
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
APPEND:
|
||||
/custom/mypasswd -> /etc/passwd
|
||||
/custom/mygroups -> /etc/group
|
||||
/custom/myshadow -> /etc/shadow
|
||||
|
||||
Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file.
|
||||
|
||||
For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes
|
||||
|
||||
On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute.
|
||||
On Linux \ **rsync**\ always uses ssh remoteshell. On AIX, \ **ssh**\ or \ **rsh**\ is used depending on the \ **site.useSSHonAIX**\ table attribute.
|
||||
|
||||
|
||||
|
||||
@@ -269,7 +143,7 @@ standard output or standard error is displayed.
|
||||
|
||||
\ **-i | -**\ **-rootimg**\ \ *install image*\
|
||||
|
||||
Specifies the path to the install image on the local Linux node.
|
||||
Specifies the path to the install image on the local Linux node.
|
||||
|
||||
|
||||
|
||||
@@ -277,7 +151,7 @@ standard output or standard error is displayed.
|
||||
|
||||
Specifies options to pass to the remote shell command for
|
||||
node targets. The options must be specified within double
|
||||
quotation marks ("") to distinguish them from \ **xdsh**\ options.
|
||||
quotation marks ("") to distinguish them from \ **xdcp**\ options.
|
||||
|
||||
|
||||
|
||||
@@ -291,14 +165,14 @@ standard output or standard error is displayed.
|
||||
\ **-P | -**\ **-pull**\
|
||||
|
||||
Pulls (copies) the files from the targets and places them in
|
||||
the target_path directory on the local host. The target_path
|
||||
the \ *targetpath*\ directory on the local host. The \ *targetpath*\
|
||||
must be a directory. Files pulled from remote machines have
|
||||
._target appended to the file name to distinguish between
|
||||
them. When the \ **-P**\ flag is used with the \ **-R**\ flag, ._target is
|
||||
\ **._target**\ appended to the file name to distinguish between
|
||||
them. When the \ **-P**\ flag is used with the \ **-R**\ flag, \ **._target**\ is
|
||||
appended to the directory. Only one file per invocation of the
|
||||
xdcp pull command can be pulled from the specified targets.
|
||||
Hierarchy is not automatically support yet. You must first pull
|
||||
the file to the Service Node and then pull the file to the Management
|
||||
\ **xdcp**\ pull command can be pulled from the specified targets.
|
||||
In hierarchy, you must first pull
|
||||
the file to the service node and then pull the file to the management
|
||||
node.
|
||||
|
||||
|
||||
@@ -313,10 +187,17 @@ standard output or standard error is displayed.
|
||||
|
||||
|
||||
|
||||
\ **-r | -**\ **-node-rcp**\ \ *node_remote_copy*\
|
||||
\ **-r | -**\ **-node-rcp**\ \ *node remote copy command*\
|
||||
|
||||
Specifies the full path of the remote copy command used
|
||||
for remote command execution on node targets.
|
||||
Specifies the full path of the remote copy command used for syncing files to node targets, such as \ **/usr/bin/rsync**\ or \ **/usr/bin/scp**\ . If not specified, \ **rsync**\ will be used by default.
|
||||
|
||||
Note: The synclist processing for \ **-r /usr/bin/scp**\ has some differences with \ **-r /usr/bin/rsync**\ :
|
||||
|
||||
1) the \ **EXECUTE**\ clause in synclist file is not supported with \ **-r /usr/bin/scp**\ flag
|
||||
|
||||
2) if the destination directory specified in synclist file is an existing file on target node, \ **xdcp -r /usr/bin/scp**\ will fail with "scp: <destination directory>: Not a directory"
|
||||
|
||||
3) if the destination file specified in synclist file is an existing directory on target node, \ **xdcp -r /usr/bin/scp**\ will fail with "scp: <destination file>: Is a directory"
|
||||
|
||||
|
||||
|
||||
@@ -325,8 +206,7 @@ standard output or standard error is displayed.
|
||||
Recursively copies files from a local directory to the remote
|
||||
targets, or when specified with the \ **-P**\ flag, recursively pulls
|
||||
(copies) files from a remote directory to the local host. A
|
||||
single source directory can be specified using the source_file
|
||||
parameter.
|
||||
single source directory can be specified using the \ *sourcefile*\ parameter.
|
||||
|
||||
|
||||
|
||||
@@ -334,8 +214,8 @@ standard output or standard error is displayed.
|
||||
|
||||
Will only sync the files listed in the synclist (\ **-F**\ ), to the service
|
||||
nodes for the input compute node list. The files will be placed in the
|
||||
directory defined by the site.SNsyncfiledir attribute, or the default
|
||||
/var/xcat/syncfiles directory.
|
||||
directory defined by the \ **site.SNsyncfiledir**\ table attribute, or the default
|
||||
\ **/var/xcat/syncfiles**\ directory.
|
||||
|
||||
|
||||
|
||||
@@ -447,9 +327,8 @@ standard output or standard error is displayed.
|
||||
|
||||
\ **DSH_TIMEOUT**\
|
||||
|
||||
Specifies the time, in seconds, to wait for output from
|
||||
each remote target. This variable is overridden by the \ **-t**\
|
||||
flag.
|
||||
Specifies the time, in seconds, to wait for output from
|
||||
each remote target. This variable is overridden by the \ **-t**\ flag.
|
||||
|
||||
|
||||
|
||||
@@ -463,13 +342,12 @@ Exit values for each remote copy command execution are displayed in
|
||||
messages from the xdcp command, if the remote copy command exit value is
|
||||
non-zero. A non-zero return code from a remote copy command indicates
|
||||
that an error was encountered during the remote copy. If a remote copy
|
||||
command encounters an error, execution of the remote copy on that tar-
|
||||
get is bypassed.
|
||||
command encounters an error, execution of the remote copy on that target is bypassed.
|
||||
|
||||
The xdcp command exit code is 0, if the xdcp command executed without
|
||||
The \ **xdcp**\ command exit code is 0, if the \ **xdcp**\ command executed without
|
||||
errors and all remote copy commands finished with exit codes of 0. If
|
||||
internal xdcp errors occur or the remote copy commands do not complete
|
||||
successfully, the xdcp command exit value is greater than 0.
|
||||
internal \ **xdcp**\ errors occur or the remote copy commands do not complete
|
||||
successfully, the \ **xdcp**\ command exit value is greater than 0.
|
||||
|
||||
|
||||
****************
|
||||
@@ -530,7 +408,7 @@ host as /var/log._target, enter:
|
||||
|
||||
|
||||
|
||||
3. To copy /localnode/smallfile and /tmp/bigfile to /tmp on node1
|
||||
3. To copy /localnode/smallfile and /tmp/bigfile to B/tmp on node1
|
||||
using rsync and input -t flag to rsync, enter:
|
||||
|
||||
|
||||
@@ -587,15 +465,23 @@ from the local host to node1 in the cluster, enter:
|
||||
|
||||
8. To rsync the /etc/hosts file to your compute nodes:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a syncfile /tmp/myrsync, with this line:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/hosts -> /etc/hosts
|
||||
|
||||
/etc/hosts -> /etc/hosts
|
||||
|
||||
or
|
||||
|
||||
/etc/hosts -> /etc/ (last / is required)
|
||||
|
||||
Run:
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/hosts -> /etc/ (last / is required)
|
||||
|
||||
|
||||
Then run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@@ -607,11 +493,15 @@ from the local host to node1 in the cluster, enter:
|
||||
|
||||
9. To rsync all the files in /home/mikev to the compute nodes:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/home/mikev/\* -> /home/mikev/ (last / is required)
|
||||
|
||||
Run:
|
||||
.. code-block:: perl
|
||||
|
||||
/home/mikev/* -> /home/mikev/ (last / is required)
|
||||
|
||||
|
||||
Then run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@@ -621,18 +511,25 @@ from the local host to node1 in the cluster, enter:
|
||||
|
||||
|
||||
|
||||
10. To rsync to the compute nodes, using service nodes, the command will first
|
||||
rsync the files to the /var/xcat/syncfiles directory on the service nodes and then rsync the files from that directory to the compute nodes. The /var/xcat/syncfiles default directory on the service nodes, can be changed by putting a directory value in the site table SNsyncfiledir attribute.
|
||||
10. To rsync to the compute nodes, using service nodes:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
or
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc/
|
||||
|
||||
Run:
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc/
|
||||
|
||||
|
||||
Then run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@@ -640,18 +537,20 @@ rsync the files to the /var/xcat/syncfiles directory on the service nodes and t
|
||||
xdcp compute -F /tmp/myrsync
|
||||
|
||||
|
||||
to update the Compute Nodes
|
||||
|
||||
|
||||
|
||||
11. To rsync to the service nodes in preparation for rsyncing the compute nodes
|
||||
during an install from the service node.
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
Run:
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
|
||||
Then run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@@ -659,19 +558,21 @@ during an install from the service node.
|
||||
xdcp compute -s -F /tmp/myrsync
|
||||
|
||||
|
||||
to sync the service node for compute
|
||||
|
||||
|
||||
|
||||
12. To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with these line:
|
||||
First create a rsync file /tmp/myrsync, with these line:
|
||||
|
||||
/etc/file1 -> /etc/filex
|
||||
|
||||
/etc/file2 -> /etc/filey
|
||||
.. code-block:: perl
|
||||
|
||||
Run:
|
||||
/etc/file1 -> /etc/filex
|
||||
|
||||
/etc/file2 -> /etc/filey
|
||||
|
||||
|
||||
Then run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
@@ -685,11 +586,15 @@ during an install from the service node.
|
||||
|
||||
13. To rsync files in the Linux image at /install/netboot/fedora9/x86_64/compute/rootimg on the MN:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
Run:
|
||||
.. code-block:: perl
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
|
||||
Then run:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
@@ -135,6 +135,11 @@ site Attributes:
|
||||
service nodes will ignore this value and always be configured to forward
|
||||
to the management node.
|
||||
|
||||
dnsforwardmode: (first or only or no). This is to set forward value in named.conf options section.
|
||||
"first": causes DNS requests to be forwarded before an attempt is made to resolve them via the root name servers.
|
||||
"only": all requests are forwarded and none sent to the root name servers.
|
||||
"no": no request will be forwarded. This is the default value if not specified.
|
||||
|
||||
emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section.
|
||||
|
||||
master: The hostname of the xCAT management node, as known by the nodes.
|
||||
@@ -269,7 +274,7 @@ site Attributes:
|
||||
genpasswords: Automatically generate random passwords for BMCs when configuring
|
||||
them.
|
||||
|
||||
installdir: The local directory name used to hold the node deployment packages.
|
||||
installdir: The local directory name used to hold the node deployment packages(obsoleted).
|
||||
|
||||
installloc: The location from which the service nodes should mount the
|
||||
deployment packages in the format hostname:/path. If hostname is
|
||||
@@ -401,7 +406,7 @@ site Attributes:
|
||||
|
||||
dbtracelevel: The trace level for the database access log. To activate this setting, please.
|
||||
restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .
|
||||
ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print $2}' | xargs kill -HUP
|
||||
pkill -f -HUP 'xcatd: DB Access'
|
||||
Currrent support values:
|
||||
0: disable the trace log for db
|
||||
1: trace the calls of database subroutines
|
||||
@@ -460,7 +465,11 @@ site Attributes:
|
||||
|
||||
xcatlport: The port used by xcatd command log writer process to collect command output.
|
||||
|
||||
xcatsslversion: The ssl version by xcatd. Default is TLSv1.
|
||||
xcatsslversion: The SSL_version option xcatd used and passed to
|
||||
IO::Socket::SSL->start_SSL(). By default, this value is
|
||||
set to empty. In this case, xcatd will use
|
||||
'SSLv23:!SSLv2:!SSLv3:!TLSv1' internally.
|
||||
For more detail, see https://metacpan.org/pod/IO::Socket::SSL
|
||||
|
||||
xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Get Started
|
||||
===========
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
quick_start.rst
|
||||
workflow_guide.rst
|
||||
@@ -0,0 +1,140 @@
|
||||
Quick Start Guide
|
||||
=================
|
||||
xCAT can be a comprehensive system to manage infrastructure elements in Data Center, bare-metal servers, switches, PDUs, and Operation System distributions. This quick start guide will instruct you to set up a xCAT system and manage an IPMI managed bare metal server with Red Hat-based distribution in 15 minutes.
|
||||
|
||||
The steps below will be focused on RHEL7, however they should work for other distribution, such as CentOS, SLES, etc, details :doc:`Operating System & Hardware Support Matrix <../../overview/support_matrix>`
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
Assume there are two servers named ``xcatmn.mydomain.com`` and ``cn1.mydomain.com``.
|
||||
|
||||
#. They are in the same subnet ``192.168.0.0``.
|
||||
#. ``cn1.mydomain.com`` has BMC which ``xcatmn.mydomain.com`` can access it.
|
||||
#. ``xcatmn.mydomain.com`` has Red Hat OS installed, and uses IP ``192.168.0.2``.
|
||||
#. ``xcatmn.mydomain.com`` has access to internet.
|
||||
#. ``cn1.mydomain.com`` BMC IP address is ``10.4.40.254``.
|
||||
#. Prepare a full DVD for OS provision, and not a ``Live CD`` ISO, for this example, will use ``RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso`` ISO, you can download it from Red Hat website.
|
||||
|
||||
All the following steps should be executed in ``xcatmn.mydomain.com``.
|
||||
|
||||
Prepare the Management Node ``xcatmn.mydomain.com``
|
||||
```````````````````````````````````````````````````
|
||||
|
||||
#. Disable SELinux: ::
|
||||
|
||||
echo 0 > /selinux/enforce
|
||||
sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
|
||||
|
||||
#. Set the hostname of ``xcatmn.mydomain.com``: ::
|
||||
|
||||
hostname xcatmn.mydomain.com
|
||||
|
||||
#. Set the IP to STATIC in the ``/etc/sysconfig/network-scripts/ifcfg-<proc_nic>`` file
|
||||
|
||||
#. Update your ``/etc/resolv.conf`` with DNS settings and make sure that the node could visit ``github`` and ``xcat`` official website.
|
||||
|
||||
#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file
|
||||
|
||||
#. Add ``xcatmn`` into ``/etc/hosts``: ::
|
||||
|
||||
192.168.0.2 xcatmn xcatmn.mydomain.com
|
||||
|
||||
#. Install xCAT: ::
|
||||
|
||||
wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat
|
||||
chmod +x /tmp/go-xcat
|
||||
go-xcat --yes install
|
||||
source /etc/profile.d/xcat.sh
|
||||
|
||||
#. Configure the system password for the root user on the compute nodes: ::
|
||||
|
||||
chtab key=system passwd.username=root passwd.password=abc123
|
||||
|
||||
Stage 1 Add your first node and control it with out-of-band BMC interface
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
#. Define compute node ``cn1``: ::
|
||||
|
||||
mkdef -t node cn1 --template x86_64-template ip=192.168.0.3 mac=42:3d:0a:05:27:0c bmc=10.4.40.254 bmcusername=USERID bmcpassword=PASSW0RD
|
||||
|
||||
#. Configure DNS: ::
|
||||
|
||||
makehosts cn1
|
||||
makedns -n
|
||||
|
||||
#. Check ``cn1`` Hardware Control:
|
||||
|
||||
``cn1`` power management: ::
|
||||
|
||||
rpower cn1 on
|
||||
rpower cn1 state
|
||||
cn1: on
|
||||
|
||||
``cn1`` firmware information: ::
|
||||
|
||||
rinv cn1 firm
|
||||
cn1: UEFI Version: 1.31 (TDE134EUS 2013/08/27)
|
||||
cn1: Backup UEFI Version: 1.00 (TDE112DUS )
|
||||
cn1: Backup IMM Version: 1.25 (1AOO26K 2012/02/23)
|
||||
cn1: BMC Firmware: 3.10 (1AOO48H 2013/08/22 18:49:44)
|
||||
|
||||
Stage 2 Provision a node and manage it with parallel shell
|
||||
----------------------------------------------------------
|
||||
|
||||
#. In order to PXE boot, you need a DHCP server to hand out addresses and direct the booting system to the TFTP server where it can download the network boot files. Configure DHCP: ::
|
||||
|
||||
makedhcp -n
|
||||
|
||||
#. Copy all contents of Distribution ISO into ``/install`` directory, create OS repository and osimage for OS provision: ::
|
||||
|
||||
copycds RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso
|
||||
|
||||
After ``copycds``, the corresponding basic osimage will be generated automatically. And then you can list the new osimage name here. You can refer document to customize the package list or postscript for target compute nodes, but here just use the default one: ::
|
||||
|
||||
lsdef -t osimage
|
||||
|
||||
#. Use ``xcatprobe`` to precheck xCAT management node ready for OS provision: ::
|
||||
|
||||
xcatprobe xcatmn
|
||||
[mn]: Checking all xCAT daemons are running... [ OK ]
|
||||
[mn]: Checking xcatd can receive command request... [ OK ]
|
||||
[mn]: Checking 'site' table is configured... [ OK ]
|
||||
[mn]: Checking provision network is configured... [ OK ]
|
||||
[mn]: Checking 'passwd' table is configured... [ OK ]
|
||||
[mn]: Checking important directories(installdir,tftpdir) are configured... [ OK ]
|
||||
[mn]: Checking SELinux is disabled... [ OK ]
|
||||
[mn]: Checking HTTP service is configured... [ OK ]
|
||||
[mn]: Checking TFTP service is configured... [ OK ]
|
||||
[mn]: Checking DNS service is configured... [ OK ]
|
||||
[mn]: Checking DHCP service is configured... [ OK ]
|
||||
... ...
|
||||
[mn]: Checking dhcpd.leases file is less than 100M... [ OK ]
|
||||
=================================== SUMMARY ====================================
|
||||
[MN]: Checking on MN... [ OK ]
|
||||
|
||||
#. Start the Diskful OS Deployment: ::
|
||||
|
||||
rinstall cn1 osimage=rhels7.6-x86_64-install-compute
|
||||
|
||||
#. Monitor Installation Process: ::
|
||||
|
||||
makegocons cn1
|
||||
rcons cn1
|
||||
|
||||
**Note**: The keystroke ``ctrl+e c .`` will disconnect you from the console.
|
||||
|
||||
After 5-10 min verify provision status is ``booted``: ::
|
||||
|
||||
lsdef cn1 -i status
|
||||
Object name: cn1
|
||||
status=booted
|
||||
|
||||
Use ``xdsh`` to check ``cn1`` OS version, OS provision is successful: ::
|
||||
|
||||
xdsh cn1 more /etc/*release
|
||||
cn1: ::::::::::::::
|
||||
cn1: /etc/os-release
|
||||
cn1: ::::::::::::::
|
||||
cn1: NAME="Red Hat Enterprise Linux Server"
|
||||
cn1: VERSION="7.6 (Maipo)"
|
||||
... ...
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
Quick Start Guide
|
||||
=================
|
||||
Workflow Guide
|
||||
==============
|
||||
|
||||
If xCAT looks suitable for your requirement, following steps are recommended procedure to set up an xCAT cluster.
|
||||
|
||||
@@ -30,6 +30,7 @@ Table of Contents
|
||||
|
||||
overview/index.rst
|
||||
guides/install-guides/index.rst
|
||||
guides/get-started/index.rst
|
||||
guides/admin-guides/index.rst
|
||||
advanced/index.rst
|
||||
QA/index.rst
|
||||
|
||||
@@ -10,5 +10,4 @@ xCAT enables you to easily manage large number of servers for any type of techni
|
||||
features.rst
|
||||
support_matrix.rst
|
||||
architecture.rst
|
||||
quick_start.rst
|
||||
xcat2_release.rst
|
||||
|
||||
@@ -14,6 +14,12 @@ xCAT 2.14.x
|
||||
|xCAT |New OS |New |New Feature |
|
||||
|Version | |Hardware | |
|
||||
+=================================+===============+=============+==================================+
|
||||
|| xCAT 2.14.6 2019/03/29 | | | |
|
||||
|| | | | |
|
||||
| `2.14.6 Release Notes <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_2.14.6_Release_Notes>`_ | | | |
|
||||
+---------------------------------+---------------+-------------+----------------------------------+
|
||||
|| xCAT 2.14.5 2018/12/07 |- RHEL7.6 | |- syslog tag refine |
|
||||
|| | | | |
|
||||
| `2.14.5 Release Notes <https:// | | |- site:httpport support |
|
||||
|
||||
@@ -246,7 +246,9 @@ sub getobjattrs
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub gettbldesc {
|
||||
my ($class, $objtype) = @_;
|
||||
|
||||
my $class = shift;
|
||||
my $objtype = shift;
|
||||
my @attrs;
|
||||
# The $attrs is an optional argument
|
||||
if (ref $_[0]) {
|
||||
|
||||
+33
-18
@@ -110,7 +110,7 @@ sub execute_dcp
|
||||
if (!scalar(%resolved_targets))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "No hosts in node list 1";
|
||||
$rsp->{error}->[0] = "DCP: No hosts in node list 1";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return ++$result;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ sub execute_dsh
|
||||
if (!scalar(%resolved_targets))
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = " No hosts in node list 2";
|
||||
$rsp->{error}->[0] = " DSH: No hosts in node list 2";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return ++$result;
|
||||
}
|
||||
@@ -5936,6 +5936,11 @@ sub run_rsync_postscripts
|
||||
# return from rsync is tmp/file1 not /tmp/file1
|
||||
substr($tmppostfile, 0, 1) = "";
|
||||
|
||||
# now remove .post from the postscript file for the compare
|
||||
# with the returned file name
|
||||
my($tp,$post) = split(/\.post/,$tmppostfile);
|
||||
$tmppostfile = $tp;
|
||||
|
||||
foreach my $line (@rsync_output) {
|
||||
my ($hostname, $ps) = split(/: /, $line);
|
||||
chomp $ps;
|
||||
@@ -5948,7 +5953,10 @@ sub run_rsync_postscripts
|
||||
}
|
||||
next;
|
||||
}
|
||||
if ($tmppostfile eq $ps) {
|
||||
|
||||
#the $postsfile <file>.post will be run if:
|
||||
# the <file> is updated, or
|
||||
if ($ps eq $tmppostfile ) {
|
||||
|
||||
# build xdsh queue
|
||||
# build host and all scripts to execute
|
||||
@@ -6300,6 +6308,7 @@ sub run_always_rsync_postscripts
|
||||
my @hosts = @$hostnames;
|
||||
my @newoutput = ();
|
||||
my $dshparms;
|
||||
|
||||
foreach my $postsfile (@::alwayspostscripts) {
|
||||
my $tmppostfile = $postsfile;
|
||||
|
||||
@@ -6310,28 +6319,34 @@ sub run_always_rsync_postscripts
|
||||
}
|
||||
|
||||
foreach my $host (@hosts) {
|
||||
|
||||
# build xdsh queue
|
||||
# build host and all scripts to execute
|
||||
# EXECUTEALWAYS will only execute the syncfile in the syncfile list
|
||||
foreach my $key (keys %{$$options{'destDir_srcFile'}{$host}}) {
|
||||
foreach my $key1 (keys %{ $$options{'destDir_srcFile'}{$host}{$key} }) {
|
||||
my $index = 0;
|
||||
while (my $src_file = $$options{'destDir_srcFile'}{$host}{$key}{$key1}->[$index]) {
|
||||
if ($src_file eq $tmppostfile) {
|
||||
push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host);
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach my $key1 (keys %{ $$options{'destDir_srcFile'}{$host}->{$key} }) {
|
||||
my $index = 0;
|
||||
my $key1_ref = $$options{'destDir_srcFile'}{$host}->{$key}->{$key1};
|
||||
if (ref $key1_ref eq 'ARRAY') { #stored as ARRAY for same_dest_name
|
||||
while (my $src_file =$key1_ref->[$index] ) {
|
||||
if ($src_file eq $tmppostfile) {
|
||||
push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host);
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
} else { #stroed as hash table for diff_dest_name
|
||||
foreach my $src_file (keys %{$key1_ref}) {
|
||||
if ($src_file eq $tmppostfile) {
|
||||
push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host);
|
||||
}
|
||||
}
|
||||
} #end else
|
||||
} #end foreach key1
|
||||
} #end foreach key
|
||||
} #end foreach host
|
||||
} #end foreach postsfile
|
||||
|
||||
# now if we have postscripts to run, run xdsh
|
||||
my $out;
|
||||
|
||||
|
||||
foreach my $ps (keys %{ $$dshparms{'postscripts'} }) {
|
||||
my @nodes;
|
||||
|
||||
|
||||
@@ -1059,6 +1059,10 @@ passed as argument rather than by table value',
|
||||
" requests it does not know to these servers. Note that the DNS servers on the\n" .
|
||||
" service nodes will ignore this value and always be configured to forward \n" .
|
||||
" to the management node.\n\n" .
|
||||
" dnsforwardmode: (first or only or no). This is to set forward value in named.conf options section. \n" .
|
||||
" \"first\": causes DNS requests to be forwarded before an attempt is made to resolve them via the root name servers. \n" .
|
||||
" \"only\": all requests are forwarded and none sent to the root name servers.\n".
|
||||
" \"no\": no request will be forwarded. This is the default value if not specified. \n\n" .
|
||||
" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" .
|
||||
" master: The hostname of the xCAT management node, as known by the nodes.\n\n" .
|
||||
" nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" .
|
||||
@@ -1159,7 +1163,7 @@ passed as argument rather than by table value',
|
||||
" prefix (e.g. 00:11:aa)\n\n" .
|
||||
" genpasswords: Automatically generate random passwords for BMCs when configuring\n" .
|
||||
" them.\n\n" .
|
||||
" installdir: The local directory name used to hold the node deployment packages.\n\n" .
|
||||
" installdir: The local directory name used to hold the node deployment packages(obsoleted).\n\n" .
|
||||
" installloc: The location from which the service nodes should mount the \n" .
|
||||
" deployment packages in the format hostname:/path. If hostname is\n" .
|
||||
" omitted, it defaults to the management node. The path must\n" .
|
||||
@@ -1262,7 +1266,7 @@ passed as argument rather than by table value',
|
||||
" delimiter, to specify delimiter for those columns as format of 'column:delimiter'.\n\n" .
|
||||
" dbtracelevel: The trace level for the database access log. To activate this setting, please. \n".
|
||||
" restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .\n".
|
||||
" ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print \$2}' | xargs kill -HUP \n".
|
||||
" pkill -f -HUP 'xcatd: DB Access' \n".
|
||||
" Currrent support values: \n" .
|
||||
" 0: disable the trace log for db \n" .
|
||||
" 1: trace the calls of database subroutines \n" .
|
||||
@@ -1310,7 +1314,10 @@ passed as argument rather than by table value',
|
||||
" xcatdport: The port used by the xcatd daemon for client/server communication.\n\n" .
|
||||
" xcatiport: The port used by xcatd to receive install status updates from nodes.\n\n" .
|
||||
" xcatlport: The port used by xcatd command log writer process to collect command output.\n\n" .
|
||||
" xcatsslversion: The ssl version by xcatd. Default is TLSv1.\n\n" .
|
||||
" xcatsslversion: This is the SSL_version option xcatd used and passed to \n" .
|
||||
" IO::Socket::SSL->start_SSL(). By default, this value is set to empty.\n" .
|
||||
" In this case, xcatd will use SSLv23:!SSLv2:!SSLv3:!TLSv1 internally.\n" .
|
||||
" For more detail, see https://metacpan.org/pod/IO::Socket::SSL\n\n" .
|
||||
" xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.\n\n",
|
||||
value => 'The value of the attribute specified in the "key" column.',
|
||||
comments => 'Any user-written notes.',
|
||||
|
||||
@@ -422,7 +422,7 @@ my %usage = (
|
||||
"OpenPOWER OpenBMC specific:
|
||||
rflash <noderange> {[-c|--check] | [-l|--list]}
|
||||
rflash <noderange> <tar_file_path> {[-c|--check] | [-a|--activate] | [-u|--upload]}
|
||||
rflash <noderange> <tar_file_diretory> [-d] [--no-host-reboot]
|
||||
rflash <noderange> <tar_file_diretory> [-d]
|
||||
rflash <noderange> <image_id> {[-a|--activate] | [--delete]}",
|
||||
"mkhwconn" =>
|
||||
"Usage:
|
||||
|
||||
@@ -608,7 +608,7 @@ sub get_conserver_version
|
||||
# output format:
|
||||
# conserver: conserver.com version 8.2.1
|
||||
# conserver: default access type `r'
|
||||
my @out = xCAT::Utils->runcmd("$cmd", 0);
|
||||
my @out = xCAT::Utils->runcmd("$cmd", -1);
|
||||
if ($::RUNCMD_RC != 0 || @out < 1) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -96,8 +96,6 @@ our %distnames = (
|
||||
"1446216863.790260" => "rhels7.2", #x86_64
|
||||
"1446216863.764721" => "rhels7.2", #ppc64
|
||||
"1446216863.771788" => "rhels7.2", #ppc64le
|
||||
"1527763142.409770" => "rhels8.0", #ppc64le
|
||||
"1537463022.540933" => "rhels8.0", #ppc64le
|
||||
|
||||
"1285193176.593806" => "rhelhpc6", #x86_64
|
||||
"1305067719.718814" => "rhelhpc6.1", #x86_64
|
||||
|
||||
@@ -27,11 +27,11 @@ Note: The scan method currently support is B<nmap>.
|
||||
|
||||
=item B<--range>
|
||||
|
||||
Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B<bmcdiscover> command may take a long time to return.
|
||||
Specify one or more IP ranges acceptable to B<nmap>. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B<bmcdiscover> command may take a long time to return.
|
||||
|
||||
=item B<--sn>
|
||||
|
||||
Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node.
|
||||
Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, B<bmcdiscover> will be dispatched to the specified SNs. Then, the nodename of the service node that B<bmcdiscover> is running on will be set to the 'servicenode' attribute of the discovered BMC node.
|
||||
|
||||
=item B<-s>
|
||||
|
||||
@@ -101,7 +101,7 @@ Output is similar to:
|
||||
servicenode=sn01
|
||||
conserver=sn01
|
||||
|
||||
4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console:
|
||||
4. Discover the BMCs and write the discovered node definitions into the xCAT database and write out the stanza format to the console:
|
||||
|
||||
bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ B<lsdef> - Use this command to list xCAT data object definitions.
|
||||
|
||||
B<lsdef> [B<-h>|B<--help>] [B<-t> I<object-types>] [B<-i> I<attr-list>]
|
||||
|
||||
B<lsdef> [B<-V>|B<--verbose>] [B<-l>|B<--long>] [B<-s>|B<--short>] [B<-a>|B<--all>] [B<-S>]
|
||||
[B<-t> I<object-types>] [B<-o> I<object-names>] [B<-z>|B<--stanza>] [B<-i> I<attr-list>]
|
||||
B<lsdef> [B<-V>|B<--verbose>] [B<-a>|B<--all>] [B<-S>]
|
||||
[B<-t> I<object-types>] [B<-o> I<object-names>] [B<-z>|B<--stanza>] [B<-i> I<attr-list> | [B<-l>|B<--long>] | [B<-s>|B<--short>]]
|
||||
[B<-c>|B<--compress>] [B<--osimage>] [B<--nics>] [[B<-w> I<attr>==I<val>]
|
||||
[B<-w> I<attr>=~I<val>] ...] [I<noderange>]
|
||||
|
||||
B<lsdef> [B<-l>|B<--long>] [B<-a>|B<--all>] [B<-t> I<object-types>] [B<-z>|B<--stanza>]
|
||||
[B<-i> I<attr-list>] [B<--template> [I<template-object-name>]]
|
||||
B<lsdef> [B<-a>|B<--all>] [B<-t> I<object-types>] [B<-z>|B<--stanza>]
|
||||
[B<-i> I<attr-list> | [B<-l>|B<--long>] | [B<-s>|B<--short>]] [B<--template> [I<template-object-name>]]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -28,13 +28,13 @@ in the xCAT database and xCAT object definition templates shipped in xCAT.
|
||||
|
||||
Display all definitions.
|
||||
For performance consideration, the auditlog and eventlog objects will not be listed.
|
||||
To list auditlog or eventlog objects, use lsdef -t auditlog or lsdef -t eventlog instead.
|
||||
To list auditlog or eventlog objects, use B<lsdef -t auditlog> or B<lsdef -t eventlog> instead.
|
||||
|
||||
=item B<-c|--compress>
|
||||
|
||||
Display information in compressed mode, each output line has format "<object name>: <data>".
|
||||
The output can be passed to command xcoll or xdshbak for formatted output.
|
||||
The -c flag must be used with -i flag.
|
||||
The output can be passed to command B<xcoll> or B<xdshbak> for formatted output.
|
||||
The B<-c> flag must be used with B<-i> flag.
|
||||
|
||||
=item B<-h|--help>
|
||||
|
||||
@@ -87,9 +87,10 @@ Verbose mode.
|
||||
|
||||
=item B<-w> I<attr==val> B<-w> I<attr=~val> ...
|
||||
|
||||
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.
|
||||
Use one or multiple B<-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.
|
||||
|
||||
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.
|
||||
@@ -99,7 +100,7 @@ Note: if the "val" fields includes spaces or any other characters that will be p
|
||||
|
||||
=item B<-z|--stanza>
|
||||
|
||||
Display output in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files.
|
||||
Display output in stanza format. See the "xcatstanzafile" man page for details on using xCAT stanza files. And default is to list complete object definition, use B<-i> to specify the attribute scope.
|
||||
|
||||
=back
|
||||
|
||||
@@ -126,8 +127,6 @@ when defining an xCAT node.
|
||||
|
||||
To get a list of all the objects that have been defined.
|
||||
|
||||
lsdef
|
||||
OR
|
||||
lsdef -a
|
||||
|
||||
=item 3.
|
||||
@@ -211,7 +210,7 @@ The hidden nodes are FSP/BPAs.
|
||||
|
||||
=item 15.
|
||||
|
||||
To list the nodes status and use xcoll to format the output.
|
||||
To list the nodes status and use B<xcoll> to format the output.
|
||||
|
||||
lsdef -t node -i status -c | xcoll
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ B<rflash> I<noderange> {[B<-c>|B<--check>] | [B<-l>|B<--list>]}
|
||||
|
||||
B<rflash> I<noderange> I<tar_file_path> {[B<-c>|B<--check>] | [B<-a>|B<--activate>] | [B<-u>|B<--upload>]}
|
||||
|
||||
B<rflash> I<noderange> I<tar_file_directory> [B<-d>] [B<--no-host-reboot>]
|
||||
B<rflash> I<noderange> I<tar_file_directory> [B<-d>]
|
||||
|
||||
B<rflash> I<noderange> I<image_id> {[B<-a>|B<--activate>] | [B<--delete>]}
|
||||
|
||||
@@ -125,8 +125,6 @@ B<-d>:
|
||||
|
||||
This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and Host .tar files. When BMC and Host tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit.
|
||||
|
||||
B<Note:> When using B<--no-host-reboot>, it will not reboot the host after BMC is reboot.
|
||||
|
||||
B<--delete>:
|
||||
|
||||
This delete option will delete update image from BMC. It expects an ID as the input.
|
||||
|
||||
@@ -4,7 +4,7 @@ B<updatenode> - Update nodes in an xCAT cluster environment.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<updatenode> I<noderange> [B<-V>|B<--verbose>] [B<-F>|B<--sync>] [B<-f>|B<--snsync>] [B<-r>|B<--node-rcp> [I<full_path_to_remote_copy_command>]] [B<-S>|B<--sw>] [B<-l> I<userID>] [B<-P>|B<--scripts> [I<script1,script2...>]] [B<-s>|B<--sn>] [B<-A>|B<--updateallsw>] [B<-c>|B<--cmdlineonly>] [B<-d> I<alt_source_dir>] [B<--fanout>=I<fanout_value>] [B<-t> I<timeout>} [I<attr=val> [I<attr=val...>]] [B<-n>|B<--noverify>]
|
||||
B<updatenode> I<noderange> [B<-V>|B<--verbose>] [B<-F>|B<--sync>] [B<-f>|B<--snsync>] [B<-r>|B<--node-rcp> [I<node_remote_copy_command>]] [B<-S>|B<--sw>] [B<-l> I<userID>] [B<-P>|B<--scripts> [I<script1,script2...>]] [B<-s>|B<--sn>] [B<-A>|B<--updateallsw>] [B<-c>|B<--cmdlineonly>] [B<-d> I<alt_source_dir>] [B<--fanout>=I<fanout_value>] [B<-t> I<timeout>} [I<attr=val> [I<attr=val...>]] [B<-n>|B<--noverify>]
|
||||
|
||||
B<updatenode> B<noderange> [B<-k>|B<--security>] [B<-t> I<timeout>]
|
||||
|
||||
@@ -18,7 +18,7 @@ B<updatenode> [B<-h>|B<--help>] [B<-v>|B<--version>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The updatenode command is run on the xCAT management node and can be used
|
||||
The B<updatenode> command is run on the xCAT management node and can be used
|
||||
to perform the following node updates:
|
||||
|
||||
=over 3
|
||||
@@ -38,10 +38,10 @@ Update the ca and credentials for the service nodes.
|
||||
|
||||
=back
|
||||
|
||||
The default behavior when no options are input to updatenode will be to run
|
||||
The default behavior when no options are input to B<updatenode> will be to run
|
||||
the following options B<-S>, B<-P> and B<-F> options in this order.
|
||||
If you wish to limit updatenode to specific
|
||||
actions you can use combinations of the B<-S>, B<-P>, and B<-F> flags.
|
||||
If you wish to limit B<updatenode> to specific
|
||||
actions you can use combination of the B<-S>, B<-P>, and B<-F> flags.
|
||||
|
||||
For example, If you just want to synchronize configuration file you could
|
||||
specify the B<-F> flag. If you want to synchronize files and update
|
||||
@@ -55,7 +55,7 @@ The flag B<-f> (B<--snsync>) can NOT be used together with B<-S>, B<-P>, and B<-
|
||||
|
||||
Note: In a large cluster environment the updating of nodes in an ad hoc
|
||||
manner can quickly get out of hand, leaving the system administrator with
|
||||
a very confusing environment to deal with. The updatenode command is
|
||||
a very confusing environment to deal with. The B<updatenode> command is
|
||||
designed to encourage users to handle cluster updates in a manner that
|
||||
is recorded and easily repeatable.
|
||||
|
||||
@@ -72,14 +72,14 @@ Create a synclist file.
|
||||
Indicate the location of the synclist file.
|
||||
|
||||
=item *
|
||||
Run the updatenode command to update the nodes.
|
||||
Run the B<updatenode> command to update the nodes.
|
||||
|
||||
=back
|
||||
|
||||
Files may be distributed and synchronized for both diskless and
|
||||
diskful nodes. Syncing files to NFS-based statelite nodes is not supported.
|
||||
|
||||
More information on using the synchronization file function is in the following doc: Using_Updatenode.
|
||||
More information on using the synchronization file function is in the following document: <https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.html>
|
||||
|
||||
=head3 Create the synclist file
|
||||
|
||||
@@ -88,9 +88,7 @@ where the files should be synced to. In the synclist file, each
|
||||
line is an entry which describes the location of the source files
|
||||
and the destination location for the files on the target node.
|
||||
|
||||
For more information on creating your synclist files and where to put them, read:
|
||||
|
||||
Sync-ing_Config_Files_to_Nodes
|
||||
For more information on creating your synclist files and where to put them, read here: <https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.html>
|
||||
|
||||
|
||||
=head3 Run updatenode to synchronize the files
|
||||
@@ -289,12 +287,12 @@ Used to specify a source directory other than the standard lpp_source directory
|
||||
=item B<-F|--sync>
|
||||
|
||||
Specifies that file synchronization should be
|
||||
performed on the nodes. rsync/scp and ssh must
|
||||
performed on the nodes. B<rsync/scp> and B<ssh> must
|
||||
be installed and configured on the nodes.
|
||||
The function is not supported for NFS-based statelite installations.
|
||||
For NFS-based statelite installations to sync files, you should use the
|
||||
read-only option for files/directories listed in
|
||||
litefile table with source location specified in the litetree table.
|
||||
B<litefile> table with source location specified in the B<litetree> table.
|
||||
|
||||
|
||||
=item B<-f|--snsync>
|
||||
@@ -302,32 +300,32 @@ litefile table with source location specified in the litetree table.
|
||||
Specifies that file synchronization should be
|
||||
performed to the service nodes that service the
|
||||
nodes in the noderange. This updates the service
|
||||
nodes with the data to sync to the nodes. rsync/scp and ssh must
|
||||
nodes with the data to sync to the nodes. B<rsync/scp> and B<ssh> must
|
||||
be installed and configured on the service nodes.
|
||||
For hierarchy, this optionally can be done before syncing the files
|
||||
to the nodes with the -F flag. If the -f flag is not used, then
|
||||
the -F flag will sync the servicenodes before the nodes automatically.
|
||||
to the nodes with the B<-F> flag. If the B<-f> flag is not used, then
|
||||
the B<-F> flag will sync the service nodes before the nodes automatically.
|
||||
When installing nodes in a hierarchical cluster, this flag should be
|
||||
used to sync the service nodes before the install, since the files will
|
||||
be sync'd from the service node by the syncfiles postscript during the
|
||||
be synced from the service node by the B<syncfiles> postscript during the
|
||||
install.
|
||||
The function is not supported for NFS-based statelite installations.
|
||||
For statelite installations to sync files, you should use the
|
||||
read-only option for files/directories listed in
|
||||
litefile table with source location specified in the litetree table.
|
||||
B<litefile> table with source location specified in the B<litetree> table.
|
||||
|
||||
|
||||
=item [B<-r>|B<--node-rcp> [I<full_path_to_remote_copy_command>]]
|
||||
=item [B<-r>|B<--node-rcp> [I<node_remote_copy_command>]]
|
||||
|
||||
Specifies the full path of the remote copy command used for syncing files to node targets, such as "/usr/bin/rsync" or "/usr/bin/scp". If not specified, rsync will be used by default.
|
||||
Specifies the full path of the remote copy command used for syncing files to node targets, such as B</usr/bin/rsync> or B</usr/bin/scp>. If not specified, B<rsync> will be used by default.
|
||||
|
||||
Notice: The synclist for "-r /usr/bin/scp" has some differences with "-r /usr/bin/rsync":
|
||||
Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B<-r /usr/bin/rsync>:
|
||||
|
||||
1) the ``EXECUTE`` clause is not supported in "-r /usr/bin/scp"
|
||||
1) the B<EXECUTE> clause in synclist file is not supported with B<-r /usr/bin/scp> flag
|
||||
|
||||
2) if the destination directory specified in synclist is an existing file on target node, "updatenode -r /usr/bin/scp" will fail with ``scp: <destination directory>: Not a directory``
|
||||
2) if the destination directory specified in synclist file is an existing file on target node, B<updatenode -r /usr/bin/scp> will fail with "scp: <destination directory>: Not a directory"
|
||||
|
||||
3) if the destination file specified in synclist is an existing directory on target node, "updatenode -r /usr/bin/scp" will fail with ``scp: <destination file>: Is a directory``
|
||||
3) if the destination file specified in synclist file is an existing directory on target node, B<updatenode -r /usr/bin/scp> will fail with "scp: <destination file>: Is a directory"
|
||||
|
||||
|
||||
=item B<-g|--genmypost>
|
||||
@@ -359,8 +357,8 @@ See the document Granting_Users_xCAT_privileges for required xcat/sudo setup.
|
||||
=item B<-P|--scripts>
|
||||
|
||||
Specifies that postscripts and postbootscripts should be run on the nodes.
|
||||
updatenode -P syncfiles is not supported. The syncfiles postscript can only
|
||||
be run during install. You should use updatenode <noderange> -F instead.
|
||||
File sync with B<updatenode -P syncfiles> is not supported. The B<syncfiles> postscript can only
|
||||
be run during install. You should use B<updatenode -F> instead.
|
||||
|
||||
=item B<-S|--sw>
|
||||
|
||||
@@ -417,11 +415,11 @@ To run postscripts,postbootscripts and file synchronization only on the node "cl
|
||||
updatenode clstrn01 -F -P
|
||||
|
||||
=item 3.
|
||||
Running updatenode -P with the syncfiles postscript is not supported. You should use updatenode -F instead.
|
||||
Running B<updatenode -P> with the B<syncfiles> postscript is not supported. You should use B<updatenode -F> instead.
|
||||
|
||||
Do not run:
|
||||
|
||||
updatenode clstrno1 -P syncfiles
|
||||
updatenode clstrn01 -P syncfiles
|
||||
|
||||
Run:
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
=head1 B<NAME>
|
||||
|
||||
B<xdcp> - Concurrently copies files to or from multiple nodes. In addition, provides an option to use rsync to update the files on the nodes, or to an installation image on the local node.
|
||||
B<xdcp> - Concurrently copies files to or from multiple nodes. In addition, provides an option to use B<rsync> to update the files on the managed nodes, or to an installation image on the local node.
|
||||
|
||||
=head1 B<SYNOPSIS>
|
||||
|
||||
B<xdcp> I<noderange> [[B<-B> | B<--bypass>] [B<-f> I<fanout>] [B<-L>] [B<-l> I<userID>] [B<-o> I<node_options>] [B<-p>] [B<-P>] [B<-r> I<node_remote_shell>] [B<-R>] [B<-t> I<timeout>] [B<-T>] [B<-v>] [B<-q>] [B<-X> I<env_list>] I<sourcefile.... targetpath>
|
||||
B<xdcp> I<noderange> [[B<-B> | B<--bypass>] [B<-f> I<fanout>] [B<-L>] [B<-l> I<userID>] [B<-o> I<node_options>] [B<-p>] [B<-P>] [B<-r> I<node remote copy command] [B<-R>] [B<-t> I<timeout>] [B<-T>] [B<-v>] [B<-q>] [B<-X> I<env_list>] I<sourcefile.... targetpath>
|
||||
|
||||
B<xdcp> I<noderange> [B<-F> I<rsync input file>]
|
||||
B<xdcp> I<noderange> [B<-F> I<rsynclist input file>] [B<-r> I<node remote copy command>]
|
||||
|
||||
B<xdcp> I<computenoderange> [B<-s> B<-F> I<rsync input file>]
|
||||
|
||||
|
||||
B<xdcp> [B<-i> I<path to install image>] [B<-F> I<rsync input file>]
|
||||
B<xdcp> I<computenoderange> [B<-s> B<-F> I<synclist input file>] [B<-r> I<node remote copy command>]
|
||||
|
||||
B<xdcp> [B<-i> I<install image>] [B<-F> I<synclist input file>] [B<-r> I<node remote copy command>]
|
||||
|
||||
B<xdcp> [B<-h> | B<-V> | B<-q>]
|
||||
|
||||
@@ -20,34 +18,33 @@ B<xdcp> [B<-h> | B<-V> | B<-q>]
|
||||
=head1 B<DESCRIPTION>
|
||||
|
||||
The B<xdcp> command concurrently copies files to or from remote target
|
||||
nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the target_path with the name of the
|
||||
remote node or device appended to the copied source_file name. The
|
||||
/usr/bin/rcp command is the model for syntax and security.
|
||||
If using hierarchy, then xdcp runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, SNsyncfiledir attribute, or the default path /var/xcat/syncfiles on the service node, if the attribute is not defined. The -P flag will not automatically copy
|
||||
nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the I<targetpath> with the name of the
|
||||
remote node or device appended to the copied I<sourcefile> name. The
|
||||
B</usr/bin/rcp> command is the model for syntax and security.
|
||||
If using hierarchy, then B<xdcp> runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, B<SNsyncfiledir> attribute, or the default path B</var/xcat/syncfiles> on the service node, if the attribute is not defined. The B<-P> flag will not automatically copy
|
||||
the files from the compute node to the Management node, hierarchically. There
|
||||
is a two step process, see B<-P> flag.
|
||||
If the Management Node is target node, it must be defined in the xCAT database with nodetype=mn. When the B<xdcp> command runs the Management Node as the target, it does not use remote commands but uses the local OS copy (B<cp>) command.
|
||||
If the Management Node is target node, it must be defined in the xCAT database with B<nodetype=mn>. When the B<xdcp> command runs with the Management Node as the target, it does not use remote commands but uses the local OS copy (B<cp>) command.
|
||||
|
||||
B<REMOTE> B<USER>:
|
||||
|
||||
A user_ID can be specified for the remote copy command. Remote user
|
||||
specification is identical for the B<xdcp> and B<xdsh> commands. See the B<xdsh>
|
||||
command for more information.
|
||||
A user_ID can be specified for the remote copy command. Remote user
|
||||
specification is identical for the B<xdcp> and B<xdsh> commands.
|
||||
See the B<xdsh> command for more information.
|
||||
|
||||
B<REMOTE> B<COMMAND> B<COPY>:
|
||||
|
||||
The B<xdcp> command uses a configurable remote copy command to execute
|
||||
remote copies on remote targets. Support is explicitly provided for
|
||||
Remote Shell rcp command, the OpenSSH scp command and the
|
||||
/usr/bin/rsync command.
|
||||
Remote Shell B<rcp> command, the OpenSSH B<scp> command and the
|
||||
B</usr/bin/rsync> command.
|
||||
|
||||
For node targets, the remote copy command is determined by the follow-
|
||||
ing order of precedence:
|
||||
For node targets, the remote copy command is determined by the following order of precedence:
|
||||
|
||||
|
||||
1. The B<-r> flag.
|
||||
|
||||
2. The B</usr/bin/scp> command.
|
||||
2. The B</usr/bin/rsync> command.
|
||||
|
||||
B<COMMAND> B<EXECUTIONS>:
|
||||
|
||||
@@ -60,10 +57,10 @@ appropriate.
|
||||
|
||||
A timeout value for remote copy command execution can be specified with
|
||||
the B<-t> flag or DSH_TIMEOUT environment variable. If any remote target
|
||||
does not respond within the timeout value, the xdcp command displays an
|
||||
does not respond within the timeout value, the B<xdcp> command displays an
|
||||
error message and exits.
|
||||
|
||||
The B<-T> flag provides diagnostic trace information for dcp command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed.
|
||||
The B<-T> flag provides diagnostic trace information for B<xdcp> command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed.
|
||||
|
||||
The B<xdcp> command can be executed silently using the B<-Q> flag; no target
|
||||
standard output or standard error is displayed.
|
||||
@@ -76,139 +73,37 @@ standard output or standard error is displayed.
|
||||
|
||||
Specifies the complete path for the file to be copied to or
|
||||
from the target. Multiple files can be specified. When used
|
||||
with the -R flag, only a single directory can be specified.
|
||||
When used with the -P flag, only a single file can be specified.
|
||||
with the B<-R> flag, only a single directory can be specified.
|
||||
When used with the B<-P> flag, only a single file can be specified.
|
||||
|
||||
=item I<targetpath>
|
||||
|
||||
If one source_file file, then it specifies the file to copy the source_file
|
||||
file to on the target. If multiple source_file files, it specifies
|
||||
the directory to copy the source_file files to on the target.
|
||||
If the -P flag is specified, the target_path is the local host location
|
||||
If one source file, then it specifies the file to copy the source
|
||||
file to on the target. If multiple source files, it specifies
|
||||
the directory to copy the source files to on the target.
|
||||
If the B<-P> flag is specified, the I<targetpath> is the local host location
|
||||
for the copied files. The remote file directory structure is recreated
|
||||
under target_path and the remote target name is appended
|
||||
to the copied source_file name in the target_path directory.
|
||||
Note: the targetpath directory must exist.
|
||||
under I<targetpath> and the remote target name is appended
|
||||
to the copied I<sourcefile> name in the I<targetpath> directory.
|
||||
Note: the I<targetpath> directory must exist.
|
||||
|
||||
=item B<-B>|B<--bypass>
|
||||
|
||||
Runs in bypass mode, use if the xcatd daemon is hung.
|
||||
Runs in bypass mode, use if the B<xcatd> daemon is not responding.
|
||||
|
||||
=item B<-f>|B<--fanout> I<fanout_value>
|
||||
|
||||
Specifies a fanout value for the maximum number of concur-
|
||||
rently executing remote shell processes. Serial execution
|
||||
Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution
|
||||
can be specified by indicating a fanout value of B<1>.
|
||||
If B<-f> is not specified, a default fanout value of B<64> is used.
|
||||
|
||||
=item B<-F>|B<--File> I<rsync input file>
|
||||
=item B<-F>|B<--File> I<synclist input file>
|
||||
|
||||
Specifies the path to the file that will be used to
|
||||
build the B<rsync> command.
|
||||
The format of the input file is as follows, each line contains:
|
||||
The format of the input file is described here: <https://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.html>
|
||||
|
||||
<path to source file1> <path to source file2> ... -> < path to destination file/directory>
|
||||
|
||||
or
|
||||
|
||||
<path to source file> -> <path to destination file>
|
||||
|
||||
or
|
||||
|
||||
<path to source file> -> <path to destination directory ( must end in /)>
|
||||
|
||||
For example:
|
||||
|
||||
/etc/password /etc/hosts -> /etc
|
||||
|
||||
/tmp/file2 -> /tmp/file2
|
||||
|
||||
/tmp/file2 -> /tmp/
|
||||
|
||||
/tmp/filex -> /tmp/source/filey
|
||||
|
||||
/etc/* -> /etc/
|
||||
|
||||
B<Running postscripts after files are sync'd to the nodes>:
|
||||
|
||||
After you define the files to rsync, you can add an B<EXECUTE:> clause in the synclist file. The B<EXECUTE:> clause will list all the postscripts that you would like to run after the files are sync'd to the node.
|
||||
The postscript file must be of the form B<filename.post>, where the <filename>
|
||||
is the <filename> is the from <filename>, reside in the same
|
||||
directory as B<filename>, and be executable.
|
||||
If the file B<filename> is rsync'd to the node, then the B<filename.post>
|
||||
will automatically be run on the node.
|
||||
If the file B<filename> is not updated on the node, the B<filename.post> will not be run.
|
||||
|
||||
Putting the B<filename.post> in the file list to rsync to the node is required
|
||||
for hierarchical clusters. It is optional for non-hierarchical clusters.
|
||||
|
||||
Another option is the B<EXECUTEALWAYS:> clause in the synclist file. The B<EXECUTEALWAYS:> will list all the postscripts that you would like to run after the files are sync'd to the nodes. These scripts will run whether or not any files are sync'd to the nodes. The scripts have no special format, but must contain the fully qualified path.
|
||||
|
||||
The scripts must be also added to the file list to rsync to the node for hierarchical clusters. It is optional for non-hierarchical clusters.
|
||||
|
||||
For example, your rsynclist file may look like this:
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
|
||||
If /tmp/file2 and /tmp/file3 update /tmp/file2 and /tmp/filex on the node, then the postscripts /tmp/file2.post and /tmp/file3.post are automatically run on
|
||||
the node. /tmp/myscript will always be run on the node.
|
||||
|
||||
|
||||
Another option is the B<APPEND:> clause in the synclist file. The B<APPEND:> clause is used to append the contents of the input file to an existing file on the node. The file to append B<must> already exist on the node and not be part of the synclist that contains the B<APPEND:> clause.
|
||||
|
||||
For example, your rsynclist file may look like this:
|
||||
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
APPEND:
|
||||
/etc/myappenddir/appendfile -> /etc/mysetup/setup
|
||||
/etc/myappenddir/appendfile2 -> /etc/mysetup/setup2
|
||||
|
||||
When you use the append script, the file (left) of the arrow is appended to the file right of the arrow. In this example, /etc/myappenddir/appendfile is appended to /etc/mysetup/setup file, which must already exist on the node. The /opt/xcat/share/xcat/scripts/xdcpappend.sh is used to accomplish this.
|
||||
|
||||
Another option is the B<MERGE:> clause in the synclist file. The B<MERGE:> clause is used to append the contents of the input file to /etc/passwd, /etc/group, or /etc/shadow on a Linux node. It is only supported for those files and only on Linux. You must not use both the APPEND and MERGE funcion for these three files. The processing could end up not creating the file you desire. The MERGE function is the preferred method, because APPEND only adds to the file. MERGE will add to the file but also insure there are no duplicate entries.
|
||||
|
||||
For example, your rsynclist file may look like this:
|
||||
/tmp/share/file2 -> /tmp/file2
|
||||
/tmp/share/file2.post -> /tmp/file2.post
|
||||
/tmp/share/file3 -> /tmp/filex
|
||||
/tmp/share/file3.post -> /tmp/file3.post
|
||||
/tmp/myscript -> /tmp/myscript
|
||||
# the below are postscripts
|
||||
EXECUTE:
|
||||
/tmp/share/file2.post
|
||||
/tmp/share/file3.post
|
||||
EXECUTEALWAYS:
|
||||
/tmp/myscript
|
||||
APPEND:
|
||||
/custom/mypasswd -> /etc/passwd
|
||||
/custom/mygroups -> /etc/group
|
||||
/custom/myshadow -> /etc/shadow
|
||||
|
||||
Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file.
|
||||
|
||||
For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes
|
||||
|
||||
On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute.
|
||||
On Linux B<rsync> always uses ssh remoteshell. On AIX, B<ssh> or B<rsh> is used depending on the B<site.useSSHonAIX> table attribute.
|
||||
|
||||
=item B<-h>|B<--help>
|
||||
|
||||
@@ -218,15 +113,14 @@ Displays usage information.
|
||||
=item B<-i>|B<--rootimg> I<install image>
|
||||
|
||||
|
||||
Specifies the path to the install image on the local Linux node.
|
||||
|
||||
Specifies the path to the install image on the local Linux node.
|
||||
|
||||
|
||||
=item B<-o>|B<--node-options> I<node_options>
|
||||
|
||||
Specifies options to pass to the remote shell command for
|
||||
node targets. The options must be specified within double
|
||||
quotation marks ("") to distinguish them from B<xdsh> options.
|
||||
quotation marks ("") to distinguish them from B<xdcp> options.
|
||||
|
||||
=item B<-p>|B<--preserve>
|
||||
|
||||
@@ -236,14 +130,14 @@ the configured remote copy command.
|
||||
=item B<-P>|B<--pull>
|
||||
|
||||
Pulls (copies) the files from the targets and places them in
|
||||
the target_path directory on the local host. The target_path
|
||||
the I<targetpath> directory on the local host. The I<targetpath>
|
||||
must be a directory. Files pulled from remote machines have
|
||||
._target appended to the file name to distinguish between
|
||||
them. When the B<-P> flag is used with the B<-R> flag, ._target is
|
||||
B<._target> appended to the file name to distinguish between
|
||||
them. When the B<-P> flag is used with the B<-R> flag, B<._target> is
|
||||
appended to the directory. Only one file per invocation of the
|
||||
xdcp pull command can be pulled from the specified targets.
|
||||
Hierarchy is not automatically support yet. You must first pull
|
||||
the file to the Service Node and then pull the file to the Management
|
||||
B<xdcp> pull command can be pulled from the specified targets.
|
||||
In hierarchy, you must first pull
|
||||
the file to the service node and then pull the file to the management
|
||||
node.
|
||||
|
||||
=item B<-q>|B<--show-config>
|
||||
@@ -255,10 +149,17 @@ valid contexts. Each setting is prefixed with I<context>: to
|
||||
identify the source context of the setting.
|
||||
|
||||
|
||||
=item B<-r>|B<--node-rcp> I<node_remote_copy>
|
||||
=item B<-r>|B<--node-rcp> I<node remote copy command>
|
||||
|
||||
Specifies the full path of the remote copy command used
|
||||
for remote command execution on node targets.
|
||||
Specifies the full path of the remote copy command used for syncing files to node targets, such as B</usr/bin/rsync> or B</usr/bin/scp>. If not specified, B<rsync> will be used by default.
|
||||
|
||||
Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B<-r /usr/bin/rsync>:
|
||||
|
||||
1) the B<EXECUTE> clause in synclist file is not supported with B<-r /usr/bin/scp> flag
|
||||
|
||||
2) if the destination directory specified in synclist file is an existing file on target node, B<xdcp -r /usr/bin/scp> will fail with "scp: <destination directory>: Not a directory"
|
||||
|
||||
3) if the destination file specified in synclist file is an existing directory on target node, B<xdcp -r /usr/bin/scp> will fail with "scp: <destination file>: Is a directory"
|
||||
|
||||
|
||||
=item B<-R>|B<--recursive> I<recursive>
|
||||
@@ -266,16 +167,15 @@ for remote command execution on node targets.
|
||||
Recursively copies files from a local directory to the remote
|
||||
targets, or when specified with the B<-P> flag, recursively pulls
|
||||
(copies) files from a remote directory to the local host. A
|
||||
single source directory can be specified using the source_file
|
||||
parameter.
|
||||
single source directory can be specified using the I<sourcefile> parameter.
|
||||
|
||||
|
||||
=item B<-s> I<synch service nodes>
|
||||
|
||||
Will only sync the files listed in the synclist (B<-F>), to the service
|
||||
nodes for the input compute node list. The files will be placed in the
|
||||
directory defined by the site.SNsyncfiledir attribute, or the default
|
||||
/var/xcat/syncfiles directory.
|
||||
directory defined by the B<site.SNsyncfiledir> table attribute, or the default
|
||||
B</var/xcat/syncfiles> directory.
|
||||
|
||||
=item B<-t>|B<--timeout> I<timeout>
|
||||
|
||||
@@ -361,9 +261,8 @@ variable is overridden by the B<-S> flag.
|
||||
|
||||
=item B<DSH_TIMEOUT>
|
||||
|
||||
Specifies the time, in seconds, to wait for output from
|
||||
each remote target. This variable is overridden by the B<-t>
|
||||
flag.
|
||||
Specifies the time, in seconds, to wait for output from
|
||||
each remote target. This variable is overridden by the B<-t> flag.
|
||||
|
||||
=back
|
||||
|
||||
@@ -374,13 +273,12 @@ Exit values for each remote copy command execution are displayed in
|
||||
messages from the xdcp command, if the remote copy command exit value is
|
||||
non-zero. A non-zero return code from a remote copy command indicates
|
||||
that an error was encountered during the remote copy. If a remote copy
|
||||
command encounters an error, execution of the remote copy on that tar-
|
||||
get is bypassed.
|
||||
command encounters an error, execution of the remote copy on that target is bypassed.
|
||||
|
||||
The xdcp command exit code is 0, if the xdcp command executed without
|
||||
The B<xdcp> command exit code is 0, if the B<xdcp> command executed without
|
||||
errors and all remote copy commands finished with exit codes of 0. If
|
||||
internal xdcp errors occur or the remote copy commands do not complete
|
||||
successfully, the xdcp command exit value is greater than 0.
|
||||
internal B<xdcp> errors occur or the remote copy commands do not complete
|
||||
successfully, the B<xdcp> command exit value is greater than 0.
|
||||
|
||||
|
||||
|
||||
@@ -424,7 +322,7 @@ host as /var/log._target, enter:
|
||||
xdcp NodeGroup1 -f 12 -RP /var/log/testlogdir /var/log
|
||||
|
||||
=item 3.
|
||||
To copy /localnode/smallfile and /tmp/bigfile to /tmp on node1
|
||||
To copy /localnode/smallfile and /tmp/bigfile to B/tmp on node1
|
||||
using rsync and input -t flag to rsync, enter:
|
||||
|
||||
xdcp node1 -r /usr/bin/rsync -o "-t" /localnode/smallfile /tmp/bigfile /tmp
|
||||
@@ -456,72 +354,67 @@ To copy the /etc/hosts file from node1 and node2 to the
|
||||
=item 8.
|
||||
To rsync the /etc/hosts file to your compute nodes:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a syncfile /tmp/myrsync, with this line:
|
||||
|
||||
/etc/hosts -> /etc/hosts
|
||||
/etc/hosts -> /etc/hosts
|
||||
|
||||
or
|
||||
|
||||
/etc/hosts -> /etc/ (last / is required)
|
||||
/etc/hosts -> /etc/ (last / is required)
|
||||
|
||||
Run:
|
||||
Then run:
|
||||
|
||||
xdcp compute -F /tmp/myrsync
|
||||
|
||||
=item 9.
|
||||
To rsync all the files in /home/mikev to the compute nodes:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/home/mikev/* -> /home/mikev/ (last / is required)
|
||||
/home/mikev/* -> /home/mikev/ (last / is required)
|
||||
|
||||
Run:
|
||||
Then run:
|
||||
|
||||
xdcp compute -F /tmp/myrsync
|
||||
|
||||
=item 10.
|
||||
To rsync to the compute nodes, using service nodes, the command will first
|
||||
rsync the files to the /var/xcat/syncfiles directory on the service nodes and then rsync the files from that directory to the compute nodes. The /var/xcat/syncfiles default directory on the service nodes, can be changed by putting a directory value in the site table SNsyncfiledir attribute.
|
||||
To rsync to the compute nodes, using service nodes:
|
||||
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
or
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc/
|
||||
/etc/hosts /etc/passwd -> /etc/
|
||||
|
||||
Run:
|
||||
Then run:
|
||||
|
||||
xdcp compute -F /tmp/myrsync
|
||||
|
||||
to update the Compute Nodes
|
||||
|
||||
=item 11.
|
||||
To rsync to the service nodes in preparation for rsyncing the compute nodes
|
||||
during an install from the service node.
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
Run:
|
||||
Then run:
|
||||
|
||||
xdcp compute -s -F /tmp/myrsync
|
||||
|
||||
to sync the service node for compute
|
||||
|
||||
=item 12.
|
||||
To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with these line:
|
||||
First create a rsync file /tmp/myrsync, with these line:
|
||||
|
||||
/etc/file1 -> /etc/filex
|
||||
/etc/file1 -> /etc/filex
|
||||
|
||||
/etc/file2 -> /etc/filey
|
||||
/etc/file2 -> /etc/filey
|
||||
|
||||
Run:
|
||||
Then run:
|
||||
|
||||
xdcp compute -F /tmp/myrsync
|
||||
|
||||
@@ -530,11 +423,11 @@ to update the Compute Nodes
|
||||
=item 13.
|
||||
To rsync files in the Linux image at /install/netboot/fedora9/x86_64/compute/rootimg on the MN:
|
||||
|
||||
Create a rsync file /tmp/myrsync, with this line:
|
||||
First create a rsync file /tmp/myrsync, with this line:
|
||||
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
/etc/hosts /etc/passwd -> /etc
|
||||
|
||||
Run:
|
||||
Then run:
|
||||
|
||||
xdcp -i /install/netboot/fedora9/x86_64/compute/rootimg -F /tmp/myrsync
|
||||
|
||||
|
||||
@@ -2,4 +2,5 @@ opt/xcat/lib/python/agent
|
||||
opt/xcat/lib/python/agent/xcatagent
|
||||
opt/xcat/lib/python/agent/common
|
||||
opt/xcat/lib/python/agent/hwctl
|
||||
opt/xcat/lib/python/agent/hwctl/executor
|
||||
opt/xcat/lib/python/agent/hwctl/openbmc
|
||||
opt/xcat/lib/python/agent/hwctl/redfish
|
||||
|
||||
@@ -55,13 +55,13 @@ class ClientShell(object):
|
||||
|
||||
buf = json.dumps(req)
|
||||
s.send(utils.int2bytes(len(buf)))
|
||||
s.send(buf)
|
||||
s.send(buf.encode('utf-8'))
|
||||
while True:
|
||||
sz = s.recv(4)
|
||||
if len(sz) == 0:
|
||||
break
|
||||
sz = utils.bytes2int(sz)
|
||||
data = s.recv(sz)
|
||||
data = s.recv(sz).decode('utf-8')
|
||||
print(data)
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
class SelfServerException(Exception) :
|
||||
def __init__(self, message, detail_msg= "", host_and_port="") :
|
||||
super(Exception, self).__init__(message)
|
||||
self.message = message
|
||||
self.host_and_port = host_and_port
|
||||
self.detail_msg = detail_msg
|
||||
|
||||
class SelfClientException(Exception) :
|
||||
def __init__(self, message, code) :
|
||||
super(Exception, self).__init__(message)
|
||||
self.message = message
|
||||
self.code = code
|
||||
|
||||
@@ -9,14 +9,16 @@ from gevent.subprocess import Popen, PIPE
|
||||
import requests
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
from requests.auth import AuthBase
|
||||
|
||||
import exceptions as xcat_exception
|
||||
from . import exceptions as xcat_exception
|
||||
|
||||
class RestSession(object):
|
||||
|
||||
def __init__(self):
|
||||
self.session = requests.Session()
|
||||
self.cookies = None
|
||||
self.auth = None
|
||||
|
||||
def request(self, method, url, headers, data=None, timeout=30):
|
||||
|
||||
@@ -24,35 +26,37 @@ class RestSession(object):
|
||||
response = self.session.request(method, url,
|
||||
data=data,
|
||||
headers=headers,
|
||||
auth=self.auth,
|
||||
verify=False,
|
||||
timeout=timeout)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
# Extract real reason for the exception and host/port from ConnectionError message
|
||||
# Sometimes e.message is a list, sometimes is a string. Look for different patterns
|
||||
# to extract the data needed.
|
||||
e = str(e)
|
||||
causing_error = "n/a"
|
||||
host_and_port = "n/a"
|
||||
if "]" in e.message[0]:
|
||||
causing_error_part1 = e.message[0].split("]")[1]
|
||||
if "]" in e:
|
||||
causing_error_part1 = e.split("]")[1]
|
||||
causing_error = causing_error_part1.split("'")[0]
|
||||
causing_error = causing_error.strip()
|
||||
host_and_port = self.extract_server_and_port(e.message[0], "STRING")
|
||||
host_and_port = self.extract_server_and_port(e, "STRING")
|
||||
|
||||
if "Connection aborted." in e.message[0]:
|
||||
if "Connection aborted." in e:
|
||||
causing_error = "Connection reset by peer"
|
||||
host_and_port = self.extract_server_and_port(url, "URL")
|
||||
|
||||
if "connect timeout=" in e.message[0]:
|
||||
if "connect timeout=" in e:
|
||||
causing_error = "timeout"
|
||||
host_and_port = self.extract_server_and_port(e.message[0], "STRING")
|
||||
host_and_port = self.extract_server_and_port(e, "STRING")
|
||||
|
||||
message = 'Failed to connect to server.'
|
||||
# message = '\n\n--> {0} \n\n'.format(e.message[0])
|
||||
raise xcat_exception.SelfServerException(message, '({0})'.format(causing_error), host_and_port)
|
||||
|
||||
except requests.exceptions.Timeout as e:
|
||||
e = str(e)
|
||||
causing_error = "timeout"
|
||||
host_and_port = self.extract_server_and_port(e.message[0], "STRING")
|
||||
host_and_port = self.extract_server_and_port(e, "STRING")
|
||||
|
||||
message = 'Timeout to connect to server'
|
||||
raise xcat_exception.SelfServerException(message, '({0})'.format(causing_error), host_and_port)
|
||||
@@ -60,6 +64,9 @@ class RestSession(object):
|
||||
if not self.cookies:
|
||||
self.cookies = requests.utils.dict_from_cookiejar(self.session.cookies)
|
||||
|
||||
if not self.auth and 'X-Auth-Token' in response.headers:
|
||||
self.auth = XTokenAuth(response.headers['X-Auth-Token'])
|
||||
|
||||
return response
|
||||
|
||||
def extract_server_and_port(self, message_string, format="STRING"):
|
||||
@@ -127,3 +134,13 @@ class RestSession(object):
|
||||
raise SelfServerException(error)
|
||||
|
||||
return response
|
||||
|
||||
class XTokenAuth(AuthBase):
|
||||
|
||||
def __init__(self,authToken):
|
||||
|
||||
self.authToken=authToken
|
||||
|
||||
def __call__(self, auth):
|
||||
auth.headers['X-Auth-Token']=self.authToken
|
||||
return(auth)
|
||||
|
||||
@@ -35,7 +35,7 @@ class BaseCommand(object):
|
||||
self._pre(op, *args, **kwargs)
|
||||
self._execute(op, *args, **kwargs)
|
||||
self._post(op, *args, **kwargs)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# TODO: put e into log
|
||||
print(traceback.format_exc(), file=sys.stderr)
|
||||
return None
|
||||
@@ -65,7 +65,7 @@ class ParallelNodesCommand(BaseCommand):
|
||||
assert self.inventory and type(self.inventory) is dict
|
||||
func = getattr(self, '%s' % op)
|
||||
if len(self.inventory) == 1:
|
||||
node = self.inventory.keys()[0]
|
||||
node = list(self.inventory.keys())[0]
|
||||
func(*args, node=node, nodeinfo=self.inventory[node], **kw)
|
||||
return
|
||||
|
||||
@@ -75,7 +75,7 @@ class ParallelNodesCommand(BaseCommand):
|
||||
for node in self.inventory.keys():
|
||||
try:
|
||||
gevent_pool.add( gevent.spawn(func, *args, node=node, nodeinfo=self.inventory[node], **kw))
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
error = '%s: Internel Error occured in gevent' % node
|
||||
#print(traceback.format_exc(), file=sys.stderr)
|
||||
self.callback.error(error)
|
||||
@@ -89,7 +89,7 @@ class ParallelNodesCommand(BaseCommand):
|
||||
self._pre(op, *args, **kwargs)
|
||||
self._execute_in_parallel(op, *args, **kwargs)
|
||||
self._post(op, *args, **kwargs)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# TODO: put e into log
|
||||
print(traceback.format_exc(), file=sys.stderr)
|
||||
return None
|
||||
|
||||
@@ -63,9 +63,9 @@ def recv_all(sock, size):
|
||||
if left_size < recv_size:
|
||||
tmp_size = left_size
|
||||
buf_part = sock.recv(tmp_size)
|
||||
buf_parts.append(buf_part)
|
||||
buf_parts.append(buf_part.decode('utf-8'))
|
||||
buf_size += len(buf_part)
|
||||
buf = ''.join(buf_parts)
|
||||
buf = ''.join(str(i) for i in buf_parts)
|
||||
return buf
|
||||
|
||||
|
||||
|
||||
+4
-3
@@ -81,7 +81,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand):
|
||||
self.callback.info('%s: No attributes returned from the BMC.' % node)
|
||||
return dump_info
|
||||
|
||||
keys = dump_dict.keys()
|
||||
keys = list(dump_dict.keys())
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
info = '[%d] Generated: %s, Size: %s' % \
|
||||
@@ -140,7 +140,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand):
|
||||
return
|
||||
|
||||
dump_dict = obmc.list_dump_info()
|
||||
keys = dump_dict.keys()
|
||||
keys = list(dump_dict.keys())
|
||||
keys.sort()
|
||||
|
||||
for key in keys:
|
||||
@@ -378,6 +378,7 @@ rmdir \"/tmp/$userid\" \n")
|
||||
self.callback.info("%s: BMC Setting Password..." % node)
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
return
|
||||
|
||||
self.callback.info("%s: BMC password changed. Update 'bmcpasswd' for the node or the 'passwd' table with the new password." % node)
|
||||
|
||||
@@ -422,7 +423,7 @@ rmdir \"/tmp/$userid\" \n")
|
||||
return self.callback.error(e.message, node)
|
||||
|
||||
if isinstance(value, dict):
|
||||
str_value = str(value.values()[0])
|
||||
str_value = str(list(value.values())[0])
|
||||
elif value:
|
||||
str_value = str(value)
|
||||
else:
|
||||
+2
-2
@@ -39,7 +39,7 @@ class OpenBMCEventlogTask(ParallelNodesCommand):
|
||||
# Get all eventlog records
|
||||
eventlog_info_dict = obmc.get_eventlog_info()
|
||||
|
||||
keys = eventlog_info_dict.keys()
|
||||
keys = list(eventlog_info_dict.keys())
|
||||
# Sort thy keys in natural order
|
||||
keys.sort(key=lambda x : int(x[0:]))
|
||||
|
||||
@@ -76,7 +76,7 @@ class OpenBMCEventlogTask(ParallelNodesCommand):
|
||||
# Get all eventlog records
|
||||
eventlog_info_dict = obmc.get_eventlog_info()
|
||||
|
||||
keys = eventlog_info_dict.keys()
|
||||
keys = list(eventlog_info_dict.keys())
|
||||
# Sort the keys in natural order
|
||||
keys.sort(key=lambda x : int(x[0:]))
|
||||
|
||||
+3
-3
@@ -81,7 +81,7 @@ class OpenBMCFlashTask(ParallelNodesCommand):
|
||||
def _get_firmware_version(self, target_file):
|
||||
|
||||
version = purpose = None
|
||||
with open(target_file, 'r') as fh:
|
||||
with open(target_file, encoding="utf8", errors='ignore') as fh:
|
||||
for line in fh:
|
||||
if 'version=' in line:
|
||||
version = line.split('=')[-1].strip()
|
||||
@@ -159,7 +159,7 @@ class OpenBMCFlashTask(ParallelNodesCommand):
|
||||
|
||||
mapping_ids = []
|
||||
if self.firmware:
|
||||
version_list = self.firmware.keys()
|
||||
version_list = list(self.firmware.keys())
|
||||
else:
|
||||
return []
|
||||
|
||||
@@ -348,7 +348,7 @@ class OpenBMCFlashTask(ParallelNodesCommand):
|
||||
|
||||
firmware_version = ''
|
||||
if self.firmware_file:
|
||||
firmware_version = self.firmware.keys()[0]
|
||||
firmware_version = list(self.firmware.keys())[0]
|
||||
try:
|
||||
obmc.upload_firmware(self.firmware_file)
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
+4
-4
@@ -29,7 +29,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand):
|
||||
target_file = utils.get_full_path(self.cwd, target_file)
|
||||
|
||||
version = purpose = None
|
||||
with open(target_file, 'r') as fh:
|
||||
with open(target_file, encoding="utf8", errors='ignore') as fh:
|
||||
for line in fh:
|
||||
if 'version=' in line:
|
||||
version = line.split('=')[-1].strip()
|
||||
@@ -44,13 +44,13 @@ class OpenBMCInventoryTask(ParallelNodesCommand):
|
||||
def _get_firm_info(self, firm_info_list):
|
||||
(has_functional, firm_obj_dict) = firm_info_list
|
||||
firm_info = []
|
||||
keys = firm_obj_dict.keys()
|
||||
keys = list(firm_obj_dict.keys())
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
flag = ''
|
||||
if firm_obj_dict[key].functional:
|
||||
flag = '*'
|
||||
elif firm_obj_dict[key].priority == 0:
|
||||
elif firm_obj_dict[key].priority == 0:
|
||||
if not has_functional:
|
||||
flag = '*'
|
||||
else:
|
||||
@@ -115,7 +115,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand):
|
||||
# Process returned inventory_info_dict depending on the inventory requested
|
||||
if all == 1:
|
||||
# Everything gets displayed, even firmware
|
||||
keys = inventory_info_dict.keys()
|
||||
keys = list(inventory_info_dict.keys())
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
inventory_info += utils.sort_string_with_numbers(inventory_info_dict[key])
|
||||
@@ -450,7 +450,7 @@ class OpenBMCRest(object):
|
||||
payload = { "data": PROJECT_PAYLOAD + BMC_URLS['reboot']['field'] }
|
||||
try:
|
||||
self.request('PUT', BMC_URLS['reboot']['path'], payload=payload, cmd='bmc_reset')
|
||||
except SelfServerException,SelfClientException:
|
||||
except (SelfServerException,SelfClientException) as e:
|
||||
# TODO: Need special handling for bmc reset, as it is normal bmc may return error
|
||||
pass
|
||||
|
||||
@@ -578,7 +578,8 @@ class OpenBMCRest(object):
|
||||
logger.debug('IndexError (-2) for %s' % key)
|
||||
continue
|
||||
|
||||
key_type = filter(lambda x:x not in '0123456789', key_id).upper()
|
||||
key_type_list = [x for x in key_id if x not in '0123456789']
|
||||
key_type = ''.join(key_type_list).upper()
|
||||
|
||||
if key_type == 'CORE':
|
||||
key_type = 'CPU'
|
||||
@@ -656,7 +657,7 @@ class OpenBMCRest(object):
|
||||
# Check if policy table file is there
|
||||
ras_event_mapping = {}
|
||||
if os.path.isfile(RAS_POLICY_TABLE):
|
||||
with open(RAS_POLICY_TABLE, "r") as data_file:
|
||||
with open(RAS_POLICY_TABLE, encoding="utf8", errors='ignore') as data_file:
|
||||
policy_hash = json.load(data_file)
|
||||
if policy_hash:
|
||||
ras_event_mapping = policy_hash['events']
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env python
|
||||
###############################################################################
|
||||
# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
###############################################################################
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from __future__ import print_function
|
||||
import gevent
|
||||
import time
|
||||
|
||||
from common.task import ParallelNodesCommand
|
||||
from common.exceptions import SelfClientException, SelfServerException
|
||||
from hwctl import redfish_client as redfish
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger('xcatagent')
|
||||
|
||||
POWER_STATE_DB = {
|
||||
"on" : "powering-on",
|
||||
"off" : "powering-off",
|
||||
"boot" : "powering-on",
|
||||
}
|
||||
|
||||
class RedfishPowerTask(ParallelNodesCommand):
|
||||
"""Executor for power-related actions."""
|
||||
|
||||
def get_state(self, **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
|
||||
state = 'Unknown'
|
||||
try:
|
||||
rf.login()
|
||||
chassis_state = rf.get_chassis_power_state()
|
||||
if chassis_state == 'On':
|
||||
state = rf.get_systems_power_state().lower()
|
||||
else:
|
||||
state = chassis_state.lower()
|
||||
self.callback.info('%s: %s' % (node, state))
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
|
||||
return state
|
||||
|
||||
def get_bmcstate (self, **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
|
||||
state = 'Unknown'
|
||||
try:
|
||||
rf.login()
|
||||
state = rf.get_bmc_state().lower()
|
||||
self.callback.info('%s: %s' % (node, state))
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
return state
|
||||
|
||||
def set_state(self, state, **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
|
||||
try:
|
||||
rf.login()
|
||||
rf.set_power_state(state)
|
||||
new_status = POWER_STATE_DB.get(state, '')
|
||||
self.callback.info('%s: %s' % (node, state))
|
||||
if new_status:
|
||||
self.callback.update_node_attributes('status', node, new_status)
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
|
||||
def reboot(self, optype='boot', **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
resettype = 'boot'
|
||||
|
||||
try:
|
||||
rf.login()
|
||||
chassis_state = rf.get_chassis_power_state()
|
||||
if chassis_state == 'Off':
|
||||
status = chassis_state
|
||||
else:
|
||||
status = rf.get_systems_power_state()
|
||||
|
||||
if status == 'Off':
|
||||
if optype == 'reset':
|
||||
return self.callback.info('%s: %s' % (node, status.lower()))
|
||||
else:
|
||||
resettype = 'on'
|
||||
|
||||
rf.set_power_state(resettype)
|
||||
new_status = POWER_STATE_DB.get(optype, '')
|
||||
self.callback.info('%s: %s' % (node, optype))
|
||||
if new_status:
|
||||
self.callback.update_node_attributes('status', node, new_status)
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
|
||||
def reboot_bmc(self, optype='warm', **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
|
||||
try:
|
||||
rf.login()
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
return self.callback.error(e.message, node)
|
||||
|
||||
try:
|
||||
rf.reboot_bmc(optype)
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
else:
|
||||
self.callback.info('%s: %s' % (node, 'bmcreboot'))
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python
|
||||
###############################################################################
|
||||
# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
###############################################################################
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from __future__ import print_function
|
||||
import gevent
|
||||
import time
|
||||
|
||||
from common.task import ParallelNodesCommand
|
||||
from common.exceptions import SelfClientException, SelfServerException
|
||||
from hwctl import redfish_client as redfish
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger('xcatagent')
|
||||
|
||||
class RedfishBootTask(ParallelNodesCommand):
|
||||
"""Executor for setboot-related actions."""
|
||||
|
||||
def get_state(self, **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
|
||||
state = 'Unknown'
|
||||
try:
|
||||
rf.login()
|
||||
state = rf.get_boot_state()
|
||||
self.callback.info('%s: %s' % (node, state))
|
||||
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
|
||||
return state
|
||||
|
||||
def set_state(self, setboot_state, persistant, **kw):
|
||||
|
||||
node = kw['node']
|
||||
rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
|
||||
debugmode=self.debugmode, verbose=self.verbose)
|
||||
|
||||
try:
|
||||
rf.login()
|
||||
rf.set_boot_state(persistant, setboot_state)
|
||||
state = rf.get_boot_state()
|
||||
self.callback.info('%s: %s' % (node, state))
|
||||
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
self.callback.error(e.message, node)
|
||||
@@ -0,0 +1,302 @@
|
||||
#!/usr/bin/env python
|
||||
###############################################################################
|
||||
# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
###############################################################################
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
|
||||
from common import utils, rest
|
||||
from common.exceptions import SelfClientException, SelfServerException
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger('xcatagent')
|
||||
|
||||
HTTP_PROTOCOL = "https://"
|
||||
PROJECT_URL = "/redfish/v1"
|
||||
|
||||
CHASSIS_URL = PROJECT_URL + "/Chassis"
|
||||
MANAGER_URL = PROJECT_URL + "/Managers"
|
||||
SYSTEMS_URL = PROJECT_URL + "/Systems"
|
||||
SESSION_URL = PROJECT_URL + "/SessionService/Sessions"
|
||||
|
||||
BMC_RESET_TYPE = "ForceRestart"
|
||||
|
||||
POWER_RESET_TYPE = {
|
||||
'boot' : 'ForceRestart',
|
||||
'off' : 'ForceOff',
|
||||
'on' : 'ForceOn',
|
||||
}
|
||||
|
||||
BOOTSOURCE_SET_STATE = {
|
||||
"cd" : "Cd",
|
||||
"def" : "None",
|
||||
"default": "None",
|
||||
"floppy" : "Floppy",
|
||||
"hd" : "Hdd",
|
||||
"net" : "Pxe",
|
||||
"setup" : "BiosSetup",
|
||||
}
|
||||
|
||||
BOOTSOURCE_GET_STATE = {
|
||||
"BiosSetup": "BIOS Setup",
|
||||
"Floppy" : "Floppy",
|
||||
"Cd" : "CD/DVD",
|
||||
"Hdd" : "Hard Drive",
|
||||
"None" : "boot override inactive",
|
||||
"Pxe" : "Network",
|
||||
}
|
||||
|
||||
manager_reset_string = '#Manager.Reset'
|
||||
system_reset_string = '#ComputerSystem.Reset'
|
||||
reset_type_string = 'ResetType@Redfish.AllowableValues'
|
||||
reset_action_string = '@Redfish.ActionInfo'
|
||||
|
||||
class RedfishRest(object):
|
||||
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
|
||||
def __init__(self, name, **kwargs):
|
||||
|
||||
self.name = name
|
||||
self.username = None
|
||||
self.password = None
|
||||
|
||||
if 'nodeinfo' in kwargs:
|
||||
for key, value in kwargs['nodeinfo'].items():
|
||||
setattr(self, key, value)
|
||||
if not hasattr(self, 'bmcip'):
|
||||
self.bmcip = self.name
|
||||
|
||||
self.verbose = kwargs.get('debugmode')
|
||||
self.messager = kwargs.get('messager')
|
||||
|
||||
self.session = rest.RestSession()
|
||||
self.root_url = HTTP_PROTOCOL + self.bmcip
|
||||
|
||||
def _print_record_log (self, msg, cmd, error_flag=False):
|
||||
|
||||
if self.verbose or error_flag:
|
||||
localtime = time.asctime( time.localtime(time.time()) )
|
||||
log = self.name + ': [redfish_debug] ' + cmd + ' ' + msg
|
||||
if self.verbose:
|
||||
self.messager.info(localtime + ' ' + log)
|
||||
logger.debug(log)
|
||||
|
||||
def _print_error_log (self, msg, cmd):
|
||||
|
||||
self._print_record_log(msg, cmd, True)
|
||||
|
||||
def _log_request (self, method, url, headers, data=None, files=None, file_path=None, cmd=''):
|
||||
|
||||
header_str = ' '.join([ "%s: %s" % (k, v) for k,v in headers.items() ])
|
||||
msg = 'curl -k -X %s -H \"%s\" ' % (method, header_str)
|
||||
|
||||
if cmd != 'login':
|
||||
msg += '-H \"X-Auth-Token: xxxxxx\" '
|
||||
|
||||
if data:
|
||||
if cmd == 'login':
|
||||
data = data.replace('"Password": "%s"' % self.password, '"Password": "xxxxxx"')
|
||||
data = '-d \'%s\'' % data
|
||||
msg += '%s %s -v' % (url, data)
|
||||
else:
|
||||
msg += url
|
||||
|
||||
self._print_record_log(msg, cmd)
|
||||
return msg
|
||||
|
||||
def request (self, method, resource, headers=None, payload=None, timeout=30, cmd=''):
|
||||
|
||||
httpheaders = headers or RedfishRest.headers
|
||||
url = resource
|
||||
if not url.startswith(HTTP_PROTOCOL):
|
||||
url = self.root_url + resource
|
||||
|
||||
data = None
|
||||
if payload:
|
||||
data=json.dumps(payload)
|
||||
|
||||
self._log_request(method, url, httpheaders, data=data, cmd=cmd)
|
||||
|
||||
try:
|
||||
response = self.session.request(method, url, headers=httpheaders, data=data, timeout=timeout)
|
||||
return self.handle_response(response, cmd=cmd)
|
||||
except SelfServerException as e:
|
||||
if cmd == 'login':
|
||||
e.message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg)
|
||||
else:
|
||||
e.message = 'BMC did not respond. ' \
|
||||
'Validate BMC configuration and retry the command.'
|
||||
self._print_error_log(e.message, cmd)
|
||||
raise
|
||||
except ValueError:
|
||||
error = 'Received wrong format response: %s' % response
|
||||
self._print_error_log(error, cmd)
|
||||
raise SelfServerException(error)
|
||||
|
||||
def handle_response (self, resp, cmd=''):
|
||||
|
||||
data = resp.json()
|
||||
code = resp.status_code
|
||||
|
||||
if code != requests.codes.ok and code != requests.codes.created:
|
||||
|
||||
description = ''.join(data['error']['@Message.ExtendedInfo'][0]['Message'])
|
||||
error = '[%d] %s' % (code, description)
|
||||
self._print_error_log(error, cmd)
|
||||
raise SelfClientException(error, code)
|
||||
|
||||
if cmd == 'login' and not 'X-Auth-Token' in resp.headers:
|
||||
raise SelfServerException('Login Failed: Did not get Session Token from response')
|
||||
|
||||
if 'Name' in data:
|
||||
self._print_record_log('%s %s' % (code, data['Name']), cmd)
|
||||
elif 'error' in data:
|
||||
self._print_record_log('%s %s' % (code, data['error']['message']), cmd)
|
||||
return data
|
||||
|
||||
def login(self):
|
||||
|
||||
payload = { "UserName": self.username, "Password": self.password }
|
||||
self.request('POST', SESSION_URL, payload=payload, timeout=20, cmd='login')
|
||||
|
||||
def _get_members(self, url):
|
||||
|
||||
data = self.request('GET', url, cmd='get_members')
|
||||
try:
|
||||
return data['Members']
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
def get_bmc_state(self):
|
||||
|
||||
members = self._get_members(MANAGER_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_bmc_state')
|
||||
try:
|
||||
return data['PowerState']
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
def get_chassis_power_state(self):
|
||||
|
||||
members = self._get_members(CHASSIS_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_chassis_power_state')
|
||||
try:
|
||||
return data['PowerState']
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
def get_systems_power_state(self):
|
||||
|
||||
members = self._get_members(SYSTEMS_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_systems_power_state')
|
||||
try:
|
||||
return data['PowerState']
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
def _get_bmc_actions(self):
|
||||
|
||||
members = self._get_members(MANAGER_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_bmc_actions')
|
||||
|
||||
try:
|
||||
actions_dict = data['Actions'][manager_reset_string]
|
||||
target_url = actions_dict['target']
|
||||
if reset_action_string in actions_dict:
|
||||
action_info = self.request('GET', actions_dict[reset_action_string], cmd='get_bmc_actions')
|
||||
actions = action_info['Parameters'][0]['AllowableValues']
|
||||
else:
|
||||
actions = actions_dict[reset_type_string]
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
return (target_url, actions)
|
||||
|
||||
def reboot_bmc(self, optype='warm'):
|
||||
|
||||
target_url, actions = self._get_bmc_actions()
|
||||
if BMC_RESET_TYPE not in actions:
|
||||
raise SelfClientException('Unsupported option: %s' % BMC_RESET_TYPE, 403)
|
||||
|
||||
data = { "ResetType": BMC_RESET_TYPE }
|
||||
return self.request('POST', target_url, payload=data, cmd='set_bmc_state')
|
||||
|
||||
def _get_power_actions(self):
|
||||
|
||||
members = self._get_members(SYSTEMS_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_power_actions')
|
||||
|
||||
try:
|
||||
actions_dict = data['Actions'][system_reset_string]
|
||||
target_url = actions_dict['target']
|
||||
if reset_action_string in actions_dict:
|
||||
action_info = self.request('GET', actions_dict[reset_action_string], cmd='get_power_actions')
|
||||
actions = action_info['Parameters'][0]['AllowableValues']
|
||||
else:
|
||||
actions = actions_dict[reset_type_string]
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
return (target_url, actions)
|
||||
|
||||
def set_power_state(self, state):
|
||||
|
||||
target_url, actions = self._get_power_actions()
|
||||
if POWER_RESET_TYPE[state] not in actions:
|
||||
raise SelfClientException('Unsupported option: %s' % state, 403)
|
||||
|
||||
data = { "ResetType": POWER_RESET_TYPE[state] }
|
||||
return self.request('POST', target_url, payload=data, cmd='set_power_state')
|
||||
|
||||
def get_boot_state(self):
|
||||
|
||||
members = self._get_members(SYSTEMS_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_boot_state')
|
||||
try:
|
||||
boot_enable = data['Boot']['BootSourceOverrideEnabled']
|
||||
if boot_enable == 'Disabled':
|
||||
return 'boot override inactive'
|
||||
bootsource = data['Boot']['BootSourceOverrideTarget']
|
||||
return BOOTSOURCE_GET_STATE.get(bootsource, bootsource)
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
def _get_boot_actions(self):
|
||||
|
||||
members = self._get_members(SYSTEMS_URL)
|
||||
target_url = members[0]['@odata.id']
|
||||
data = self.request('GET', target_url, cmd='get_boot_actions')
|
||||
try:
|
||||
actions = data['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues']
|
||||
except KeyError as e:
|
||||
raise SelfServerException('Get KeyError %s' % e.args)
|
||||
|
||||
return (target_url, actions)
|
||||
|
||||
def set_boot_state(self, persistant, state):
|
||||
|
||||
target_url, actions = self._get_boot_actions()
|
||||
target_data = BOOTSOURCE_SET_STATE[state]
|
||||
if target_data not in actions:
|
||||
raise SelfClientException('Unsupported option: %s' % state, 403)
|
||||
|
||||
boot_enable = 'Once'
|
||||
if persistant:
|
||||
boot_enable = 'Continuous'
|
||||
if target_data == 'None':
|
||||
boot_enable = 'Disabled'
|
||||
data = {'Boot': {'BootSourceOverrideEnabled': boot_enable, "BootSourceOverrideTarget": target_data} }
|
||||
return self.request('PATCH', target_url, payload=data, cmd='set_boot_state')
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo",
|
||||
"@odata.type": "#ActionInfo.v1_1_0.ActionInfo",
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/ResetActionInfo",
|
||||
"Id": "ResetActionInfo",
|
||||
"Name": "Reset Action Info",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "ResetType",
|
||||
"Required": true,
|
||||
"DataType": "String",
|
||||
"AllowableValues": [
|
||||
"ForceRestart",
|
||||
"GracefulRestart"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Oem": {}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#Chassis.Chassis",
|
||||
"@odata.type": "#Chassis.v1_8_0.Chassis",
|
||||
"@odata.id": "/redfish/v1/Chassis/Chassis0",
|
||||
"Id": "Chassis0",
|
||||
"Name": "OpenPOWER System Chassis",
|
||||
"ChassisType": "RackMount",
|
||||
"Manufacturer": "IBM",
|
||||
"Model": "SYSTEM",
|
||||
"SerialNumber": "C829UAE15A10564",
|
||||
"PartNumber": "9006-22P",
|
||||
"AssetTag": "",
|
||||
"PowerState": "On",
|
||||
"IndicatorLED": "Off",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK"
|
||||
},
|
||||
"PhysicalSecurity": {
|
||||
"IntrusionSensorNumber": 226,
|
||||
"IntrusionSensor": "HardwareIntrusion",
|
||||
"IntrusionSensorReArm": "Manual"
|
||||
},
|
||||
"Thermal": {
|
||||
"@odata.id": "/redfish/v1/Chassis/Chassis0/Thermal"
|
||||
},
|
||||
"Power": {
|
||||
"@odata.id": "/redfish/v1/Chassis/Chassis0/Power"
|
||||
},
|
||||
"Assembly": {
|
||||
"@odata.id": "/redfish/v1/Chassis/Chassis0/Assembly"
|
||||
},
|
||||
"Links": {
|
||||
"ComputerSystems": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Systems/Computer"
|
||||
}
|
||||
],
|
||||
"ManagedBy": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Managers/BMC"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"error": {
|
||||
"code": "Base.1.4.0.GeneralError",
|
||||
"message": "A general error has occurred. See Resolution for information on how to resolve the error.",
|
||||
"@Message.ExtendedInfo": [
|
||||
{
|
||||
"MessageId": "Base.1.4.0.ResourceAtUriUnauthorized",
|
||||
"Severity": "Critical",
|
||||
"Resolution": "Ensure that the appropriate access is provided for the service in order for it to access the URI.",
|
||||
"Message": "While accessing the resource at /redfish/v1/SessionService/Sessions, the service received an authorization error unauthorized.",
|
||||
"MessageArgs": [
|
||||
"/redfish/v1/SessionService/Sessions",
|
||||
"unauthorized"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"@odata.type": "#Session.v1_1_1.Session",
|
||||
"UserName": "ADMIN",
|
||||
"Description": "Manager User Session",
|
||||
"@odata.id": "/redfish/v1/SessionService/Sessions/a6cbc1e29e9cd559",
|
||||
"@odata.context": "/redfish/v1/$metadata#Session.Session",
|
||||
"Oem": {},
|
||||
"Id": "a6cbc1e29e9cd559",
|
||||
"Name": "User Session"
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#Manager.Manager",
|
||||
"@odata.type": "#Manager.v1_5_0.Manager",
|
||||
"@odata.id": "/redfish/v1/Managers/BMC",
|
||||
"Id": "BMC",
|
||||
"Description": "Aspeed BMC",
|
||||
"Name": "Manager",
|
||||
"ManagerType": "BMC",
|
||||
"UUID": "00000000-0000-0000-0000-000000000",
|
||||
"Model": "P9DSU 9006-22P",
|
||||
"DateTime": "2019-01-22T06:22:55+00:00",
|
||||
"DateTimeLocalOffset": "+00:00",
|
||||
"FirmwareVersion": "2.04",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK"
|
||||
},
|
||||
"PowerState": "On",
|
||||
"SerialConsole": {
|
||||
"ServiceEnabled": true,
|
||||
"MaxConcurrentSessions": 1,
|
||||
"ConnectTypesSupported": [
|
||||
"IPMI"
|
||||
]
|
||||
},
|
||||
"CommandShell": {
|
||||
"ServiceEnabled": true,
|
||||
"MaxConcurrentSessions": 0,
|
||||
"ConnectTypesSupported": [
|
||||
"SSH"
|
||||
]
|
||||
},
|
||||
"GraphicalConsole": {
|
||||
"ServiceEnabled": true,
|
||||
"MaxConcurrentSessions": 4,
|
||||
"ConnectTypesSupported": [
|
||||
"KVMIP"
|
||||
]
|
||||
},
|
||||
"EthernetInterfaces": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/EthernetInterfaces"
|
||||
},
|
||||
"SerialInterfaces": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/SerialInterfaces"
|
||||
},
|
||||
"NetworkProtocol": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/NetworkProtocol"
|
||||
},
|
||||
"LogServices": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/LogServices"
|
||||
},
|
||||
"VirtualMedia": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/VirtualMedia"
|
||||
},
|
||||
"Links": {
|
||||
"ManagerForServers": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Systems/Computer"
|
||||
}
|
||||
],
|
||||
"ManagerForChassis": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Chassis/Chassis0"
|
||||
}
|
||||
],
|
||||
"ManagerInChassis": {
|
||||
"@odata.id": "/redfish/v1/Chassis/Chassis0"
|
||||
}
|
||||
},
|
||||
"Actions": {
|
||||
"#Manager.Reset": {
|
||||
"target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset",
|
||||
"@Redfish.ActionInfo": "/redfish/v1/Managers/BMC/ResetActionInfo"
|
||||
}
|
||||
},
|
||||
"Oem": {
|
||||
"Supermicro": {
|
||||
"@odata.type": "#SMCManager.v1_0_1.SMCManager",
|
||||
"FanMode": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/FanMode"
|
||||
},
|
||||
"MouseMode": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/MouseMode"
|
||||
},
|
||||
"SMTP": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/SMTP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#Manager.Manager",
|
||||
"@odata.type": "#Manager.v1_5_0.Manager",
|
||||
"@odata.id": "/redfish/v1/Managers/BMC",
|
||||
"Id": "BMC",
|
||||
"Description": "Aspeed BMC",
|
||||
"Name": "Manager",
|
||||
"ManagerType": "BMC",
|
||||
"UUID": "006126AB-B608-E911-8000-0CC47AD55B4E",
|
||||
"Model": "P9DSU 9006-22P",
|
||||
"DateTime": "2019-01-22T06:22:55+00:00",
|
||||
"DateTimeLocalOffset": "+00:00",
|
||||
"FirmwareVersion": "2.04",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK"
|
||||
},
|
||||
"PowerState": "On",
|
||||
"SerialConsole": {
|
||||
"ServiceEnabled": true,
|
||||
"MaxConcurrentSessions": 1,
|
||||
"ConnectTypesSupported": [
|
||||
"IPMI"
|
||||
]
|
||||
},
|
||||
"CommandShell": {
|
||||
"ServiceEnabled": true,
|
||||
"MaxConcurrentSessions": 0,
|
||||
"ConnectTypesSupported": [
|
||||
"SSH"
|
||||
]
|
||||
},
|
||||
"GraphicalConsole": {
|
||||
"ServiceEnabled": true,
|
||||
"MaxConcurrentSessions": 4,
|
||||
"ConnectTypesSupported": [
|
||||
"KVMIP"
|
||||
]
|
||||
},
|
||||
"EthernetInterfaces": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/EthernetInterfaces"
|
||||
},
|
||||
"SerialInterfaces": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/SerialInterfaces"
|
||||
},
|
||||
"NetworkProtocol": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/NetworkProtocol"
|
||||
},
|
||||
"LogServices": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/LogServices"
|
||||
},
|
||||
"VirtualMedia": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/VirtualMedia"
|
||||
},
|
||||
"Links": {
|
||||
"ManagerForServers": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Systems/Computer"
|
||||
}
|
||||
],
|
||||
"ManagerForChassis": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Chassis/Planar"
|
||||
}
|
||||
],
|
||||
"ManagerInChassis": {
|
||||
"@odata.id": "/redfish/v1/Chassis/Planar"
|
||||
}
|
||||
},
|
||||
"Actions": {
|
||||
"#Manager.Reset": {
|
||||
"target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset",
|
||||
"ResetType@Redfish.AllowableValues": [
|
||||
"ForceRestart",
|
||||
"GracefulRestart"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Oem": {
|
||||
"Supermicro": {
|
||||
"@odata.type": "#SMCManager.v1_0_1.SMCManager",
|
||||
"FanMode": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/FanMode"
|
||||
},
|
||||
"MouseMode": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/MouseMode"
|
||||
},
|
||||
"SMTP": {
|
||||
"@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/SMTP"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",
|
||||
"@odata.type": "#ServiceRoot.v1_4_0.ServiceRoot",
|
||||
"@odata.id": "/redfish/v1",
|
||||
"Id": "v1",
|
||||
"Name": "Root Service",
|
||||
"RedfishVersion": "1.6.0",
|
||||
"UUID": "00000000-0000-0000-0000-0CC47AD55B4E",
|
||||
"SessionService": {
|
||||
"@odata.id": "/redfish/v1/SessionService"
|
||||
},
|
||||
"AccountService": {
|
||||
"@odata.id": "/redfish/v1/AccountService"
|
||||
},
|
||||
"Registries": {
|
||||
"@odata.id": "/redfish/v1/Registries"
|
||||
},
|
||||
"JsonSchemas": {
|
||||
"@odata.id": "/redfish/v1/JsonSchemas"
|
||||
},
|
||||
"Chassis": {
|
||||
"@odata.id": "/redfish/v1/Chassis"
|
||||
},
|
||||
"Managers": {
|
||||
"@odata.id": "/redfish/v1/Managers"
|
||||
},
|
||||
"Systems": {
|
||||
"@odata.id": "/redfish/v1/Systems"
|
||||
},
|
||||
"UpdateService": {
|
||||
"@odata.id": "/redfish/v1/UpdateService"
|
||||
},
|
||||
"EventService": {
|
||||
"@odata.id": "/redfish/v1/EventService"
|
||||
},
|
||||
"Links": {
|
||||
"Sessions": {
|
||||
"@odata.id": "/redfish/v1/SessionService/Sessions"
|
||||
}
|
||||
},
|
||||
"Oem": {}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo",
|
||||
"@odata.type": "#ActionInfo.v1_1_0.ActionInfo",
|
||||
"@odata.id": "/redfish/v1/Systems/Computer/ResetActionInfo",
|
||||
"Id": "ResetActionInfo",
|
||||
"Name": "Reset Action Info",
|
||||
"Parameters": [
|
||||
{
|
||||
"Name": "ResetType",
|
||||
"Required": true,
|
||||
"DataType": "String",
|
||||
"AllowableValues": [
|
||||
"On",
|
||||
"ForceOff",
|
||||
"GracefulShutdown",
|
||||
"GracefulRestart",
|
||||
"ForceRestart",
|
||||
"ForceOn"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Oem": {}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
|
||||
"@odata.type": "#ComputerSystem.v1_5_0.ComputerSystem",
|
||||
"@odata.id": "/redfish/v1/Systems/Computer",
|
||||
"Id": "Computer",
|
||||
"Name": "OpenPOWER Computer System",
|
||||
"Description": "OpenPOWER Computer System",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "Critical"
|
||||
},
|
||||
"SerialNumber": "C829UAE15A10564",
|
||||
"PartNumber": "9006-22P",
|
||||
"Manufacturer": "IBM",
|
||||
"Model": "SYSTEM",
|
||||
"SystemType": "Physical",
|
||||
"BiosVersion": "2.04 20190118",
|
||||
"UUID": "00000000-0000-0000-0000-0000000000",
|
||||
"ProcessorSummary": {
|
||||
"Count": 2,
|
||||
"Model": "POWER CPU",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK"
|
||||
}
|
||||
},
|
||||
"IndicatorLED": "Off",
|
||||
"PowerState": "On",
|
||||
"Boot": {
|
||||
"BootSourceOverrideMode": "Legacy",
|
||||
"BootSourceOverrideEnabled": "Once",
|
||||
"BootSourceOverrideTarget": "None",
|
||||
"BootSourceOverrideTarget@Redfish.AllowableValues": [
|
||||
"None",
|
||||
"Pxe",
|
||||
"Hdd",
|
||||
"Diags",
|
||||
"Cd",
|
||||
"BiosSetup",
|
||||
"Usb",
|
||||
"Floppy"
|
||||
]
|
||||
},
|
||||
"HostWatchdogTimer": {
|
||||
"FunctionEnabled": true,
|
||||
"WarningAction": "None",
|
||||
"WarningAction@Redfish.AllowableValues": [
|
||||
"None"
|
||||
],
|
||||
"TimeoutAction": "None",
|
||||
"TimeoutAction@Redfish.AllowableValues": [
|
||||
"None",
|
||||
"ResetSystem",
|
||||
"PowerDown",
|
||||
"PowerCycle"
|
||||
],
|
||||
"Status": {
|
||||
"State": "StandbyOffline"
|
||||
}
|
||||
},
|
||||
"Links": {
|
||||
"Chassis": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Chassis/chassis0"
|
||||
}
|
||||
],
|
||||
"ManagedBy": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Managers/BMC"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Actions": {
|
||||
"#ComputerSystem.Reset": {
|
||||
"target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset",
|
||||
"@Redfish.ActionInfo": "/redfish/v1/Systems/Computer/ResetActionInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
|
||||
"@odata.type": "#ComputerSystem.v1_5_0.ComputerSystem",
|
||||
"@odata.id": "/redfish/v1/Systems/Computer",
|
||||
"Id": "Computer",
|
||||
"Name": "OpenPOWER Computer System",
|
||||
"Description": "OpenPOWER Computer System",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "Critical"
|
||||
},
|
||||
"SerialNumber": "C829UAE15A10564",
|
||||
"PartNumber": "9006-22P",
|
||||
"Manufacturer": "IBM",
|
||||
"Model": "SYSTEM",
|
||||
"SystemType": "Physical",
|
||||
"BiosVersion": "2.04 20190118",
|
||||
"UUID": "00000000-0000-0000-0000-0000000000",
|
||||
"ProcessorSummary": {
|
||||
"Count": 2,
|
||||
"Model": "POWER CPU",
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK"
|
||||
}
|
||||
},
|
||||
"IndicatorLED": "Off",
|
||||
"PowerState": "On",
|
||||
"Boot": {
|
||||
"BootSourceOverrideMode": "Legacy",
|
||||
"BootSourceOverrideEnabled": "Once",
|
||||
"BootSourceOverrideTarget": "None",
|
||||
"BootSourceOverrideTarget@Redfish.AllowableValues": [
|
||||
"None",
|
||||
"Pxe",
|
||||
"Hdd",
|
||||
"Diags",
|
||||
"Cd",
|
||||
"BiosSetup",
|
||||
"Usb",
|
||||
"Floppy"
|
||||
]
|
||||
},
|
||||
"HostWatchdogTimer": {
|
||||
"FunctionEnabled": true,
|
||||
"WarningAction": "None",
|
||||
"WarningAction@Redfish.AllowableValues": [
|
||||
"None"
|
||||
],
|
||||
"TimeoutAction": "None",
|
||||
"TimeoutAction@Redfish.AllowableValues": [
|
||||
"None",
|
||||
"ResetSystem",
|
||||
"PowerDown",
|
||||
"PowerCycle"
|
||||
],
|
||||
"Status": {
|
||||
"State": "StandbyOffline"
|
||||
}
|
||||
},
|
||||
"Links": {
|
||||
"Chassis": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Chassis/chassis0"
|
||||
}
|
||||
],
|
||||
"ManagedBy": [
|
||||
{
|
||||
"@odata.id": "/redfish/v1/Managers/BMC"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Actions": {
|
||||
"#ComputerSystem.Reset": {
|
||||
"target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset",
|
||||
"ResetType@Redfish.AllowableValues": [
|
||||
"On",
|
||||
"ForceOff",
|
||||
"GracefulShutdown",
|
||||
"GracefulRestart",
|
||||
"ForceRestart",
|
||||
"ForceOn"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"error":
|
||||
{
|
||||
"message": "Successfully Completed Request",
|
||||
"code": "Base.1.4.0.Success"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,375 @@
|
||||
#!/usr/bin/env python
|
||||
###############################################################################
|
||||
# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
###############################################################################
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
import pytest
|
||||
import mock
|
||||
import json
|
||||
import os
|
||||
import logging
|
||||
import time
|
||||
import requests
|
||||
|
||||
from hwctl import redfish_client as rf
|
||||
from common.utils import Messager
|
||||
from common.exceptions import SelfClientException, SelfServerException
|
||||
|
||||
DATA_DIR = os.path.dirname(os.path.realpath(__file__)) + '/../json_data'
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
REDFISH_URL = '/redfish/v1'
|
||||
|
||||
class TestRedfishClient(object):
|
||||
|
||||
nodeinfo_dict = {'bmc': 'testbmc', 'bmcip': '10.0.0.1', 'username': 'username', 'password': 'password'}
|
||||
log = logging.getLogger('TestRedfishClient')
|
||||
rf_rest = rf.RedfishRest(name='testnode', nodeinfo=nodeinfo_dict, messager=Messager(),
|
||||
debugmode=True, verbose=False)
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
with open("%s/redfish_v1_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rf_v1 = json.load(load_f)
|
||||
chassis_url = rf_v1['Chassis']['@odata.id']
|
||||
manager_url = rf_v1['Managers']['@odata.id']
|
||||
systems_url = rf_v1['Systems']['@odata.id']
|
||||
session_url = rf_v1['Links']['Sessions']['@odata.id']
|
||||
|
||||
def test__init__(self):
|
||||
assert self.rf_rest.name == 'testnode'
|
||||
assert self.rf_rest.bmc == 'testbmc'
|
||||
assert self.rf_rest.bmcip == '10.0.0.1'
|
||||
assert self.rf_rest.username == 'username'
|
||||
assert self.rf_rest.password == 'password'
|
||||
assert isinstance(self.rf_rest.messager, Messager)
|
||||
assert self.rf_rest.verbose == True
|
||||
assert self.rf_rest.root_url == 'https://10.0.0.1'
|
||||
|
||||
def test__print_record_log(self):
|
||||
self.rf_rest._print_record_log("test__print_record_log", "test")
|
||||
assert self.rf_rest.messager.info
|
||||
assert time.asctime
|
||||
|
||||
def test__print_error_log(self):
|
||||
self.rf_rest._print_record_log("test__print_error_log", "test")
|
||||
assert self.rf_rest._print_record_log
|
||||
|
||||
def test__log_request(self):
|
||||
self.rf_rest._print_record_log = mock.Mock(return_value=True)
|
||||
login_data = json.dumps({ "UserName": self.rf_rest.username, "Password": self.rf_rest.password })
|
||||
msg_data = login_data.replace('"Password": "%s"' % self.rf_rest.password, '"Password": "xxxxxx"')
|
||||
test_data = json.dumps({ "Test": True })
|
||||
login_msg = 'curl -k -X POST -H "Content-Type: application/json" https://10.0.0.1%s -d \'%s\' -v' % (self.session_url, msg_data)
|
||||
test_data_msg = 'curl -k -X POST -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxx" https://10.0.0.1/redfish/v1/Managers -d \'%s\' -v' % test_data
|
||||
get_msg = 'curl -k -X GET -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxx" https://10.0.0.1/redfish/v1/Managers'
|
||||
assert self.rf_rest._log_request('POST', self.rf_rest.root_url + self.session_url, self.headers, data=login_data, cmd='login') == login_msg
|
||||
assert self.rf_rest._log_request('POST', self.rf_rest.root_url + self.manager_url, self.headers, data=test_data, cmd='test__log_request') == test_data_msg
|
||||
assert self.rf_rest._log_request('GET', self.rf_rest.root_url + self.manager_url, self.headers, cmd='test__log_request') == get_msg
|
||||
|
||||
def test_handle_response_not_ok(self):
|
||||
test_rsp = requests.Response()
|
||||
test_rsp.status_code = 401
|
||||
with open("%s/login_no_auth_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
test_rsp._content = json.dumps(json.load(load_f))
|
||||
with pytest.raises(SelfClientException) as excinfo:
|
||||
data = self.rf_rest.handle_response(test_rsp, cmd='test_handle_response_not_ok')
|
||||
assert excinfo.type == SelfClientException
|
||||
assert 'the service received an authorization error unauthorized' in str(excinfo.value)
|
||||
|
||||
def test_handle_response_no_auth(self):
|
||||
test_rsp = requests.Response()
|
||||
test_rsp.status_code = 201
|
||||
test_rsp.headers = {}
|
||||
with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
test_rsp._content = json.dumps(json.load(load_f))
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
data = self.rf_rest.handle_response(test_rsp, cmd='login')
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Login Failed: Did not get Session Token from response' in str(excinfo.value)
|
||||
|
||||
def test_handle_response_name(self):
|
||||
test_rsp = requests.Response()
|
||||
test_rsp.status_code = 200
|
||||
test_rsp.headers = {'X-Auth-Token': 'abcdefghijklmn'}
|
||||
with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
file_data = json.load(load_f)
|
||||
test_rsp._content = json.dumps(file_data)
|
||||
data = self.rf_rest.handle_response(test_rsp, cmd='get_information')
|
||||
assert data == file_data
|
||||
|
||||
def test_handle_response_error(self):
|
||||
test_rsp = requests.Response()
|
||||
test_rsp.status_code = 200
|
||||
test_rsp.headers = {'X-Auth-Token': 'abcdefghijklmn'}
|
||||
with open("%s/with_error_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
file_data = json.load(load_f)
|
||||
test_rsp._content = json.dumps(file_data)
|
||||
data = self.rf_rest.handle_response(test_rsp, cmd='get_information')
|
||||
assert data == file_data
|
||||
|
||||
def test_request_login_connect_failed(self):
|
||||
login_data = { "UserName": self.rf_rest.username, "Password": self.rf_rest.password }
|
||||
self.rf_rest.session.request = mock.Mock(side_effect=SelfServerException('Login to BMC failed: Can\'t connect to'))
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.request('POST', self.session_url, headers=self.headers, payload=login_data, cmd='login')
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Login to BMC failed: Can\'t connect to' in str(excinfo.value)
|
||||
|
||||
def test_request_connect_failed(self):
|
||||
self.rf_rest.session.request = mock.Mock(side_effect=SelfServerException('BMC did not respond. Validate BMC configuration and retry the command.'))
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.request('GET', self.manager_url, headers=self.headers)
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'BMC did not respond. Validate BMC configuration and retry the command.' in str(excinfo.value)
|
||||
|
||||
def test_request_value_error(self):
|
||||
self.rf_rest.session.request = mock.Mock(return_value='Mock return value for value error')
|
||||
self.rf_rest.handle_response = mock.Mock(side_effect=ValueError())
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.request('GET', self.manager_url, headers=self.headers)
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Received wrong format response:' in str(excinfo.value)
|
||||
|
||||
def test_request_login_success(self):
|
||||
login_data = json.dumps({ "UserName": self.rf_rest.username, "Password": self.rf_rest.password })
|
||||
with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
response = json.load(load_f)
|
||||
self.rf_rest.session.request = mock.Mock(return_value=None)
|
||||
self.rf_rest.handle_response = mock.Mock(return_value=response)
|
||||
data = self.rf_rest.request('POST', self.session_url, headers=self.headers, payload=login_data, cmd='login')
|
||||
assert self.rf_rest.session.request
|
||||
assert data == response
|
||||
|
||||
def test_login_success(self):
|
||||
with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
login_rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=login_rsp)
|
||||
assert self.rf_rest.login() == None
|
||||
|
||||
def test_login_not_respond(self):
|
||||
self.rf_rest.request = mock.Mock(side_effect=SelfServerException('BMC did not respond. Validate BMC configuration and retry the command.'))
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.login()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'BMC did not respond. Validate BMC configuration and retry the command.' in str(excinfo.value)
|
||||
|
||||
def test_login_value_error(self):
|
||||
self.rf_rest.request = mock.Mock(side_effect=SelfServerException('Received wrong format response: xxxxxx'))
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.login()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Received wrong format response:' in str(excinfo.value)
|
||||
|
||||
def test__get_members(self):
|
||||
resp_data = {"Members": [ {"@odata.id": self.manager_url + "/BMC"} ] }
|
||||
self.rf_rest.request = mock.Mock(return_value=resp_data)
|
||||
members = self.rf_rest._get_members(self.manager_url)
|
||||
assert members == [ {"@odata.id": self.manager_url + "/BMC"} ]
|
||||
|
||||
def test__get_members_keyerror(self):
|
||||
self.rf_rest.request = mock.Mock(return_value={"key": "value"})
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
members = self.rf_rest._get_members(self.manager_url)
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test_get_bmc_state(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + "/BMC"} ])
|
||||
with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest.get_bmc_state() == "On"
|
||||
|
||||
def test_get_bmc_state_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + "/BMC"} ])
|
||||
self.rf_rest.request = mock.Mock(return_value={"powerState": "Off"})
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
resp_data = self.rf_rest.get_bmc_state()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test_get_chassis_power_state(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.chassis_url + '/MotherBoard'} ])
|
||||
with open("%s/chassis_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest.get_chassis_power_state() == 'On'
|
||||
|
||||
def test_get_chassis_power_state_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.chassis_url + '/MotherBoard'} ])
|
||||
self.rf_rest.request = mock.Mock(return_value={"Powerstate": "On"})
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
resp_data = self.rf_rest.get_chassis_power_state()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test_get_systems_power_state(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest.get_systems_power_state() == 'On'
|
||||
|
||||
def test_get_systems_power_state_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
self.rf_rest.request = mock.Mock(return_value={"powerstate": "On"})
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.get_systems_power_state()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test__get_bmc_actions(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ])
|
||||
with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
with open("%s/bmc_action_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
actioninfo = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(side_effect=[rsp, actioninfo])
|
||||
reset_string = '#Manager.Reset'
|
||||
assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues'])
|
||||
|
||||
def test__get_bmc_actions_v123(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ])
|
||||
with open("%s/manager_rsp_v123.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
reset_string = '#Manager.Reset'
|
||||
assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues'])
|
||||
|
||||
def test__get_bmc_actions_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ])
|
||||
with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest._get_bmc_actions()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test_reboot_bmc(self):
|
||||
with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest._get_bmc_actions = mock.Mock(return_value=(rsp['Actions']['#Manager.Reset']['target'], ['ForceRestart']))
|
||||
self.rf_rest.request = mock.Mock(return_value=None)
|
||||
assert self.rf_rest.reboot_bmc() == None
|
||||
assert self.rf_rest.request
|
||||
|
||||
def test_reboot_bmc_unsupported(self):
|
||||
self.rf_rest._get_bmc_actions = mock.Mock(return_value=(self.manager_url + '/BMC/Reset', ['forcerestart']))
|
||||
with pytest.raises(SelfClientException) as excinfo:
|
||||
self.rf_rest.reboot_bmc()
|
||||
assert excinfo.type == SelfClientException
|
||||
assert 'Unsupported option:' in str(excinfo.value)
|
||||
|
||||
def test__get_power_actions(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
with open("%s/system_action_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
actioninfo = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(side_effect=[rsp, actioninfo])
|
||||
reset_string = '#ComputerSystem.Reset'
|
||||
assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues'])
|
||||
|
||||
def test__get_power_actions_v123(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp_v123.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
reset_string = '#ComputerSystem.Reset'
|
||||
assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues'])
|
||||
|
||||
def test__get_power_actions_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest._get_power_actions()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test_set_power_state(self):
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
with open("%s/system_action_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
actioninfo = json.load(load_f)
|
||||
reset_string = '#ComputerSystem.Reset'
|
||||
self.rf_rest._get_power_actions = mock.Mock(return_value=(rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues']))
|
||||
self.rf_rest.request = mock.Mock(return_value=None)
|
||||
assert self.rf_rest.set_power_state('on') == None
|
||||
assert self.rf_rest.request
|
||||
|
||||
def test_set_power_state_unsupported(self):
|
||||
self.rf_rest._get_power_actions = mock.Mock(return_value=(self.systems_url + '/Computer/Reset', ['ForceRestart', 'ForceOff']))
|
||||
with pytest.raises(SelfClientException) as excinfo:
|
||||
self.rf_rest.set_power_state('on')
|
||||
assert excinfo.type == SelfClientException
|
||||
assert 'Unsupported option:' in str(excinfo.value)
|
||||
|
||||
def test_get_boot_state(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest.get_boot_state() == "boot override inactive"
|
||||
rsp['Boot']['BootSourceOverrideTarget'] = 'Pxe'
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest.get_boot_state() == 'Network'
|
||||
rsp['Boot']['BootSourceOverrideEnabled'] = 'Disabled'
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest.get_boot_state() == "boot override inactive"
|
||||
|
||||
def test_get_boot_state_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
del rsp['Boot']['BootSourceOverrideEnabled']
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest.get_boot_state()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test__get_boot_actions(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
assert self.rf_rest._get_boot_actions() == (self.systems_url + '/Computer', rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'])
|
||||
|
||||
def test__get_boot_actions_keyerror(self):
|
||||
self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ])
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
del rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues']
|
||||
self.rf_rest.request = mock.Mock(return_value=rsp)
|
||||
with pytest.raises(SelfServerException) as excinfo:
|
||||
self.rf_rest._get_boot_actions()
|
||||
assert excinfo.type == SelfServerException
|
||||
assert 'Get KeyError' in str(excinfo.value)
|
||||
|
||||
def test_set_boot_state(self):
|
||||
with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f:
|
||||
rsp = json.load(load_f)
|
||||
self.rf_rest._get_boot_actions = mock.Mock(return_value=(self.systems_url + '/Computer', rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues']))
|
||||
self.rf_rest.request = mock.Mock(return_value=None)
|
||||
assert self.rf_rest.set_boot_state(False, 'def') == None
|
||||
assert self.rf_rest.request
|
||||
assert self.rf_rest.set_boot_state(True, 'cd') == None
|
||||
assert self.rf_rest.request
|
||||
|
||||
def test_set_boot_state_unsupported(self):
|
||||
allow_values = ['cd','def']
|
||||
self.rf_rest._get_boot_actions = mock.Mock(return_value=(self.systems_url + '/Computer', allow_values))
|
||||
with pytest.raises(SelfClientException) as excinfo:
|
||||
self.rf_rest.set_boot_state(False, 'hd')
|
||||
assert excinfo.type == SelfClientException
|
||||
assert 'Unsupported option:' in str(excinfo.value)
|
||||
|
||||
def test_init_no_bmcip():
|
||||
nodeinfo_dict = {'bmc': 'testbmc', 'username': 'username', 'password': 'password'}
|
||||
rf_rest_new = rf.RedfishRest(name='testnode', nodeinfo=nodeinfo_dict, messager=Messager(),
|
||||
debugmode=True, verbose=False)
|
||||
|
||||
assert rf_rest_new.bmcip == 'testnode'
|
||||
@@ -2,7 +2,8 @@ from common import utils
|
||||
import gevent
|
||||
from gevent.pool import Pool
|
||||
|
||||
MODULE_MAP = {"openbmc": "OpenBMCManager"}
|
||||
MODULE_MAP = {"openbmc": "OpenBMCManager",
|
||||
"redfish": "RedfishManager"}
|
||||
|
||||
class BaseManager(object):
|
||||
def __init__(self, messager, cwd):
|
||||
|
||||
@@ -14,13 +14,13 @@ from docopt import docopt,DocoptExit
|
||||
|
||||
from common import utils
|
||||
from common import exceptions as xcat_exception
|
||||
from hwctl.executor.openbmc_beacon import OpenBMCBeaconTask
|
||||
from hwctl.executor.openbmc_setboot import OpenBMCBootTask
|
||||
from hwctl.executor.openbmc_flash import OpenBMCFlashTask
|
||||
from hwctl.executor.openbmc_inventory import OpenBMCInventoryTask
|
||||
from hwctl.executor.openbmc_power import OpenBMCPowerTask
|
||||
from hwctl.executor.openbmc_sensor import OpenBMCSensorTask
|
||||
from hwctl.executor.openbmc_eventlog import OpenBMCEventlogTask
|
||||
from hwctl.openbmc.openbmc_beacon import OpenBMCBeaconTask
|
||||
from hwctl.openbmc.openbmc_setboot import OpenBMCBootTask
|
||||
from hwctl.openbmc.openbmc_flash import OpenBMCFlashTask
|
||||
from hwctl.openbmc.openbmc_inventory import OpenBMCInventoryTask
|
||||
from hwctl.openbmc.openbmc_power import OpenBMCPowerTask
|
||||
from hwctl.openbmc.openbmc_sensor import OpenBMCSensorTask
|
||||
from hwctl.openbmc.openbmc_eventlog import OpenBMCEventlogTask
|
||||
from hwctl.beacon import DefaultBeaconManager
|
||||
from hwctl.setboot import DefaultBootManager
|
||||
from hwctl.flash import DefaultFlashManager
|
||||
@@ -315,7 +315,7 @@ class OpenBMCManager(base.BaseManager):
|
||||
|
||||
def rspconfig(self, nodesinfo, args):
|
||||
|
||||
from hwctl.executor.openbmc_bmcconfig import OpenBMCBmcConfigTask
|
||||
from hwctl.openbmc.openbmc_bmcconfig import OpenBMCBmcConfigTask
|
||||
|
||||
try:
|
||||
opts=docopt(RSPCONFIG_USAGE, argv=args)
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
#!/usr/bin/env python
|
||||
###############################################################################
|
||||
# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
###############################################################################
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
import os
|
||||
import gevent
|
||||
import re
|
||||
import sys
|
||||
from docopt import docopt,DocoptExit
|
||||
|
||||
from common import utils
|
||||
from common import exceptions as xcat_exception
|
||||
from hwctl.redfish.redfish_power import RedfishPowerTask
|
||||
from hwctl.redfish.redfish_setboot import RedfishBootTask
|
||||
from hwctl.power import DefaultPowerManager
|
||||
from hwctl.setboot import DefaultBootManager
|
||||
|
||||
from xcatagent import base
|
||||
import logging
|
||||
logger = logging.getLogger('xcatagent')
|
||||
try:
|
||||
if not logger.handlers:
|
||||
utils.enableSyslog('xcat.agent')
|
||||
except:
|
||||
pass
|
||||
|
||||
DEBUGMODE = False
|
||||
VERBOSE = False
|
||||
|
||||
# global variables of rpower
|
||||
POWER_REBOOT_OPTIONS = ('boot', 'reset')
|
||||
POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot')
|
||||
POWER_GET_OPTIONS = ('bmcstate', 'state', 'stat', 'status')
|
||||
|
||||
# global variables of rsetboot
|
||||
SETBOOT_GET_OPTIONS = ('stat', '')
|
||||
SETBOOT_SET_OPTIONS = ('cd', 'def', 'default', 'floppy', 'hd', 'net', 'setup')
|
||||
|
||||
class RedfishManager(base.BaseManager):
|
||||
def __init__(self, messager, cwd, nodes=None, envs=None):
|
||||
super(RedfishManager, self).__init__(messager, cwd)
|
||||
self.nodes = nodes
|
||||
self.debugmode = (envs and envs.get('debugmode')) or None
|
||||
#TODO, remove the global variable DEBUGMODE
|
||||
global DEBUGMODE
|
||||
DEBUGMODE = envs['debugmode']
|
||||
|
||||
if self.debugmode:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
def rpower(self, nodesinfo, args):
|
||||
|
||||
# 1, parse args
|
||||
rpower_usage = """
|
||||
Usage:
|
||||
rpower [-V|--verbose] [boot|bmcreboot|bmcstate|off|on|reset|stat|state|status]
|
||||
|
||||
Options:
|
||||
-V --verbose rpower verbose mode.
|
||||
"""
|
||||
|
||||
try:
|
||||
opts=docopt(rpower_usage, argv=args)
|
||||
|
||||
self.verbose=opts.pop('--verbose')
|
||||
action=[k for k,v in opts.items() if v][0]
|
||||
except Exception as e:
|
||||
# It will not be here as perl has validation for args
|
||||
self.messager.error("Failed to parse arguments for rpower: %s" % args)
|
||||
return
|
||||
|
||||
# 2, validate the args
|
||||
if action not in (POWER_GET_OPTIONS + POWER_SET_OPTIONS + POWER_REBOOT_OPTIONS):
|
||||
self.messager.error("Not supported subcommand for rpower: %s" % action)
|
||||
return
|
||||
|
||||
# 3, run the subcommands
|
||||
runner = RedfishPowerTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose)
|
||||
if action == 'bmcstate':
|
||||
DefaultPowerManager().get_bmc_state(runner)
|
||||
elif action == 'bmcreboot':
|
||||
DefaultPowerManager().reboot_bmc(runner)
|
||||
elif action in POWER_GET_OPTIONS:
|
||||
DefaultPowerManager().get_power_state(runner)
|
||||
elif action in POWER_REBOOT_OPTIONS:
|
||||
DefaultPowerManager().reboot(runner, optype=action)
|
||||
else:
|
||||
DefaultPowerManager().set_power_state(runner, power_state=action)
|
||||
|
||||
|
||||
def rsetboot(self, nodesinfo, args):
|
||||
|
||||
# 1, parse args
|
||||
if not args:
|
||||
args = ['stat']
|
||||
|
||||
rsetboot_usage = """
|
||||
Usage:
|
||||
rsetboot [-V|--verbose] [cd|def|default|floppy||hd|net|stat|setup] [-p]
|
||||
|
||||
Options:
|
||||
-V --verbose rsetboot verbose mode.
|
||||
-p persistant boot source.
|
||||
"""
|
||||
|
||||
try:
|
||||
opts = docopt(rsetboot_usage, argv=args)
|
||||
|
||||
self.verbose = opts.pop('--verbose')
|
||||
action_type = opts.pop('-p')
|
||||
action = [k for k,v in opts.items() if v][0]
|
||||
except Exception as e:
|
||||
self.messager.error("Failed to parse arguments for rsetboot: %s" % args)
|
||||
return
|
||||
|
||||
# 2, validate the args
|
||||
if action not in (SETBOOT_GET_OPTIONS + SETBOOT_SET_OPTIONS):
|
||||
self.messager.error("Not supported subcommand for rsetboot: %s" % action)
|
||||
return
|
||||
|
||||
# 3, run the subcommands
|
||||
runner = RedfishBootTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose)
|
||||
if action in SETBOOT_GET_OPTIONS:
|
||||
DefaultBootManager().get_boot_state(runner)
|
||||
else:
|
||||
DefaultBootManager().set_boot_state(runner, setboot_state=action, persistant=action_type)
|
||||
@@ -25,7 +25,7 @@ class XCATMessager(utils.Messager):
|
||||
def _send(self, d):
|
||||
buf = json.dumps(d)
|
||||
self.sem.acquire()
|
||||
self.sock.sendall(utils.int2bytes(len(buf)) + buf)
|
||||
self.sock.sendall(utils.int2bytes(len(buf)) + buf.encode('utf-8'))
|
||||
self.sem.release()
|
||||
|
||||
def info(self, msg):
|
||||
@@ -101,7 +101,7 @@ class Server(object):
|
||||
new_args=[]
|
||||
if req['args']:
|
||||
for a in req['args']:
|
||||
new_args.append(a.encode('utf-8'))
|
||||
new_args.append(str(a))
|
||||
# call the function in the specified manager
|
||||
func(req['nodeinfo'], new_args)
|
||||
# after the method returns, the request should be handled
|
||||
|
||||
@@ -36,12 +36,14 @@ install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/executor
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish
|
||||
install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent
|
||||
install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent
|
||||
install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common
|
||||
install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl
|
||||
install -m644 lib/python/agent/hwctl/executor/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/executor
|
||||
install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/
|
||||
install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/
|
||||
|
||||
%ifnos linux
|
||||
rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
%undefine __brp_mangle_shebangs
|
||||
Summary: xCAT openbmc python3
|
||||
Name: xCAT-openbmc-py3
|
||||
#Version: %{?version:%{version}}%{!?version:%(cat Version)}
|
||||
Version: 2.14.6
|
||||
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
|
||||
Epoch: 1
|
||||
License: EPL
|
||||
Group: Applications/System
|
||||
Source: xCAT-openbmc-py-%{version}.tar.gz
|
||||
Packager: IBM Corp.
|
||||
Vendor: IBM Corp.
|
||||
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
||||
Prefix: /opt/xcat
|
||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
||||
|
||||
%ifnos linux
|
||||
AutoReqProv: no
|
||||
%endif
|
||||
|
||||
BuildArch: noarch
|
||||
Requires: xCAT-server
|
||||
Requires: python3-gevent >= 1.2.2-2
|
||||
Requires: python3-greenlet >= 0.4.13-2
|
||||
Requires: python3-paramiko >= 2.0.0
|
||||
Requires: python3-docopt python3-requests python3-scp
|
||||
|
||||
%description
|
||||
xCAT-openbmc-py3 provides openbmc related functions python3 based.
|
||||
|
||||
%prep
|
||||
%setup -q -n xCAT-openbmc-py
|
||||
%build
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc
|
||||
install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish
|
||||
install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent
|
||||
install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent
|
||||
install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common
|
||||
install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl
|
||||
install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/
|
||||
install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/
|
||||
|
||||
%ifnos linux
|
||||
rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{prefix}
|
||||
|
||||
%changelog
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
|
||||
%preun
|
||||
|
||||
@@ -11,6 +11,7 @@ Vendor: IBM Corp.
|
||||
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
||||
Prefix: /opt/xcat
|
||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
||||
Requires: xCAT-client
|
||||
|
||||
%ifos linux
|
||||
BuildArch: noarch
|
||||
|
||||
@@ -33,6 +33,77 @@ my %module_type = (
|
||||
"redfish" => "Redfish",
|
||||
);
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 parse_node_info
|
||||
|
||||
Parse the node information: bmc, bmcip, username, password
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub parse_node_info {
|
||||
my $noderange = shift;
|
||||
my $module = shift;
|
||||
my $node_info_ref = shift;
|
||||
my $callback = shift;
|
||||
my $rst = 0;
|
||||
|
||||
my $passwd_table = xCAT::Table->new('passwd');
|
||||
my $passwd_hash = $passwd_table->getAttribs({ 'key' => $module }, qw(username password));
|
||||
|
||||
my $openbmc_table = xCAT::Table->new('openbmc');
|
||||
my $openbmc_hash = $openbmc_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']);
|
||||
|
||||
foreach my $node (@$noderange) {
|
||||
if (defined($openbmc_hash->{$node}->[0])) {
|
||||
if ($openbmc_hash->{$node}->[0]->{'bmc'}) {
|
||||
$node_info_ref->{$node}->{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'};
|
||||
$node_info_ref->{$node}->{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($openbmc_hash->{$node}->[0]->{'bmc'});
|
||||
}
|
||||
unless($node_info_ref->{$node}->{bmc}) {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node);
|
||||
delete $node_info_ref->{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
unless($node_info_ref->{$node}->{bmcip}) {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info_ref->{$node}->{bmc}", $callback, $node);
|
||||
delete $node_info_ref->{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
if ($openbmc_hash->{$node}->[0]->{'username'}) {
|
||||
$node_info_ref->{$node}->{username} = $openbmc_hash->{$node}->[0]->{'username'};
|
||||
} elsif ($passwd_hash and $passwd_hash->{username}) {
|
||||
$node_info_ref->{$node}->{username} = $passwd_hash->{username};
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node);
|
||||
delete $node_info_ref->{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($openbmc_hash->{$node}->[0]->{'password'}) {
|
||||
$node_info_ref->{$node}->{password} = $openbmc_hash->{$node}->[0]->{'password'};
|
||||
} elsif ($passwd_hash and $passwd_hash->{password}) {
|
||||
$node_info_ref->{$node}->{password} = $passwd_hash->{password};
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node);
|
||||
delete $node_info_ref->{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node);
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
return $rst;
|
||||
}
|
||||
|
||||
sub acquire_lock {
|
||||
my $ppid = shift;
|
||||
$ppid = shift if (($ppid) && ($ppid =~ /AGENT/));
|
||||
|
||||
@@ -503,11 +503,13 @@ sub is_goconserver_running {
|
||||
sub switch_goconserver {
|
||||
my $callback = shift;
|
||||
# ignore SN as it is handled by AAsn
|
||||
if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) {
|
||||
if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) {
|
||||
my $cmd = "systemctl disable conserver";
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
|
||||
if (-x "/usr/sbin/conserver") {
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
|
||||
}
|
||||
}
|
||||
$cmd = "systemctl enable goconserver";
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
@@ -535,11 +537,13 @@ sub switch_goconserver {
|
||||
sub switch_conserver {
|
||||
my $callback = shift;
|
||||
# ignore SN as it is handled by AAsn
|
||||
if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) {
|
||||
if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) {
|
||||
my $cmd = "systemctl disable goconserver";
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
|
||||
if (-x "/usr/bin/goconserver") {
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback);
|
||||
}
|
||||
}
|
||||
$cmd = "systemctl enable conserver";
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
|
||||
@@ -391,9 +391,10 @@ sub subvars {
|
||||
$inc =~ s/#SHORTNAME#/$shortname/g;
|
||||
$inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg;
|
||||
$inc =~ s/#GETPRINICMAC:([^#]+)#/xCAT::Utils::parseMacTabEntry(tabdb("mac",$1,"mac"),$1)/eg;
|
||||
$inc =~ s/#COLONHTTPPORT#/$httpportsuffix/eg;
|
||||
|
||||
if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) {
|
||||
$inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#/ /g;
|
||||
$inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#//g;
|
||||
}
|
||||
|
||||
if ($::XCATSITEVALS{xcatdebugmode} eq "2") {
|
||||
@@ -428,7 +429,7 @@ sub subvars {
|
||||
$partcontent .= "rm -rf /tmp/partitionfile\n";
|
||||
|
||||
# Put the code to decode the partitionfile
|
||||
$partcontent .= "python -c 'import base64; print base64.b64decode(open(\"/tmp/partscript.enc\",\"rb\").read())' >/tmp/partscript\n";
|
||||
$partcontent .= "base64decode</tmp/partscript.enc >/tmp/partscript\n";
|
||||
$partcontent .= "chmod 755 /tmp/partscript\n";
|
||||
$partcontent .= "/tmp/partscript\n";
|
||||
|
||||
@@ -489,7 +490,7 @@ sub subvars {
|
||||
$partcontent .= "rm -rf /tmp/partitionfile\n";
|
||||
|
||||
# Put the code to decode the partitionfile
|
||||
$partcontent .= "python -c 'import base64; print base64.b64decode(open(\"/tmp/partitionfile.enc\",\"rb\").read())' >/tmp/partitionfile\n";
|
||||
$partcontent .= "base64decode</tmp/partitionfile.enc >/tmp/partitionfile\n";
|
||||
|
||||
#replace the #XCA_PARTITION_SCRIPT#
|
||||
$inc =~ s/#XCA_PARTITION_SCRIPT#/$partcontent/;
|
||||
|
||||
@@ -1343,8 +1343,8 @@ sub stop_TFTP
|
||||
{
|
||||
my $distro=xCAT::Utils->osver();
|
||||
# Check whether the tftp-hpa has been installed, the ubuntu tftpd-hpa configure file is under /etc/default
|
||||
unless (-x "/usr/sbin/in.tftpd" and (-e "/etc/xinetd.d/tftp" or -e "/etc/default/tftpd-hpa")) {
|
||||
xCAT::MsgUtils->message("S", "ERROR: The tftpd was not installed, enable the tftp failed.");
|
||||
unless (-x "/usr/sbin/in.tftpd") {
|
||||
xCAT::MsgUtils->message("S", "ERROR: The tftpd was not installed, stop the tftp failed.");
|
||||
return 1;
|
||||
}
|
||||
# kill the process of atftp if it's there
|
||||
@@ -1436,103 +1436,6 @@ sub enable_TFTP
|
||||
close(MAPFILE);
|
||||
}
|
||||
|
||||
my $distro = xCAT::Utils->osver();
|
||||
if ($distro !~ /ubuntu.*/i && $distro !~ /debian.*/i) {
|
||||
if (!open(FILE, "</etc/xinetd.d/tftp")) {
|
||||
xCAT::MsgUtils->message("S", "ERROR: Cannot open /etc/xinetd.d/tftp.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
# The location of tftp mapfile
|
||||
my $mapfile = "/etc/tftpmapfile4xcat.conf";
|
||||
my $recfg = 0;
|
||||
my @newcfgfile;
|
||||
|
||||
# Check whether need to reconfigure the /etc/xinetd.d/tftp
|
||||
while (<FILE>) {
|
||||
|
||||
# check the configuration of 'server_args = -s /xx -m xx' entry
|
||||
if (/^\s*server_args\s*=(.*)$/) {
|
||||
my $cfg_args = $1;
|
||||
|
||||
# handle the -s option for the location of tftp root dir
|
||||
if ($cfg_args =~ /-s\s+([^\s]*)/) {
|
||||
my $cfgdir = $1;
|
||||
$cfgdir =~ s/\$//;
|
||||
$tftpdir =~ s/\$//;
|
||||
|
||||
# make sure the tftp dir should comes from the site.tftpdir
|
||||
if ($cfgdir ne $tftpdir) {
|
||||
$recfg = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# handle the -m option for the mapfile
|
||||
if ($cfg_args !~ /-m\s+([^\s]*)/) {
|
||||
$recfg = 1;
|
||||
}
|
||||
if ($recfg) {
|
||||
|
||||
# regenerate the entry for server_args
|
||||
my $newcfg = $_;
|
||||
$newcfg =~ s/=.*$/= -s $tftpdir -m $mapfile/;
|
||||
push @newcfgfile, $newcfg;
|
||||
} else {
|
||||
push @newcfgfile, $_;
|
||||
}
|
||||
} elsif (/^\s*disable\s*=/ && !/^\s*disable\s*=\s*yes/) {
|
||||
|
||||
# disable the tftp by handling the entry 'disable = yes'
|
||||
my $newcfg = $_;
|
||||
$newcfg =~ s/=.*$/= yes/;
|
||||
push @newcfgfile, $newcfg;
|
||||
$recfg = 1;
|
||||
} else {
|
||||
push @newcfgfile, $_;
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
# reconfigure the /etc/xinetd.d/tftp
|
||||
if ($recfg) {
|
||||
if (!open(FILE, ">/etc/xinetd.d/tftp")) {
|
||||
xCAT::MsgUtils->message("S", "ERROR: Cannot open /etc/xinetd.d/tftp");
|
||||
return 1;
|
||||
}
|
||||
print FILE @newcfgfile;
|
||||
close(FILE);
|
||||
|
||||
#my @output = xCAT::Utils->runcmd("service xinetd status", -1);
|
||||
#if ($::RUNCMD_RC == 0) {}
|
||||
my $retcode = xCAT::Utils->checkservicestatus("xinetd");
|
||||
if ($retcode == 0) {
|
||||
my $retcode = xCAT::Utils->restartservice("xinetd");
|
||||
if ($retcode != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("S",
|
||||
"Error on restart xinetd\n");
|
||||
|
||||
}
|
||||
#if (grep(/running/, @output))
|
||||
#{
|
||||
# print ' '; # indent service output to separate it from the xcatd service output
|
||||
# system "service xinetd stop";
|
||||
# if ($? > 0)
|
||||
# { # error
|
||||
# xCAT::MsgUtils->message("S",
|
||||
# "Error on command: service xinetd stop\n");
|
||||
# }
|
||||
# system "service xinetd start";
|
||||
# if ($? > 0)
|
||||
# { # error
|
||||
# xCAT::MsgUtils->message("S",
|
||||
# "Error on command: service xinetd start\n");
|
||||
# }
|
||||
#}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# get the version of TCP/IP protocol
|
||||
my $protocols;
|
||||
my $v4only = "-4 ";
|
||||
|
||||
@@ -3274,7 +3274,7 @@ sub defls
|
||||
|
||||
|
||||
# do we want just the object names or all the attr=val
|
||||
if ($::opt_l || @::noderange || $::opt_o || $::opt_i || $::opt_template)
|
||||
if ($::opt_l || @::noderange || $::opt_o || $::opt_i || $::opt_z || $::opt_template)
|
||||
{
|
||||
|
||||
# assume we want the the details - not just the names
|
||||
@@ -3297,7 +3297,7 @@ sub defls
|
||||
|
||||
# is -i then just get the ones in the list
|
||||
$::ATTRLIST = $::opt_i;
|
||||
} elsif (@::noderange || $::opt_o) {
|
||||
} elsif (@::noderange || $::opt_o || $::opt_z) {
|
||||
|
||||
# if they gave a list of objects then they must want more
|
||||
# than the object names!
|
||||
@@ -4609,7 +4609,7 @@ sub defmk_usage
|
||||
}
|
||||
$rsp->{data}->[$n] = "$dataobj\n";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to";
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t <object-types>\' option to";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
@@ -4656,7 +4656,7 @@ sub defch_usage
|
||||
}
|
||||
$rsp->{data}->[$n] = "$dataobj\n";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to";
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t <object-types>\' option to";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
@@ -4700,7 +4700,7 @@ sub defls_usage
|
||||
}
|
||||
$rsp->{data}->[$n] = "$dataobj\n";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to";
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t <object-types>\' option to";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
@@ -4741,7 +4741,7 @@ sub defrm_usage
|
||||
}
|
||||
$rsp->{data}->[$n] = "$dataobj\n";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to";
|
||||
$rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t <object-types>\' option to";
|
||||
$n++;
|
||||
$rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
|
||||
@@ -2250,7 +2250,7 @@ sub copycd
|
||||
print $KID $_ . "\n";
|
||||
}
|
||||
close($KID);
|
||||
$rc = $?;
|
||||
$rc = $? >> 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2261,22 +2261,18 @@ sub copycd
|
||||
my $copied = 0;
|
||||
my ($percent, $fout);
|
||||
while (<PIPE>) {
|
||||
next if /^cpio:/;
|
||||
if (/^cpio:/) {
|
||||
chomp;
|
||||
$callback->({ data => $_ });
|
||||
next;
|
||||
}
|
||||
$percent = $copied / $numFiles;
|
||||
$fout = sprintf "%0.2f%%", $percent * 100;
|
||||
$callback->({ sinfo => "$fout" });
|
||||
++$copied;
|
||||
}
|
||||
if ($copied == $numFiles)
|
||||
{
|
||||
#media copy success
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
#media copy failed
|
||||
exit(1);
|
||||
}
|
||||
close(PIPE);
|
||||
exit($? >> 8);
|
||||
}
|
||||
|
||||
#my $rc = system("cd $path; find . | nice -n 20 cpio -dump $installroot/$distname/$arch");
|
||||
@@ -2297,7 +2293,7 @@ sub copycd
|
||||
|
||||
if ($rc != 0)
|
||||
{
|
||||
$callback->({ error => "Media copy operation failed, status $rc" });
|
||||
$callback->({ error => "Media copy operation failed, status $rc", errorcode => [1] });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -212,10 +212,16 @@ sub process_request {
|
||||
} else {
|
||||
my $rsp->{data}->[0] = "makeconservercf is deprecrated as well as conserver, go to makegocons for more information about enabling goconserver.";
|
||||
xCAT::MsgUtils->message("W", $rsp, $cb);
|
||||
xCAT::Goconserver::switch_conserver($cb) if (-x "/usr/sbin/conserver");
|
||||
}
|
||||
xCAT::Goconserver::switch_conserver($cb);
|
||||
}
|
||||
makeconservercf($req, $cb);
|
||||
if (-x "/usr/sbin/conserver") {
|
||||
makeconservercf($req, $cb);
|
||||
} else {
|
||||
my $rsp->{data}->[0] = "conserver is not supported or not installed.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $cb);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -785,7 +785,7 @@ sub process_request {
|
||||
"Update Named Conf dir $ctx->{dbdir} $ctx->{zonesdir}";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
}
|
||||
|
||||
$ctx->{forwardmode} = get_forwardmode();
|
||||
update_namedconf($ctx, $slave);
|
||||
|
||||
unless ($slave)
|
||||
@@ -935,6 +935,27 @@ sub get_zonesdir {
|
||||
return "$ZonesDir";
|
||||
}
|
||||
|
||||
sub get_forwardmode {
|
||||
my $forwardmode;
|
||||
my @entries = xCAT::TableUtils->get_site_attribute("dnsforwardmode");
|
||||
my $site_entry = $entries[0];
|
||||
if (defined($site_entry)) {
|
||||
if ($site_entry =~ /^only$|^first$/) {
|
||||
$forwardmode = $site_entry;
|
||||
} elsif ($site_entry =~ /^no$/) {
|
||||
$forwardmode = ""
|
||||
}else {
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "forward mode $site_entry is not supported, supported value: only, first, no.";
|
||||
xCAT::MsgUtils->message("S", "forward mode $site_entry is not supported, supported value: only, first, no.");
|
||||
xCAT::MsgUtils->message("W", $rsp, $callback);
|
||||
return;
|
||||
}
|
||||
}
|
||||
return "$forwardmode";
|
||||
}
|
||||
|
||||
|
||||
sub get_conf {
|
||||
my $conf = "/etc/named.conf";
|
||||
|
||||
@@ -1114,6 +1135,8 @@ sub update_namedconf {
|
||||
push @newnamed, "\t\t" . $_ . ";\n";
|
||||
}
|
||||
push @newnamed, "\t};\n";
|
||||
} elsif ($ctx->{forwardmode} and $line =~ /forward/) {
|
||||
push @newnamed, "\tforward " . $ctx->{forwardmode} . ";\n";
|
||||
} elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) {
|
||||
push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n";
|
||||
} elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) {
|
||||
@@ -1255,6 +1278,10 @@ sub update_namedconf {
|
||||
push @newnamed, "\t};\n";
|
||||
}
|
||||
|
||||
if ($ctx->{forwardmode}){
|
||||
push @newnamed, "\tforward " . $ctx->{forwardmode} . ";\n";
|
||||
}
|
||||
|
||||
if ($ctx->{empty_zones_enable}){
|
||||
push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n";
|
||||
}
|
||||
|
||||
@@ -872,7 +872,7 @@ sub mkinstall {
|
||||
my $kcmdline = "nofb utf8 auto url=http://" . $instserver . ":$httpport/install/autoinst/" . $node;
|
||||
|
||||
$kcmdline .= " xcatd=" . $instserver;
|
||||
$kcmdline .= " mirror/http/hostname=" . $instserver;
|
||||
$kcmdline .= " mirror/http/hostname=" . $instserver.":$httpport";
|
||||
if ($maxmem) {
|
||||
$kcmdline .= " mem=$maxmem";
|
||||
}
|
||||
@@ -973,6 +973,7 @@ sub mknetboot
|
||||
my $xcatdport = "3001";
|
||||
my $xcatiport = "3002";
|
||||
my $nodestatus = "y";
|
||||
my $httpport="80";
|
||||
my @myself = xCAT::NetworkUtils->determinehostname();
|
||||
my $myname = $myself[ (scalar @myself) - 1 ];
|
||||
|
||||
@@ -1003,6 +1004,12 @@ sub mknetboot
|
||||
{
|
||||
$nodestatus = $ref->{value};
|
||||
}
|
||||
($ref) = $sitetab->getAttribs({ key => 'httpport' }, 'value');
|
||||
if ($ref and $ref->{value})
|
||||
{
|
||||
$httpport = $ref->{value};
|
||||
}
|
||||
|
||||
}
|
||||
my %donetftp = ();
|
||||
my %oents = %{ $ostab->getNodesAttribs(\@nodes, [qw(os arch profile provmethod)]) };
|
||||
|
||||
@@ -610,7 +610,7 @@ sub addnode
|
||||
$hname = $node;
|
||||
} #Default to hostname equal to nodename
|
||||
unless ($mac) { next; } #Skip corrupt format
|
||||
if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/)
|
||||
if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5,7}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5,7}$/)
|
||||
{
|
||||
$callback->(
|
||||
{
|
||||
@@ -764,6 +764,10 @@ sub addnode
|
||||
$hostname = $1 . "-hf" . $count;
|
||||
}
|
||||
}
|
||||
} elsif (length($mac) == 23) { # 8 bytes of mac address
|
||||
# Currently the only thing that has 8 bytes is an infiniband
|
||||
# or infiniband like device, which is type 32 (0x20).
|
||||
$hardwaretype = 32;
|
||||
}
|
||||
|
||||
#syslog("local4|err", "Setting $node ($hname|$ip) to " . $mac);
|
||||
@@ -1757,7 +1761,7 @@ sub process_request
|
||||
my $os_ver = $os;
|
||||
$os_ver =~ s/[^0-9.^0-9]//g;
|
||||
if (($os =~ /sles/i && $os_ver >= 11) ||
|
||||
($os =~ /rhels/i && $os_ver >= 7)) {
|
||||
($os =~ /rhels?/i && $os_ver >= 7)) {
|
||||
|
||||
$dhcpd_key = "DHCPD_INTERFACE";
|
||||
if ($usingipv6 and $dhcpver eq "dhcpd6") {
|
||||
@@ -1825,7 +1829,10 @@ sub process_request
|
||||
if ($usingipv6) {
|
||||
|
||||
# sles11.3 and rhels7 has dhcpd and dhcpd6 config in the dhcp file
|
||||
if ($os =~ /sles/i || $os =~ /rhels7/i) {
|
||||
my $os_ver = $os;
|
||||
$os_ver =~ s/[^0-9.^0-9]//g;
|
||||
if (($os =~ /sles/i && $os_ver >= 11) ||
|
||||
($os =~ /rhels?/i && $os_ver >= 7)) {
|
||||
if ($missingfiles{dhcpd}) {
|
||||
$callback->({ error => ["The file /etc/sysconfig/dhcpd doesn't exist, check the dhcp server"] });
|
||||
}
|
||||
@@ -2677,7 +2684,7 @@ sub addnet
|
||||
}
|
||||
}
|
||||
#for cumulus ZTP process
|
||||
push @netent, " option cumulus-provision-url \"http://$tftp.':' . $httpport/install/postscripts/cumulusztp\";\n";
|
||||
push @netent, " option cumulus-provision-url \"http://$tftp:$httpport/install/postscripts/cumulusztp\";\n";
|
||||
|
||||
my $ddnserver = $nameservers;
|
||||
$ddnserver =~ s/,.*//;
|
||||
@@ -2717,9 +2724,9 @@ sub addnet
|
||||
# $lstatements = 'if exists gpxe.bus-id { filename = \"\"; } else if exists client-architecture { filename = \"xcat/xnba.kpxe\"; } '.$lstatements;
|
||||
push @netent, " if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { #x86, xCAT Network Boot Agent\n";
|
||||
push @netent, " always-broadcast on;\n";
|
||||
push @netent, " filename = \"http://$tftp.':' . $httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n";
|
||||
push @netent, " filename = \"http://$tftp:$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n";
|
||||
push @netent, " } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { #x86, xCAT Network Boot Agent\n";
|
||||
push @netent, " filename = \"http://$tftp.':' . $httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n";
|
||||
push @netent, " filename = \"http://$tftp:$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n";
|
||||
push @netent, " } else if option client-architecture = 00:00 { #x86\n";
|
||||
push @netent, " filename \"xcat/xnba.kpxe\";\n";
|
||||
push @netent, " } else if option vendor-class-identifier = \"Etherboot-5.4\" { #x86\n";
|
||||
@@ -2735,10 +2742,10 @@ sub addnet
|
||||
push @netent, " filename \"elilo.efi\";\n";
|
||||
push @netent,
|
||||
" } else if option client-architecture = 00:0e { #OPAL-v3\n ";
|
||||
push @netent, " option conf-file = \"http://$tftp.':' . $httpport/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n";
|
||||
push @netent, " option conf-file = \"http://$tftp:$httpport/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n";
|
||||
push @netent,
|
||||
" } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n";
|
||||
push @netent, " option www-server = \"http://$tftp.':' . $httpport/install/onie/onie-installer\";\n";
|
||||
push @netent, " option www-server = \"http://$tftp:$httpport/install/onie/onie-installer\";\n";
|
||||
push @netent,
|
||||
" } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n ";
|
||||
push @netent, " filename \"/yaboot\";\n";
|
||||
|
||||
@@ -391,9 +391,11 @@ sub donets
|
||||
foreach (@ip6table)
|
||||
{
|
||||
my @ent = split /\s+/, $_;
|
||||
if ($ent[0] eq 'fe80::/64' or $ent[0] eq 'unreachable' or $ent[1] eq 'via') {
|
||||
if ($ent[0] eq 'fe80::/64' or $ent[0] eq 'unreachable' or
|
||||
$ent[1] eq 'via' or $ent[2] eq 'lo') {
|
||||
|
||||
#Do not contemplate link-local, unreachable, or gatewayed networks further
|
||||
#Do not contemplate link-local, unreachable, gatewayed networks,
|
||||
# or networks connected to loopback interface
|
||||
#DHCPv6 relay will be manually entered into networks as was the case for IPv4
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ use Getopt::Long;
|
||||
use Expect;
|
||||
use File::Path;
|
||||
use File::Basename;
|
||||
use File::Copy "cp";
|
||||
|
||||
use xCAT::Utils;
|
||||
use xCAT::MsgUtils;
|
||||
@@ -183,11 +184,13 @@ sub copydata {
|
||||
|
||||
#check if file exists
|
||||
if ( (-e "$defaultpath/$filename") && ($nooverwrite)){
|
||||
chmod 0755, "$defaultpath/$filename";
|
||||
$callback->({ data => "$defaultpath/$filename is already exists, will not overwrite" });
|
||||
} else {
|
||||
$callback->({ data => "Copying media to $defaultpath" });
|
||||
mkpath ("$defaultpath");
|
||||
system("cp $file $defaultpath");
|
||||
cp "$file", "$defaultpath";
|
||||
chmod 0755, "$defaultpath/$filename";
|
||||
$callback->({ data => "Media copy operation successful" });
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ sub process_request {
|
||||
}
|
||||
|
||||
my $noderange = $request->{node};
|
||||
my $check = parse_node_info($noderange);
|
||||
my $check = xCAT::AGENT::parse_node_info($noderange, "openbmc", \%node_info, $callback);
|
||||
if (&refactor_args($request)) {
|
||||
xCAT::MsgUtils->message("E", { data => ["Failed to refactor arguments"] }, $callback);
|
||||
return;
|
||||
@@ -167,8 +167,8 @@ my %rsp_set_valid_values = (
|
||||
autoreboot => "0|1",
|
||||
bootmode => "regular|safe|setup",
|
||||
powersupplyredundancy => "disabled|enabled",
|
||||
powerrestorepolicy => "restore|always_on|always_off",
|
||||
timesyncmethod => "ntp|manual",
|
||||
powerrestorepolicy => "always_off|always_on|restore",
|
||||
timesyncmethod => "manual|ntp",
|
||||
);
|
||||
my @rspconfig_get_options = (@rsp_common_options, qw/ipsrc sshcfg gard dump/);
|
||||
#-------------------------------------------------------
|
||||
@@ -418,74 +418,6 @@ sub parse_args {
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 parse_node_info
|
||||
|
||||
Parse the node information: bmc, bmcip, username, password
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub parse_node_info {
|
||||
my $noderange = shift;
|
||||
my $rst = 0;
|
||||
|
||||
my $passwd_table = xCAT::Table->new('passwd');
|
||||
my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'openbmc' }, qw(username password));
|
||||
|
||||
my $openbmc_table = xCAT::Table->new('openbmc');
|
||||
my $openbmc_hash = $openbmc_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']);
|
||||
|
||||
foreach my $node (@$noderange) {
|
||||
if (defined($openbmc_hash->{$node}->[0])) {
|
||||
if ($openbmc_hash->{$node}->[0]->{'bmc'}) {
|
||||
$node_info{$node}{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'};
|
||||
$node_info{$node}{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($openbmc_hash->{$node}->[0]->{'bmc'});
|
||||
}
|
||||
unless($node_info{$node}{bmc}) {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node);
|
||||
delete $node_info{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
unless($node_info{$node}{bmcip}) {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info{$node}{bmc}", $callback, $node);
|
||||
delete $node_info{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
if ($openbmc_hash->{$node}->[0]->{'username'}) {
|
||||
$node_info{$node}{username} = $openbmc_hash->{$node}->[0]->{'username'};
|
||||
} elsif ($passwd_hash and $passwd_hash->{username}) {
|
||||
$node_info{$node}{username} = $passwd_hash->{username};
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node);
|
||||
delete $node_info{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($openbmc_hash->{$node}->[0]->{'password'}) {
|
||||
$node_info{$node}{password} = $openbmc_hash->{$node}->[0]->{'password'};
|
||||
} elsif ($passwd_hash and $passwd_hash->{password}) {
|
||||
$node_info{$node}{password} = $passwd_hash->{password};
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node);
|
||||
delete $node_info{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node);
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
return $rst;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 refactor_args
|
||||
|
||||
refractor args to be easily dealt by python client
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
#!/usr/bin/perl
|
||||
### IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
package xCAT_plugin::redfish;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
use warnings "all";
|
||||
|
||||
use Getopt::Long;
|
||||
use xCAT::Usage;
|
||||
use xCAT::SvrUtils;
|
||||
use xCAT::AGENT;
|
||||
use Data::Dumper;
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
rbeacon => 'nodehm:mgt',
|
||||
reventlog => 'nodehm:mgt',
|
||||
rinv => 'nodehm:mgt',
|
||||
rpower => 'nodehm:mgt',
|
||||
rsetboot => 'nodehm:mgt',
|
||||
rspconfig => 'nodehm:mgt',
|
||||
rvitals => 'nodehm:mgt',
|
||||
};
|
||||
}
|
||||
|
||||
my %node_info = ();
|
||||
my $callback;
|
||||
$::VERBOSE = 0;
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 preprocess_request
|
||||
|
||||
preprocess the command
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub preprocess_request {
|
||||
my $request = shift;
|
||||
$callback = shift;
|
||||
my $command = $request->{command}->[0];
|
||||
my $noderange = $request->{node};
|
||||
my $extrargs = $request->{arg};
|
||||
my @exargs = ($request->{arg});
|
||||
my @requests;
|
||||
|
||||
if (ref($extrargs)) {
|
||||
@exargs = @$extrargs;
|
||||
}
|
||||
|
||||
my $usage_string = xCAT::Usage->parseCommand($command, @exargs);
|
||||
if ($usage_string) {
|
||||
$callback->({ data => [$usage_string] });
|
||||
$request = {};
|
||||
return;
|
||||
}
|
||||
|
||||
my $parse_result = parse_args($command, $extrargs, $noderange);
|
||||
if (ref($parse_result) eq 'ARRAY') {
|
||||
my $error_data;
|
||||
foreach my $node (@$noderange) {
|
||||
$error_data .= "\n" if ($error_data);
|
||||
$error_data .= "$node: Error: " . "$parse_result->[1]";
|
||||
}
|
||||
$callback->({ errorcode => [$parse_result->[0]], data => [$error_data] });
|
||||
$request = {};
|
||||
return;
|
||||
}
|
||||
|
||||
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN");
|
||||
foreach my $snkey (keys %$sn) {
|
||||
my $reqcopy = {%$request};
|
||||
$reqcopy->{node} = $sn->{$snkey};
|
||||
$reqcopy->{'_xcatdest'} = $snkey;
|
||||
$reqcopy->{_xcatpreprocessed}->[0] = 1;
|
||||
push @requests, $reqcopy;
|
||||
}
|
||||
|
||||
return \@requests;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the command
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
$callback = shift;
|
||||
|
||||
if (!xCAT::AGENT::exists_python_agent()) {
|
||||
xCAT::MsgUtils->message("E", { data => ["The xCAT Python agent does not exist. Check if xCAT-openbmc-py package is installed on management node and service nodes."] }, $callback);
|
||||
return;
|
||||
}
|
||||
|
||||
my $noderange = $request->{node};
|
||||
my $check = xCAT::AGENT::parse_node_info($noderange, "redfish", \%node_info, $callback);
|
||||
$callback->({ errorcode => [$check] }) if ($check);
|
||||
return unless(%node_info);
|
||||
|
||||
my $pid = xCAT::AGENT::start_python_agent();
|
||||
if (!defined($pid)) {
|
||||
xCAT::MsgUtils->message("E", { data => ["Failed to start the xCAT Python agent. Check /var/log/xcat/cluster.log for more information."] }, $callback);
|
||||
return;
|
||||
}
|
||||
|
||||
xCAT::AGENT::submit_agent_request($pid, $request, "redfish", \%node_info, $callback);
|
||||
xCAT::AGENT::wait_agent($pid, $callback);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 parse_args
|
||||
|
||||
Parse the command line options and operands
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub parse_args {
|
||||
my $command = shift;
|
||||
my $extrargs = shift;
|
||||
my $noderange = shift;
|
||||
my $subcommand = undef;
|
||||
|
||||
unless (GetOptions(
|
||||
'V|verbose' => \$::VERBOSE,
|
||||
)) {
|
||||
return ([ 1, "Error parsing arguments." ]);
|
||||
}
|
||||
|
||||
if (scalar(@ARGV) >= 2 and ($command =~ /rbeacon|rpower|rvitals/)) {
|
||||
return ([ 1, "Only one option is supported at the same time for $command" ]);
|
||||
} elsif (scalar(@ARGV) == 0 and $command =~ /rbeacon|rspconfig|rpower/) {
|
||||
return ([ 1, "No option specified for $command" ]);
|
||||
} else {
|
||||
$subcommand = $ARGV[0];
|
||||
}
|
||||
|
||||
if ($command eq "rpower") {
|
||||
unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
}
|
||||
} elsif ($command eq "rsetboot") {
|
||||
my $persistant;
|
||||
GetOptions('p' => \$persistant);
|
||||
return ([ 1, "Only one option is supported at the same time for $command" ]) if (@ARGV > 1);
|
||||
$subcommand = "stat" if (!defined($ARGV[0]));
|
||||
unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$|^setup$|^floppy$/) {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
}
|
||||
} else {
|
||||
return ([ 1, "Unsupported command: $command" ]);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -937,14 +937,12 @@ sub mkinstall
|
||||
|
||||
# trim the "/" in /install/sles11.3/x86_64/
|
||||
$pkgdir =~ s/\/$//;
|
||||
if ($pkgdir =~ /^($installroot\/$os\/$arch)$/) {
|
||||
if ( -d "$pkgdir/2") {
|
||||
$srcdirs[0] = "$pkgdir/1,$pkgdir/2";
|
||||
}else{
|
||||
$srcdirs[0] = "$pkgdir/1";
|
||||
}
|
||||
$tmppkgdir = join(",", @srcdirs);
|
||||
if ( -d "$pkgdir/2") {
|
||||
$srcdirs[0] = "$pkgdir/1,$pkgdir/2";
|
||||
}else{
|
||||
$srcdirs[0] = "$pkgdir/1";
|
||||
}
|
||||
$tmppkgdir = join(",", @srcdirs);
|
||||
|
||||
#Call the Template class to do substitution to produce a kickstart file in the autoinst dir
|
||||
my $tmperr;
|
||||
|
||||
+23
-10
@@ -1206,7 +1206,7 @@ sub initDB
|
||||
$chtabcmds .= "$::XCATROOT/sbin/chtab key=cleanupxcatpost site.value=no;";
|
||||
$chtabcmds .= "$::XCATROOT/sbin/chtab key=dhcplease site.value=43200;";
|
||||
$chtabcmds .= "$::XCATROOT/sbin/chtab key=auditnosyslog site.value=0;";
|
||||
$chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;";
|
||||
$chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=;";
|
||||
$chtabcmds .= "$::XCATROOT/sbin/chtab key=auditskipcmds site.value=ALL;";
|
||||
|
||||
#$chtabcmds .= "$::XCATROOT/sbin/chtab key=useflowcontrol site.value=yes;"; # need to fix 4031
|
||||
@@ -1474,16 +1474,29 @@ sub initDB
|
||||
}
|
||||
|
||||
# Set default value for site.xcatsslversion when update xcat
|
||||
$cmds = "XCATBYPASS=Y $::XCATROOT/sbin/tabdump site 2>/dev/null |grep xcatsslversion";
|
||||
$cmds = "XCATBYPASS=Y $::XCATROOT/sbin/tabdump site 2>/dev/null | grep xcatsslversion";
|
||||
xCAT::Utils->runcmd("$cmds", -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
|
||||
# if site.xcatsslversion was not set, then set the default value TLSv1
|
||||
$cmds = "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;";
|
||||
xCAT::Utils->runcmd("$cmds", 0);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->message('E', "Could not add default value for site.xcatsslversion.");
|
||||
}
|
||||
if ($::RUNCMD_RC == 0) {
|
||||
xCAT::MsgUtils->message('I',
|
||||
"__ ___ ___ _ _ ___ _ _ ___");
|
||||
xCAT::MsgUtils->message('I',
|
||||
"\\ \\ / /_\\ | _ \\ \\| |_ _| \\| |/ __| _ +-+-+-+-+-+-+-+");
|
||||
xCAT::MsgUtils->message('I',
|
||||
" \\ \\/\\/ / _ \\| / .` || || .` | (_ | oo\\ |W|A|R|N|I|N|G|");
|
||||
xCAT::MsgUtils->message('I',
|
||||
" \\_/\\_/_/ \\_\\_|_\\_|\\_|___|_|\\_|\\___| (__)\\ +-+-+-+-+-+-+-+");
|
||||
xCAT::MsgUtils->message('I',
|
||||
"+--------------------------------------------------------------+ +-+-+-+-+-+-+-+");
|
||||
xCAT::MsgUtils->message('I',
|
||||
"| The default value of `site.xcatsslversion' was updated. |:|W|A|R|N|I|N|G|");
|
||||
xCAT::MsgUtils->message('I',
|
||||
"| Run `chdef -t site xcatsslversion=' to update your system to |:+-+-+-+-+-+-+-+");
|
||||
xCAT::MsgUtils->message('I',
|
||||
"| the new default value. See `man site' for more details. |:+-+-+-+-+-+-+-+");
|
||||
xCAT::MsgUtils->message('I',
|
||||
"+--------------------------------------------------------------+:|W|A|R|N|I|N|G|");
|
||||
xCAT::MsgUtils->message('I',
|
||||
" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::+-+-+-+-+-+-+-+");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1548,7 +1548,10 @@ until ($quit) {
|
||||
|
||||
populate_site_hash();
|
||||
my %extrasslargs;
|
||||
|
||||
if ($::XCATSITEVALS{xcatsslversion}) { $extrasslargs{SSL_version} = $::XCATSITEVALS{xcatsslversion}; }
|
||||
$extrasslargs{SSL_version} = "SSLv23:!SSLv2:!SSLv3:!TLSv1" unless length $extrasslargs{SSL_version};
|
||||
|
||||
if ($::XCATSITEVALS{xcatsslciphers}) { $extrasslargs{SSL_cipher_list} = $::XCATSITEVALS{xcatsslciphers}; }
|
||||
use Data::Dumper;
|
||||
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
# This is mostly being used for generation of certificate requests.
|
||||
#
|
||||
|
||||
# Note that you can include other files from the main configuration
|
||||
# file using the .include directive.
|
||||
#.include filename
|
||||
|
||||
# This definition stops the following lines choking if HOME isn't
|
||||
# defined.
|
||||
HOME = .
|
||||
RANDFILE = $ENV::HOME/.rnd
|
||||
|
||||
# Extra OBJECT IDENTIFIER info:
|
||||
#oid_file = $ENV::HOME/.oid
|
||||
@@ -21,12 +24,17 @@ oid_section = new_oids
|
||||
|
||||
[ new_oids ]
|
||||
|
||||
# We can add new OIDs in here for use by 'ca' and 'req'.
|
||||
# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
|
||||
# Add a simple OID like this:
|
||||
# testoid1=1.2.3.4
|
||||
# Or use config file substitution like this:
|
||||
# testoid2=${testoid1}.5.6
|
||||
|
||||
# Policies used by the TSA examples.
|
||||
#tsa_policy1 = 1.2.3.4.1
|
||||
#tsa_policy2 = 1.2.3.4.5.6
|
||||
#tsa_policy3 = 1.2.3.4.5.7
|
||||
|
||||
####################################################################
|
||||
[ ca ]
|
||||
default_ca = CA_default # The default ca section
|
||||
@@ -37,7 +45,7 @@ default_ca = CA_default # The default ca section
|
||||
dir = ##XCATCADIR## # Where everything is kept
|
||||
certs = $dir/certs # Where the issued certs are kept
|
||||
crl_dir = $dir/crl # Where the issued crl are kept
|
||||
database = $dir/index # database index file.
|
||||
database = $dir/index # database index file.
|
||||
#unique_subject = no # Set to 'no' to allow creation of
|
||||
# several ctificates with same subject.
|
||||
new_certs_dir = $dir/certs # default place for new certs.
|
||||
@@ -47,10 +55,9 @@ serial = $dir/serial # The current serial number
|
||||
crlnumber = $dir/crlnumber # the current crl number
|
||||
# must be commented out to leave a V1 CRL
|
||||
crl = $dir/crl.pem # The current CRL
|
||||
private_key = $dir/private/ca-key.pem # The private key
|
||||
RANDFILE = $dir/private/.rand # private random number file
|
||||
private_key = $dir/private/ca-key.pem # The private key
|
||||
|
||||
x509_extensions = usr_cert # The extentions to add to the cert
|
||||
x509_extensions = usr_cert # The extensions to add to the cert
|
||||
|
||||
# Comment out the following two lines for the "traditional"
|
||||
# (and highly broken) format.
|
||||
@@ -67,7 +74,7 @@ cert_opt = ca_default # Certificate field options
|
||||
|
||||
default_days = 7300 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = sha1 # which md to use.
|
||||
default_md = sha384 # which md to use.
|
||||
preserve = no # keep passed DN ordering
|
||||
|
||||
# A few difference way of specifying how similar the request should look
|
||||
@@ -102,7 +109,7 @@ default_bits = 2048
|
||||
default_keyfile = private/ca-key.pem
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
x509_extensions = v3_ca # The extensions to add to the self signed cert
|
||||
|
||||
# Passwords for private keys if not present they will be prompted for
|
||||
# input_password = secret
|
||||
@@ -110,13 +117,12 @@ x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString.
|
||||
# utf8only: only UTF8Strings.
|
||||
# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
|
||||
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
|
||||
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
|
||||
# so use this option with caution!
|
||||
string_mask = nombstr
|
||||
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
|
||||
string_mask = utf8only
|
||||
|
||||
# req_extensions = v3_req # The extensions to add to a certificate request
|
||||
|
||||
@@ -141,7 +147,7 @@ string_mask = nombstr
|
||||
#organizationalUnitName = Organizational Unit Name (eg, section)
|
||||
#organizationalUnitName_default =
|
||||
|
||||
commonName = Common Name (eg, YOUR name)
|
||||
commonName = Common Name (e.g. server FQDN or YOUR name)
|
||||
commonName_max = 64
|
||||
|
||||
#emailAddress = Email Address
|
||||
@@ -218,6 +224,9 @@ authorityKeyIdentifier=keyid,issuer
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
# This is required for TSA certificates.
|
||||
# extendedKeyUsage = critical,timeStamping
|
||||
|
||||
[ v3_req ]
|
||||
|
||||
# Extensions to add to a certificate request
|
||||
@@ -241,13 +250,9 @@ subjectAltName = @alt_names
|
||||
|
||||
subjectKeyIdentifier=hash
|
||||
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
|
||||
# This is what PKIX recommends but some broken software chokes on critical
|
||||
# extensions.
|
||||
#basicConstraints = critical,CA:true
|
||||
# So we do this instead.
|
||||
basicConstraints = CA:true
|
||||
basicConstraints = critical,CA:true
|
||||
|
||||
# Key usage: this is typical for a CA certificate. However since it will
|
||||
# prevent it being used as an test self-signed certificate it is best
|
||||
@@ -274,7 +279,7 @@ nsCertType = sslCA, emailCA
|
||||
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
|
||||
|
||||
# issuerAltName=issuer:copy
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
authorityKeyIdentifier=keyid:always
|
||||
|
||||
[ proxy_cert_ext ]
|
||||
# These extensions should be added when creating a proxy certificate
|
||||
@@ -307,7 +312,7 @@ nsComment = "OpenSSL Generated Certificate"
|
||||
|
||||
# PKIX recommendations harmless if included in all certificates.
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid,issuer:always
|
||||
authorityKeyIdentifier=keyid,issuer
|
||||
|
||||
# This stuff is for subjectAltName and issuerAltname.
|
||||
# Import the email address.
|
||||
@@ -328,3 +333,35 @@ authorityKeyIdentifier=keyid,issuer:always
|
||||
|
||||
# This really needs to be in place for it to be a proxy certificate.
|
||||
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
|
||||
|
||||
####################################################################
|
||||
[ tsa ]
|
||||
|
||||
default_tsa = tsa_config1 # the default TSA section
|
||||
|
||||
[ tsa_config1 ]
|
||||
|
||||
# These are used by the TSA reply generation only.
|
||||
dir = ./demoCA # TSA root directory
|
||||
serial = $dir/tsaserial # The current serial number (mandatory)
|
||||
crypto_device = builtin # OpenSSL engine to use for signing
|
||||
signer_cert = $dir/tsacert.pem # The TSA signing certificate
|
||||
# (optional)
|
||||
certs = $dir/cacert.pem # Certificate chain to include in reply
|
||||
# (optional)
|
||||
signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
|
||||
signer_digest = sha256 # Signing digest to use. (Optional)
|
||||
default_policy = tsa_policy1 # Policy if request did not specify it
|
||||
# (optional)
|
||||
other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
|
||||
digests = sha1, sha256, sha384, sha512 # Acceptable message digests (mandatory)
|
||||
accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
|
||||
clock_precision_digits = 0 # number of digits after dot. (optional)
|
||||
ordering = yes # Is ordering defined for timestamps?
|
||||
# (optional, default: no)
|
||||
tsa_name = yes # Must the TSA name be included in the reply?
|
||||
# (optional, default: no)
|
||||
ess_cert_id_chain = no # Must the ESS cert id chain be included?
|
||||
# (optional, default: no)
|
||||
ess_cert_id_alg = sha1 # algorithm to compute certificate
|
||||
# identifier (optional, default: sha1)
|
||||
|
||||
@@ -6,3 +6,4 @@ openssh-server
|
||||
rsync
|
||||
util-linux
|
||||
wget
|
||||
python3
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user