diff --git a/Version b/Version index 6d28a11dd..0e7079b69 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.16 +2.16.1 diff --git a/docs/source/advanced/hierarchy/databases/postgres_remove.rst b/docs/source/advanced/hierarchy/databases/postgres_remove.rst index 245018853..ea91a7923 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_remove.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_remove.rst @@ -1,7 +1,9 @@ -Removing ``xcatdb`` from PostgreSQL -=================================== +Removing ``xcatdb`` from PostgreSQL and restoring data into SQLite +================================================================== -To remove ``xcatdb`` completely from the PostgreSQL database: +.. note. If you are using *xCAT Hierarchy (service nodes)* and removing ``xcatdb`` from postgres, hierarchy will no longer work. You will need to configure another database which supports remote database access to continue using the hierarchy feature. :: + +To remove ``xcatdb`` completely from the PostgreSQL database and restore xCAT data into SQLite: #. Run a backup of the database to save any information that is needed: :: @@ -9,7 +11,6 @@ To remove ``xcatdb`` completely from the PostgreSQL database: dumpxCATdb -p ~/xcat-dbback #. Stop the ``xcatd`` daemon on the management node. - **Note:** If you are using *xCAT Hierarchy (service nodes)* and removing ``xcatdb`` from postgres, hierarchy will no longer work. You will need to configure another database which supports remote database access to continue using the hierarchy feature. :: service xcatd stop @@ -29,6 +30,7 @@ To remove ``xcatdb`` completely from the PostgreSQL database: cd /var/lib/pgsql/data rm -rf * + exit #. Move, or remove, the ``/etc/xcat/cfglog`` file as it points xCAT to PostgreSQL. (without this file, xCAT defaults to SQLite): :: diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index 259a748a0..8b13f99df 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -103,5 +103,7 @@ The following table illustrates the cluster being used in this example: chdef -t site clustersite installloc= rsync -auv --exclude 'autoinst' /install r1n01:/ rsync -auv --exclude 'autoinst' /install r2n01:/ - rsync -auv --exclude 'autoinst' /tftpboot r1n01:/ - rsync -auv --exclude 'autoinst' /tftpboot r2n01:/ + rsync -auv /tftpboot r1n01:/ + rsync -auv /tftpboot r2n01:/ + +.. note:: If ``/install`` and ``/tftpboot`` directories local to each Service Node are used and ``mknb`` command is executed to generate a diskless network boot image with custom changes, it will not be automatically copied to the Service Node. Make sure to run the above ``rsync`` commands after executing the ``mknb``. Verify ``/tftpboot/xcat`` directory on Service node contains ``genesis.kernel.`` and ``genesis.fs..gz`` files. diff --git a/docs/source/advanced/networks/getadapter.rst b/docs/source/advanced/networks/getadapter.rst index b3aa71fd8..b7fdfda1e 100644 --- a/docs/source/advanced/networks/getadapter.rst +++ b/docs/source/advanced/networks/getadapter.rst @@ -12,11 +12,11 @@ information to help customer configure the network. How to use getadapter ----------------------- -Set the chian table to run ``getadapter`` script :: +Set the chain table to run ``getadapter`` script :: chdef chain="runcmd=getadapter" -After the discovery completed, the column ``nicsadapter`` of ```nics`` table is +After the discovery completed, the column ``nicsadapter`` of ``nics`` table is updated. View result with ``lsdef`` command :: diff --git a/docs/source/advanced/networks/index.rst b/docs/source/advanced/networks/index.rst index e75893567..fd503fe0e 100644 --- a/docs/source/advanced/networks/index.rst +++ b/docs/source/advanced/networks/index.rst @@ -8,3 +8,4 @@ Networking onie_switches/index.rst switchdiscover/index.rst infiniband/index.rst + getadapter.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 9ea646c4c..df334cef4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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.15.2' +release = '2.16.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -103,9 +103,9 @@ exclude_patterns = ['guides/install-guides/common_sections.rst', #'**hamn/setup_ha_mgmt_node_with_shared_data.rst', #'**hamn/setup_xcat_high_available_management_node_in_softlayer.rst', '**hierarchy/databases/postgres_tips.rst', - '**hierarchy/define_and_install_compute_node.rst', + '**hierarchy/define_and_install_compute_node.rst' #'**hierarchy/define_service_node.rst', - '**networks/getadapter.rst' + #'**networks/getadapter.rst' #'**networks/vlan/index.rst', #'**networks/vlan/vlan.rst', #'**license/xcat_corporate_contributor_license_agreement.rst', diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst index cc639b4b0..55bf9daa2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst @@ -166,7 +166,9 @@ Appedix * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/kernel_crash_dump_guide/sect-kdump-config-cli. + * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/system_design_guide/installing-and-configuring-kdump_system-design-guide + #. OS Documentation on dump analysis: - * http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-kdump-crash.htmlRHELdocument + * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s1-kdump-crashdd diff --git a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst index 3626725f1..3481b300d 100644 --- a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst @@ -21,7 +21,7 @@ SYNOPSIS \ **imgexport [-h| -**\ **-help]**\ -\ **imgexport**\ \ *image_name*\ [\ *destination*\ ] [[\ **-e | -**\ **-extra**\ \ *file:dir*\ ] ... ] [\ **-p | -**\ **-postscripts**\ \ *node_name*\ ] [\ **-v | -**\ **-verbose**\ ] +\ **imgexport**\ \ *image_name*\ [\ *destination*\ ] [\ **-e | -**\ **-extra**\ \ *file:dir*\ ] ... ] [\ **-p | -**\ **-postscripts**\ \ *node_name*\ ] [\ **-R | -**\ **-remotehost**\ \ *user@host*\ ] [\ **-v | -**\ **-verbose**\ ] *********** @@ -90,6 +90,12 @@ OPTIONS +\ **-R|-**\ **-remotehost**\ \ *user@host*\ + + Export the image to remote host. Passwordless ssh must be setup to the remote host. + + + \ **-v|-**\ **-verbose**\ Verbose output. @@ -132,7 +138,7 @@ EXAMPLES imgexport foo -foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport if you have a big image to tar up. +foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport, if you have a big image to tar up. 2. To include extra files with your image: diff --git a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst index e813f3377..84decf7fa 100644 --- a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst @@ -21,7 +21,7 @@ SYNOPSIS \ **imgimport [-h|-**\ **-help]**\ -\ **imgimport**\ \ *bundle_file_name*\ [\ **-p | -**\ **-postscripts**\ \ *nodelist*\ ] [\ **-f | -**\ **-profile**\ \ *new_profile*\ ] [\ **-v | -**\ **-verbose**\ ] +\ **imgimport**\ \ *bundle_file_name*\ [\ **-p | -**\ **-postscripts**\ \ *nodelist*\ ] [\ **-f | -**\ **-profile**\ \ *new_profile*\ ] [\ **-R | -**\ **-remotehost**\ \ *user@host*\ ] [\ **-v | -**\ **-verbose**\ ] *********** @@ -109,6 +109,12 @@ OPTIONS +\ **-R|-**\ **-remotehost**\ \ *user@host*\ + + Import the image from remote host. Passwordless ssh must be setup to the remote host. + + + \ **-v|-**\ **-verbose**\ Verbose output. diff --git a/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst b/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst index 6a64febc3..7aa5d849d 100644 --- a/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst +++ b/docs/source/guides/admin-guides/references/man1/pgsqlsetup.1.rst @@ -33,8 +33,8 @@ DESCRIPTION *********** -\ **pgsqlsetup**\ - Sets up the PostgreSQL database for xCAT to use. The pgsqlsetup script is run on the Management Node as root after the PostgreSQL code has been installed. The xcatd daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the xcatd daemon as well as the PostgreSQL daemon. For full information on all the steps that will be done reference -One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password and then there will be no prompt. +\ **pgsqlsetup**\ - Sets up the PostgreSQL database for xCAT to use. The \ **pgsqlsetup**\ script is run on the Management Node as root after the PostgreSQL has been installed. The \ **xcatd**\ daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the \ **xcatd**\ daemon as well as the PostgreSQL daemon. +One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password in order to avoid the prompt. ******* @@ -63,17 +63,17 @@ OPTIONS \ **-i|-**\ **-init**\ - The init option is used to setup an installed PostgreSQL database so that xCAT can use the database. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the PostgreSQL database and restarts the xcatd daemon using the database. - On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init. - To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the -a option. + The \ **-**\ **-init**\ option is used to setup an installed PostgreSQL database so that xCAT can use it. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the \ **xcatd**\ daemon to the PostgreSQL database and restarts the \ **xcatd**\ daemon using the database. + On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the \ **-o**\ option, to run after the init. + To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the \ **-a**\ option. - For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB + For more documentation see: \ **-N|-**\ **-nostart**\ - This option with the -i flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of xcatd will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. + This option with the \ **-i**\ flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of \ **xcatd**\ will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. diff --git a/docs/source/guides/admin-guides/references/man1/replaycons.1.rst b/docs/source/guides/admin-guides/references/man1/replaycons.1.rst index c4b1929b3..0cd788690 100644 --- a/docs/source/guides/admin-guides/references/man1/replaycons.1.rst +++ b/docs/source/guides/admin-guides/references/man1/replaycons.1.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **replaycons**\ [\ *node*\ ] [\ *bps*\ ] [\ *tail_amount*\ ] +\ **replaycons**\ \ *node log file*\ [\ *bps*\ ] [\ *tail_amount*\ ] \ **replaycons**\ [\ **-h**\ | \ **-**\ **-help**\ | \ **-v**\ | \ **-**\ **-version**\ ] @@ -31,9 +31,9 @@ DESCRIPTION The \ **replaycons**\ command reads the console log stored by conserver for this node, and displays it in a way that simulates the original output of the console. Using the \ *bps*\ value, it will throttle -the speed of the output play back. (The conserver logs are stored in /var/log/consoles.) +the speed of the output play back. (The logs are stored in /var/log/consoles.) -For now, replaycons must be run locally on the system on which the console log is stored. This is normally +\ **replaycons**\ must be run locally on the system on which the console log is stored. This is normally that management node, but in a hierarchical cluster will usually be the service node. @@ -51,7 +51,7 @@ OPTIONS \ *tail_amount*\ - The place in the console log file to start play back, specified as the # of lines from the end. + The place in the console log file to start play back, specified as the number of lines from the end. @@ -96,7 +96,7 @@ EXAMPLES .. code-block:: perl - replaycons 19200 2000 + replaycons node1.log 19200 2000 diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 0b64d2314..f21e24c45 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -452,7 +452,7 @@ OPTIONS The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. This is not supported in a hierarchical cluster, that is the node is serviced by a service node. - See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. + See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for required xcat/sudo setup. diff --git a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst index 1bedf8c7f..f34c84a6b 100644 --- a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst @@ -43,7 +43,7 @@ The \ **xdsh**\ command runs commands in parallel on remote nodes and/or the Ma remote shell command for each target specified, and returns the output from all targets, formatted so that command results from all nodes can be managed. -If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the xcatconfig -m option. +If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the \ **xcatconfig -m**\ option. The \ **xdsh**\ command is an xCAT Distributed Shell Utility. \ **COMMAND**\ \ **SPECIFICATION**\ : @@ -176,8 +176,8 @@ the commands executing on the remote targets. Signal 19 (CONT), Signal 17 (STOP), and Signal 18 (TSTP) default to \ **xdsh**\ ; the \ **xdsh**\ command responds normally to these signals, but the signals do not have an effect on remotely executing commands. Other -signals are caught by \ **xdsh**\ and have their default effects on the \ **xdsh**\ -command; all current child processes, through propagation to remotely +signals are caught by \ **xdsh**\ and have their default effects on the \ **xdsh**\ command; +all current child processes, through propagation to remotely running commands, are terminated (SIGTERM). @@ -195,13 +195,13 @@ running commands, are terminated (SIGTERM). \ **-c | -**\ **-cleanup**\ - This flag will have xdsh remove all files from the subdirectories of the - the directory on the servicenodes, where xdcp stages the copy to the + This flag will have \ **xdsh**\ remove all files from the subdirectories of the + the directory on the service nodes, where \ **xdcp**\ stages the copy to the compute nodes as defined in the site table SNsyncfiledir and nodesyncfiledir attribute, when the target is a service node. It can also be used to remove the nodesyncfiledir directory on the compute - nodes, which keeps the backup copies of files for the xdcp APPEND function + nodes, which keeps the backup copies of files for the \ **xdcp**\ APPEND function support, if a compute node is the target. @@ -234,7 +234,7 @@ running commands, are terminated (SIGTERM). for Ethernet switches and and IB switches under \ */opt/xcat/share/xcat/devicetype*\ directory. If you want to overwrite any of the configuration files, copy them to \ */var/opt/xcat/*\ - directory and cutomize. + directory and customize. For example, \ *base/IBSwitch/Qlogic/config*\ is the configuration file location if devicetype is specified as IBSwitch::Qlogic. xCAT will first search config file using \ */var/opt/xcat/*\ as the base. @@ -258,10 +258,10 @@ running commands, are terminated (SIGTERM). \ **-i | -**\ **-rootimg**\ \ *install image*\ For Linux, Specifies the path to the install image on the local node. - For AIX, specifies the name of the osimage on the local node. Run lsnim + For AIX, specifies the name of the osimage on the local node. Run \ **lsnim**\ for valid names. - xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the - install image. No other xdsh flags, environment variables apply with + \ **xdsh**\ will \ **chroot**\ (\ **xcatchroot**\ for AIX) to this path and run the \ **xdsh**\ command against the + install image. No other \ **xdsh**\ flags, environment variables apply with this input. A noderange is not accepted. Only runs on the local host, normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that \ **xdsh**\ hangs. @@ -277,9 +277,9 @@ running commands, are terminated (SIGTERM). The userid must have the same uid, gid and password as the userid on the node where the keys will be setup. - If the current user is root, roots public ssh keys will be put in the + If the current user is root, root's public ssh keys will be put in the authorized_keys\* files under roots .ssh directory on the node(s). - If the current user is non-root, the user must be in the policy table and have credential to run the xdsh command. + If the current user is non-root, the user must be in the policy table and have credential to run the \ **xdsh**\ command. The non-root users public ssh keys and root's public ssh keys will be put in the authorized_keys\* files under the non-root users .ssh directory on the node(s). Other device types, such as IB switch, are also supported. The @@ -344,8 +344,8 @@ running commands, are terminated (SIGTERM). \ **-s | -**\ **-stream**\ Specifies that output is returned as it becomes available - from each target, instead of waiting for the \ *command_list*\ - to be completed on a target before returning output. + from each target, instead of waiting for the \ *command_list*\ to + be completed on a target before returning output. @@ -358,17 +358,17 @@ running commands, are terminated (SIGTERM). \ **-**\ **-sudo**\ - Adding the \ **-**\ **-sudo**\ flag to the xdsh command will have xdsh run sudo before + Adding the \ **-**\ **-sudo**\ flag to the \ **xdsh**\ command will have \ **xdsh**\ run \ **sudo**\ before running the command. This is particular useful when using the \ **-e**\ option. This is required when you input \ **-l**\ with a non-root user id and want that id to be able to run as root on the node. The non-root userid will must be previously defined as an xCAT user, see process for defining non-root ids in - xCAT and setting up for using xdsh. The userid sudo setup will have + xCAT and setting up for using \ **xdsh**\ . The userid \ **sudo**\ setup will have to be done by the admin on the node. This includes, allowing all commands that - you would like to run with xdsh by using visudo to edit the /etc/sudoers file. - You must disabl ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". - See the document Granting_Users_xCAT_privileges for sudo setup requirements. - This is not supported in a hierarical cluster, that is the nodes are serviced by servicenodes. + you would like to run with \ **xdsh**\ by using \ **visudo**\ to edit the /etc/sudoers file. + You must disable ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". + See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for \ **sudo**\ setup requirements. + This is not supported in a hierarchical cluster, where the nodes are serviced by service nodes. @@ -417,7 +417,7 @@ running commands, are terminated (SIGTERM). string, all \ **xdsh**\ environment variables will be ignored. This option is useful when running \ **xdsh**\ from within other scripts when you don't want the user's environment affecting - the behavior of xdsh. + the behavior of \ **xdsh**\ . @@ -510,7 +510,7 @@ running commands, are terminated (SIGTERM). \ **DSH_REMOTE_PASSWORD**\ If \ **DSH_REMOTE_PASSWORD**\ is set to the password of the - userid (usually root) that will ssh to the node, then when + userid (usually root) that will \ **ssh**\ to the node, then when you use the \ **-K**\ flag, you will not be prompted for a password. @@ -563,7 +563,7 @@ error is displayed and execution is bypassed for a remote target if password prompting occurs, or if either authorization or authentication to the remote target fails. Security configurations as they pertain to the remote environment and remote shell command are -userdefined. +user defined. ******************* @@ -571,7 +571,7 @@ userdefined. ******************* -The \ **xdsh**\ command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. +The \ **xdsh**\ command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal \ **dsh**\ errors occur or the remote shell commands do not complete successfully, the \ **dsh**\ command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. **************** @@ -600,7 +600,7 @@ The \ **xdsh**\ command exit code is 0 if the command executed without errors a -3. To run the \ **ps**\ command on node targets \ **node1**\ and run the remote command with the -v and -t flag, enter: +3. To run the \ **ps**\ command on node targets \ **node1**\ and run the remote command with the \ **-v**\ and \ **-t**\ flag, enter: .. code-block:: perl @@ -621,7 +621,7 @@ context on several node targets, with a fanout of \ **1**\ , enter: -5. To run the ps command on node1 and ignore all the dsh +5. To run the \ **ps**\ command on node1 and ignore all the \ **dsh**\ environment variable except the DSH_NODE_OPTS, enter: @@ -632,7 +632,7 @@ environment variable except the DSH_NODE_OPTS, enter: -6. To run on Linux, the xdsh command "rpm -qa | grep xCAT" +6. To run on Linux, the \ **xdsh**\ command \ **rpm -qa | grep xCAT**\ on the service node fedora9 diskless image, enter: @@ -643,7 +643,7 @@ on the service node fedora9 diskless image, enter: -7. To run on AIX, the xdsh command "lslpp -l | grep bos" on the NIM 611dskls spot, enter: +7. To run on AIX, the \ **xdsh**\ command \ **lslpp -l | grep bos**\ on the NIM 611dskls spot, enter: .. code-block:: perl @@ -653,7 +653,7 @@ on the service node fedora9 diskless image, enter: -8. To cleanup the servicenode directory that stages the copy of files to the nodes, enter: +8. To cleanup the service node directory that stages the copy of files to the nodes, enter: .. code-block:: perl @@ -722,7 +722,7 @@ on the service node fedora9 diskless image, enter: -13. To run \ **xdsh**\ with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: +13. To run \ **xdsh**\ with the non-root userid "user1" that has been setup as an xCAT userid and with \ **sudo**\ on node1 and node2 to run as root, do the following, see xCAT doc https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst b/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst index efab1abda..5fbe0cf3a 100644 --- a/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst @@ -27,8 +27,8 @@ DESCRIPTION *********** -The \ **xdshbak**\ command formats output from the \ **xdsh**\ command. The \ **xdshbak**\ -command takes, as input, lines in the following format: +The \ **xdshbak**\ command formats output from the \ **xdsh**\ command. +The \ **xdshbak**\ command takes, as input, lines in the following format: .. code-block:: perl @@ -73,11 +73,11 @@ When output is displayed from more than one node in collapsed form, the host names are displayed alphabetically. When output is not collapsed, output is displayed sorted alphabetically by host name. -If the \ **-q**\ quiet flag is not set then \ **xdshbak**\ -command writes "." for each 1000 lines of output processed (to show progress), +If the \ **-q**\ quiet flag is not set then \ **xdshbak**\ command +writes "." for each 1000 lines of output processed (to show progress), since it won't display the output until it has processed all of it. -If the \ **-x**\ flag is specified, the extra header lines that xdshbak normally +If the \ **-x**\ flag is specified, the extra header lines that \ **xdshbak**\ normally displays for each node will be omitted, and the hostname at the beginning of each line is not stripped off, but \ **xdshbak**\ still sorts the output by hostname for easier viewing: @@ -128,9 +128,9 @@ OPTIONS \ **-x**\ - Omit the extra header lines that xdshbak normally displays for + Omit the extra header lines that \ **xdshbak**\ normally displays for each node. This provides - more compact output, but xdshbak still sorts the output by + more compact output, but \ **xdshbak**\ still sorts the output by node name for easier viewing. This option should not be used with \ **-c**\ . diff --git a/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst b/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst index 0e1b13487..3c47c1837 100644 --- a/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdshcoll.1.rst @@ -11,7 +11,7 @@ xdshcoll.1 ************ -\ **xdshcoll**\ - Formats and consolidates the output of the \ **xdsh,sinv**\ commands. +\ **xdshcoll**\ - Formats and consolidates the output of the \ **xdsh, sinv**\ commands. **************** @@ -27,7 +27,7 @@ xdshcoll.1 ******************* -The \ **xdshcoll**\ command formats and consolidates output from the \ **xdsh,sinv**\ command. The \ **xdshcoll**\ +The \ **xdshcoll**\ command formats and consolidates output from the \ **xdsh, sinv**\ commands. The \ **xdshcoll**\ command takes, as input, lines in the following format: host_name: line of output from remote command @@ -75,12 +75,12 @@ is identical: 1. To display the results of a command issued on several nodes, in -the format used in the Description, enter: +the format shown in the Description, enter: .. code-block:: perl - xdsh node1,node2,node3 cat /etc/passwd> | B:" the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type. - + +\* If the header name is "default-:" the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type. -\* - - Default stanzas can be specified multiple times and at any point in a stanza file. The values apply to all definitions following the default stanzas in a file. The default values are cumulative; a default attribute value will remain set until it is explicitly unset or changed. - + +\* Default stanzas can be specified multiple times and at any point in a stanza file. The values apply to all definitions following the default stanzas in a file. The default values are cumulative; a default attribute value will remain set until it is explicitly unset or changed. -\* - - To turn off a default value, use another default stanza to set the attribute to have no value using a blank space. - + +\* To turn off a default value, use another default stanza to set the attribute to have no value using a blank space. -\* - - When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set. - + +\* When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set. + The format of a stanza file should look similar to the following. diff --git a/docs/source/overview/_files/2.15.x.csv b/docs/source/overview/_files/2.15.x.csv index 6002574dc..4f4fca053 100644 --- a/docs/source/overview/_files/2.15.x.csv +++ b/docs/source/overview/_files/2.15.x.csv @@ -1,5 +1,3 @@ Version,Release Date,New OS Supported,Release Notes - -2.15.1,2020-03-06,"RHEL 8.1,RHEL 7.7,SLES 15.0",`2.15.1 Release Notes `_ +2.15.1,2020-03-06,"RHEL 7.7",`2.15.1 Release Notes `_ 2.15.0,2019-11-11,"RHEL 8.0",`2.15.0 Release Notes `_ - diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index 004364bfb..ae69165bc 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,4 +1,3 @@ Version,Release Date,New OS Supported,Release Notes - -2.16.0,2020-06-17,,`2.16.0 Release Notes `_ - +2.16.1,2020-11-06,"RHEL 8.2",`2.16.1 Release Notes `_ +2.16.0,2020-06-17,"RHEL 8.1,SLES 15",`2.16.0 Release Notes `_ diff --git a/docs/source/troubleshooting/index.rst b/docs/source/troubleshooting/index.rst index d8f69a11b..e09ac69de 100644 --- a/docs/source/troubleshooting/index.rst +++ b/docs/source/troubleshooting/index.rst @@ -1,7 +1,9 @@ Troubleshooting =============== -This chapter introduces the methods of troubleshooting a xCAT cluster. It includes the following parts. +This chapter introduces the methods of debugging and troubleshooting a xCAT cluster. `General xCAT troubleshooting and debugging suggestions `_ + +Additional recomendations: .. toctree:: :maxdepth: 2 diff --git a/xCAT-client/bin/pgsqlsetup b/xCAT-client/bin/pgsqlsetup index b5b85b611..f6cd6c126 100755 --- a/xCAT-client/bin/pgsqlsetup +++ b/xCAT-client/bin/pgsqlsetup @@ -318,7 +318,7 @@ if (($INIT) && ($xcatrunningpgsql == 0)) # if that does not exist use resolved hostname # double check site.master for resolution my $sitefile = "$::backupdir/site.csv"; - my $cmd = "grep master $sitefile"; + my $cmd = "grep \"master $sitefile"; my @output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC == 0) # entry in site table { diff --git a/xCAT-client/pods/man1/imgexport.1.pod b/xCAT-client/pods/man1/imgexport.1.pod index 46c165a1a..affd64d1e 100644 --- a/xCAT-client/pods/man1/imgexport.1.pod +++ b/xCAT-client/pods/man1/imgexport.1.pod @@ -6,7 +6,7 @@ B - Exports an xCAT image. B -B I [I] [[B<-e>|B<--extra> I] ... ] [B<-p>|B<--postscripts> I] [B<-v>|B<--verbose>] +B I [I] [B<-e>|B<--extra> I] ... ] [B<-p>|B<--postscripts> I] [B<-R>|B<--remotehost> I] [B<-v>|B<--verbose>] =head1 DESCRIPTION @@ -65,6 +65,10 @@ Display usage message. Get the names of the postscripts and postbootscripts for the given node and pack them into the image. +=item B<-R|--remotehost> I + +Export the image to remote host. Passwordless ssh must be setup to the remote host. + =item B<-v|--verbose> Verbose output. @@ -92,7 +96,7 @@ The output bundle file name. imgexport foo -foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport if you have a big image to tar up. +foo.tgz will be built in the current working directory. Make sure that you have enough space in the directory that you are in to run imgexport, if you have a big image to tar up. 2. To include extra files with your image: diff --git a/xCAT-client/pods/man1/imgimport.1.pod b/xCAT-client/pods/man1/imgimport.1.pod index 1c1891485..e49df3ec8 100644 --- a/xCAT-client/pods/man1/imgimport.1.pod +++ b/xCAT-client/pods/man1/imgimport.1.pod @@ -6,7 +6,7 @@ B - Imports an xCAT image or configuration file into the xCAT tables B -B I [B<-p>|B<--postscripts> I] [B<-f>|B<--profile> I] [B<-v>|B<--verbose>] +B I [B<-p>|B<--postscripts> I] [B<-f>|B<--profile> I] [B<-R>|B<--remotehost> I] [B<-v>|B<--verbose>] =head1 DESCRIPTION @@ -82,6 +82,10 @@ Display usage message. Import the postscripts. The postscripts contained in the image will be set in the postscripts table for I. +=item B<-R|--remotehost> I + +Import the image from remote host. Passwordless ssh must be setup to the remote host. + =item B<-v|--verbose> Verbose output. diff --git a/xCAT-client/pods/man1/pgsqlsetup.1.pod b/xCAT-client/pods/man1/pgsqlsetup.1.pod index 20a607912..095abad99 100644 --- a/xCAT-client/pods/man1/pgsqlsetup.1.pod +++ b/xCAT-client/pods/man1/pgsqlsetup.1.pod @@ -15,8 +15,8 @@ B {B<-o> | B<--setupODBC>} [B<-V> | B<--verbose>] =head1 DESCRIPTION -B - Sets up the PostgreSQL database for xCAT to use. The pgsqlsetup script is run on the Management Node as root after the PostgreSQL code has been installed. The xcatd daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the xcatd daemon as well as the PostgreSQL daemon. For full information on all the steps that will be done reference -One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password and then there will be no prompt. +B - Sets up the PostgreSQL database for xCAT to use. The B script is run on the Management Node as root after the PostgreSQL has been installed. The B daemon will be stopped during migration. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to PostgreSQL and restarting the B daemon as well as the PostgreSQL daemon. +One password must be supplied for the setup, a password for the xcatadm unix id and the same password for the xcatadm database id. The password will be prompted for interactively or you can set the XCATPGPW environment variable to the password in order to avoid the prompt. =head1 OPTIONS @@ -36,15 +36,15 @@ Displays verbose messages. =item B<-i|--init> -The init option is used to setup an installed PostgreSQL database so that xCAT can use the database. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the PostgreSQL database and restarts the xcatd daemon using the database. -On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init. -To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the -a option. +The B<--init> option is used to setup an installed PostgreSQL database so that xCAT can use it. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the B daemon to the PostgreSQL database and restarts the B daemon using the database. +On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the B<-o> option, to run after the init. +To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the B<-a> option. -For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB +For more documentation see: =item B<-N|--nostart> -This option with the -i flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of xcatd will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. +This option with the B<-i> flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of B will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install. =item B<-l|--listen> I
diff --git a/xCAT-client/pods/man1/replaycons.1.pod b/xCAT-client/pods/man1/replaycons.1.pod index 97a7e81cf..e41a5c07d 100644 --- a/xCAT-client/pods/man1/replaycons.1.pod +++ b/xCAT-client/pods/man1/replaycons.1.pod @@ -5,7 +5,7 @@ B - replay the console output for a node =head1 SYNOPSIS -B [I] [I] [I] +B I [I] [I] B [B<-h> | B<--help> | B<-v> | B<--version>] @@ -14,9 +14,9 @@ B [B<-h> | B<--help> | B<-v> | B<--version>] The B command reads the console log stored by conserver for this node, and displays it in a way that simulates the original output of the console. Using the I value, it will throttle -the speed of the output play back. (The conserver logs are stored in /var/log/consoles.) +the speed of the output play back. (The logs are stored in /var/log/consoles.) -For now, replaycons must be run locally on the system on which the console log is stored. This is normally +B must be run locally on the system on which the console log is stored. This is normally that management node, but in a hierarchical cluster will usually be the service node. @@ -30,7 +30,7 @@ The display rate to use to play back the console output. Default is 19200. =item I -The place in the console log file to start play back, specified as the # of lines from the end. +The place in the console log file to start play back, specified as the number of lines from the end. =item B<-v|--version> @@ -64,7 +64,7 @@ An error has occurred. To replay the console for node1 at the default rate, starting 2000 lines from the end: - replaycons 19200 2000 + replaycons node1.log 19200 2000 =back diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index a35d07080..8bcb96932 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -351,7 +351,7 @@ AIX and Linux and updating software (-S) for Linux only. The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. This is not supported in a hierarchical cluster, that is the node is serviced by a service node. -See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. +See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for required xcat/sudo setup. =item B<-P|--scripts> diff --git a/xCAT-client/pods/man1/xdsh.1.pod b/xCAT-client/pods/man1/xdsh.1.pod index c5572ca91..190884232 100644 --- a/xCAT-client/pods/man1/xdsh.1.pod +++ b/xCAT-client/pods/man1/xdsh.1.pod @@ -24,7 +24,7 @@ The B command runs commands in parallel on remote nodes and/or the Managem remote shell command for each target specified, and returns the output from all targets, formatted so that command results from all nodes can be managed. -If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the xcatconfig -m option. +If the command is to be executed on the Management Node, it does not use a remote shell command, but uses the local OS copy or shell command. The Management Node must be defined in the xCAT database. The best way to do this is to use the B option. The B command is an xCAT Distributed Shell Utility. @@ -159,8 +159,8 @@ the commands executing on the remote targets. Signal 19 (CONT), Signal 17 (STOP), and Signal 18 (TSTP) default to B; the B command responds normally to these signals, but the signals do not have an effect on remotely executing commands. Other -signals are caught by B and have their default effects on the B -command; all current child processes, through propagation to remotely +signals are caught by B and have their default effects on the B command; +all current child processes, through propagation to remotely running commands, are terminated (SIGTERM). =head1 B @@ -173,13 +173,13 @@ Runs in bypass mode, use if the xcatd daemon is hung. =item B<-c>|B<--cleanup> -This flag will have xdsh remove all files from the subdirectories of the -the directory on the servicenodes, where xdcp stages the copy to the +This flag will have B remove all files from the subdirectories of the +the directory on the service nodes, where B stages the copy to the compute nodes as defined in the site table SNsyncfiledir and nodesyncfiledir attribute, when the target is a service node. It can also be used to remove the nodesyncfiledir directory on the compute -nodes, which keeps the backup copies of files for the xdcp APPEND function +nodes, which keeps the backup copies of files for the B APPEND function support, if a compute node is the target. =item B<-e>|B<--execute> @@ -206,7 +206,7 @@ xCAT ships some default configuration files for Ethernet switches and and IB switches under I directory. If you want to overwrite any of the configuration files, copy them to I -directory and cutomize. +directory and customize. For example, I is the configuration file location if devicetype is specified as IBSwitch::Qlogic. xCAT will first search config file using I as the base. @@ -225,10 +225,10 @@ Displays usage information. =item B<-i>|B<--rootimg> I For Linux, Specifies the path to the install image on the local node. -For AIX, specifies the name of the osimage on the local node. Run lsnim +For AIX, specifies the name of the osimage on the local node. Run B for valid names. -xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the -install image. No other xdsh flags, environment variables apply with +B will B (B for AIX) to this path and run the B command against the +install image. No other B flags, environment variables apply with this input. A noderange is not accepted. Only runs on the local host, normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that B hangs. @@ -240,9 +240,9 @@ Set up the SSH keys for the user running the command to the specified node list. The userid must have the same uid, gid and password as the userid on the node where the keys will be setup. -If the current user is root, roots public ssh keys will be put in the +If the current user is root, root's public ssh keys will be put in the authorized_keys* files under roots .ssh directory on the node(s). -If the current user is non-root, the user must be in the policy table and have credential to run the xdsh command. +If the current user is non-root, the user must be in the policy table and have credential to run the B command. The non-root users public ssh keys and root's public ssh keys will be put in the authorized_keys* files under the non-root users .ssh directory on the node(s). Other device types, such as IB switch, are also supported. The @@ -293,8 +293,8 @@ for remote command execution on node targets. =item B<-s>|B<--stream> Specifies that output is returned as it becomes available -from each target, instead of waiting for the I -to be completed on a target before returning output. +from each target, instead of waiting for the I to +be completed on a target before returning output. =item B<-S>|B<--syntax> {B|B} @@ -303,17 +303,17 @@ If not specified, the B syntax is used. =item B<--sudo> -Adding the B<--sudo> flag to the xdsh command will have xdsh run sudo before +Adding the B<--sudo> flag to the B command will have B run B before running the command. This is particular useful when using the B<-e> option. This is required when you input B<-l> with a non-root user id and want that id to be able to run as root on the node. The non-root userid will must be previously defined as an xCAT user, see process for defining non-root ids in -xCAT and setting up for using xdsh. The userid sudo setup will have +xCAT and setting up for using B. The userid B setup will have to be done by the admin on the node. This includes, allowing all commands that -you would like to run with xdsh by using visudo to edit the /etc/sudoers file. -You must disabl ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". -See the document Granting_Users_xCAT_privileges for sudo setup requirements. -This is not supported in a hierarical cluster, that is the nodes are serviced by servicenodes. +you would like to run with B by using B to edit the /etc/sudoers file. +You must disable ssh tty requirements by commenting out or removing this line in the /etc/sudoes file "#Defaults requiretty". +See the document https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges for B setup requirements. +This is not supported in a hierarchical cluster, where the nodes are serviced by service nodes. =item B<-t>|B<--timeout> I @@ -352,7 +352,7 @@ argument to this option, or the argument is an empty string, all B environment variables will be ignored. This option is useful when running B from within other scripts when you don't want the user's environment affecting -the behavior of xdsh. +the behavior of B. =item B<-z>|B<--exit-status> @@ -428,7 +428,7 @@ remote I is used. =item B If B is set to the password of the -userid (usually root) that will ssh to the node, then when +userid (usually root) that will B to the node, then when you use the B<-K> flag, you will not be prompted for a password. @@ -468,12 +468,12 @@ error is displayed and execution is bypassed for a remote target if password prompting occurs, or if either authorization or authentication to the remote target fails. Security configurations as they pertain to the remote environment and remote shell command are -userdefined. +user defined. =head1 B -The B command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. +The B command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal B errors occur or the remote shell commands do not complete successfully, the B command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0. =head1 B @@ -491,7 +491,7 @@ To run the B command on node targets B and B, enter: xdsh node1,node2 "ps -ef" =item 3. -To run the B command on node targets B and run the remote command with the -v and -t flag, enter: +To run the B command on node targets B and run the remote command with the B<-v> and B<-t> flag, enter: xdsh node1,node2 -o "-v -t" ps @@ -502,24 +502,24 @@ context on several node targets, with a fanout of B<1>, enter: xdsh node1,node2 -f 1 -e myfile =item 5. -To run the ps command on node1 and ignore all the dsh +To run the B command on node1 and ignore all the B environment variable except the DSH_NODE_OPTS, enter: xdsh node1 -X `DSH_NODE_OPTS' ps =item 6. -To run on Linux, the xdsh command "rpm -qa | grep xCAT" +To run on Linux, the B command B on the service node fedora9 diskless image, enter: xdsh -i /install/netboot/fedora9/x86_64/service/rootimg "rpm -qa | grep xCAT" =item 7. -To run on AIX, the xdsh command "lslpp -l | grep bos" on the NIM 611dskls spot, enter: +To run on AIX, the B command B on the NIM 611dskls spot, enter: xdsh -i 611dskls "/usr/bin/lslpp -l | grep bos" =item 8. -To cleanup the servicenode directory that stages the copy of files to the nodes, enter: +To cleanup the service node directory that stages the copy of files to the nodes, enter: xdsh servicenoderange -c @@ -559,7 +559,7 @@ If it is for Telnet, add I in front of the user name: I. dsh myswitch --devicetype EthSwitch::BNT 'enable;configure terminal;vlan 3;end;show vlan' =item 13. -To run B with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: +To run B with the non-root userid "user1" that has been setup as an xCAT userid and with B on node1 and node2 to run as root, do the following, see xCAT doc https://xcat-docs.readthedocs.io/en/stable/advanced/security/security.html#granting-users-xcat-privileges: xdsh node1,node2 --sudo -l user1 "cat /etc/passwd" diff --git a/xCAT-client/pods/man1/xdshbak.1.pod b/xCAT-client/pods/man1/xdshbak.1.pod index c315b2274..a308ba862 100644 --- a/xCAT-client/pods/man1/xdshbak.1.pod +++ b/xCAT-client/pods/man1/xdshbak.1.pod @@ -8,8 +8,8 @@ B [B<-c> | B<-x> [ B<-b> ] | B<-h> | B<-q>] =head1 DESCRIPTION -The B command formats output from the B command. The B -command takes, as input, lines in the following format: +The B command formats output from the B command. +The B command takes, as input, lines in the following format: host_name: line of output from remote command @@ -46,11 +46,11 @@ When output is displayed from more than one node in collapsed form, the host names are displayed alphabetically. When output is not collapsed, output is displayed sorted alphabetically by host name. -If the B<-q> quiet flag is not set then B -command writes "." for each 1000 lines of output processed (to show progress), +If the B<-q> quiet flag is not set then B command +writes "." for each 1000 lines of output processed (to show progress), since it won't display the output until it has processed all of it. -If the B<-x> flag is specified, the extra header lines that xdshbak normally +If the B<-x> flag is specified, the extra header lines that B normally displays for each node will be omitted, and the hostname at the beginning of each line is not stripped off, but B still sorts the output by hostname for easier viewing: @@ -87,9 +87,9 @@ and displayed only once. =item B<-x> -Omit the extra header lines that xdshbak normally displays for +Omit the extra header lines that B normally displays for each node. This provides -more compact output, but xdshbak still sorts the output by +more compact output, but B still sorts the output by node name for easier viewing. This option should not be used with B<-c>. diff --git a/xCAT-client/pods/man1/xdshcoll.1.pod b/xCAT-client/pods/man1/xdshcoll.1.pod index a1209ec58..ae6e9e907 100644 --- a/xCAT-client/pods/man1/xdshcoll.1.pod +++ b/xCAT-client/pods/man1/xdshcoll.1.pod @@ -1,6 +1,6 @@ =head1 B -B - Formats and consolidates the output of the B commands. +B - Formats and consolidates the output of the B commands. =head1 B @@ -8,7 +8,7 @@ B =head1 B -The B command formats and consolidates output from the B command. The B +The B command formats and consolidates output from the B commands. The B command takes, as input, lines in the following format: host_name: line of output from remote command @@ -51,9 +51,9 @@ is identical: =item 1. To display the results of a command issued on several nodes, in -the format used in the Description, enter: +the format shown in the Description, enter: - xdsh node1,node2,node3 cat /etc/passwd> | B - Format of a stanza file that can be used with xCAT data obje =head1 DESCRIPTION -A stanza file contains information that can be used to create xCAT data object definitions. A stanza file can be used as input to several xCAT commands. The stanza file contains one or more individual stanzas that provide information for individual object definitions. The following rules must be followed when creating a stanza file: +A stanza file contains information that can be used to create xCAT data object definitions. A stanza file can be used as input to several xCAT commands. The stanza file contains one or more individual stanzas that provide information for individual object definitions as well as an optional default definition that applies to all subsequent object definitions of that type. + +The following rules must be followed when creating a stanza file: =over 2 =item * - An object stanza header consists of the object name followed by a colon, (":"). =item * - Attribute lines must take the form of Attribute=Value. =item * - Attribute name might include the character dot ("."), like passwd.HMC and nicips.eth0. =item * - Only one stanza can exist for each object name. =item * - All stanzas except for default stanzas must have a value set for "objtype". =item * - Comments beginning with the "#" pound sign may be added to the file. A comment must be on a separate line. =item * - When parsing the file, tab characters and spaces are ignored. =item * - Each line of the file can have no more than one header or attribute definition. =item * - If the header name is "default-:" the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type. =item * - Default stanzas can be specified multiple times and at any point in a stanza file. The values apply to all definitions following the default stanzas in a file. The default values are cumulative; a default attribute value will remain set until it is explicitly unset or changed. =item * - To turn off a default value, use another default stanza to set the attribute to have no value using a blank space. =item * - When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set. =back diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index 5b44dabcf..cd64489bd 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -25,6 +25,7 @@ BuildArch: noarch %endif Requires: perl-xCAT = 4:%{version}-%{release} +Requires: cpio # fping or nmap is needed by pping (in case xCAT-client is installed by itself on a remote client) %ifos linux diff --git a/xCAT-probe/subcmds/clusterstatus b/xCAT-probe/subcmds/clusterstatus index d847ff771..f04955c3a 100755 --- a/xCAT-probe/subcmds/clusterstatus +++ b/xCAT-probe/subcmds/clusterstatus @@ -45,6 +45,8 @@ my %type_nodesnum = (); # matching --> matched --> installing --> booting --> booted # matching --> matched --> booting --> installing --> xxx --> booted # The terminal state is configured(For PDU/Switch) or booted(for Node) +# matching means node found matching the range, but no status attribute value +# matched means node found matching the range, with mac attribute value, but no status attribute value #----------------------------- my %state_node_hash = (); @@ -240,7 +242,7 @@ sub update_nodes_info { foreach (@unmatched_nodes_attributes) { if (/^(.*):\s*mac=(.*)$/) { if ($2) { - update_node_info($1, "Matched"); + update_node_info($1, "matched (no status)"); } } } @@ -279,7 +281,7 @@ sub update_node_info { if (exists($state_node_hash{$node_type}{$node_state}{$node})) { delete($state_node_hash{$node_type}{$node_state}{$node}); } - unless (scalar keys ($state_node_hash{$node_type}{$node_state})) { + unless (scalar keys (%{$state_node_hash{$node_type}{$node_state}})) { delete($state_node_hash{$node_type}{$node_state}); } @@ -307,10 +309,10 @@ sub check_nodes_attributes { $node_info{$_}{state} = $nodehash{$_}{status}; $unfinished_nodes{$_} = 1; } elsif ($nodehash{$_}{mac}) { - $node_info{$_}{state} = "Matched"; + $node_info{$_}{state} = "matched (no status)"; $unfinished_nodes{$_} = 1; } else { - $node_info{$_}{state} = "matching"; + $node_info{$_}{state} = "matching (no status, no mac)"; $unmatched_nodes{$_} = 1; } if ($nodehash{$_}{mgt} eq 'pdu') { diff --git a/xCAT-probe/subcmds/code_template b/xCAT-probe/subcmds/code_template index ed9ffdd46..87759ae83 100755 --- a/xCAT-probe/subcmds/code_template +++ b/xCAT-probe/subcmds/code_template @@ -144,7 +144,7 @@ if ($help) { } if ($test) { - probe_utils->send_msg("$output", "o", "This isn't a probe tool, this is just a template for sub command coding. Using it to develop sub command which need to cover hierarchical cluster"); + probe_utils->send_msg("$output", "o", "This isn't a probe tool, this is just a template for sub command coding. Use it to develop sub command which need to cover hierarchical cluster"); exit 0; } diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index eeadb577a..b5730e42c 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -11,7 +11,7 @@ Vendor: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -Requires: xCAT-client +PreReq: xCAT-client = 4:%{version}-%{release} %ifos linux BuildArch: noarch diff --git a/xCAT-server/bin/replaycons b/xCAT-server/bin/replaycons index 5cc22aa84..dded022ec 100755 --- a/xCAT-server/bin/replaycons +++ b/xCAT-server/bin/replaycons @@ -17,7 +17,7 @@ use Getopt::Long; my $usage_string = "Usage: - replaycons node [bps] [tail] + replaycons node_log [bps] [tail] replaycons -h|--help replaycons -v|--version bps Specifies the display rate. diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 85188c14b..5ace2f59c 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -102,7 +102,8 @@ sub run_cmd_in_perl { # List of commands currently not supported in Python my @unsupported_in_python_commands = ('rflash', 'getopenbmccons'); - if ($command ~~ @unsupported_in_python_commands) { + my @temp = grep ({$command =~ $_ } @unsupported_in_python_commands); + if ( $command eq $temp[0]) { # Command currently not supported in Python if ($support_obmc and uc($support_obmc) eq 'YES') { return (0, ''); # Go Python: unsuppored command, but XCAT_OPENBMC_DEVEL=YES overrides diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 24546a08d..e27ee05a0 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1135,11 +1135,10 @@ sub mkinstall my @pkgdirs=split(/,/,$pkgdir); foreach my $mypkgdir (@pkgdirs){ - unless(-f "/install/postscripts/repos/$mypkgdir/local-repository.tmpl"){ - #fix issue #2856@github - #for the osimages created by <=xCAT 2.12.3 + unless(-s "/install/postscripts/repos/$mypkgdir/local-repository.tmpl"){ #there is no local-repository.tmpl under pkgdir created on copycds - #generate local-repository.tmpl here if it does not exist + #generate local-repository.tmpl here if it does not exist or empty + xCAT::MsgUtils->trace($verbose_on_off, "d", "anaconda->mkinstall: call to create /install/postscripts/repos/$mypkgdir/local-repository.tmpl"); xCAT::Yum->localize_yumrepo($mypkgdir, $os, $arch); } } @@ -2547,7 +2546,7 @@ sub insert_dd { # dracut + drvier rpm # !dracut + driver rpm # !dracut + driver disk - if (!<$install_dir/$os/$arch/Packages/dracut*> || (@rpm_list && ($Injectalldriver || $updatealldriver || @driver_list))) { + if (!(&using_dracut($os)) || (@rpm_list && ($Injectalldriver || $updatealldriver || @driver_list))) { mkpath "$dd_dir/initrd_img"; # The dir for the new initrd # unzip the initrd image @@ -2695,7 +2694,7 @@ sub insert_dd { # If the os has dracut rpm packet, then copy the drivers to the /lib/modules/ # and recreate the dependency by the depmod command - if (<$install_dir/$os/$arch/Packages/dracut*>) { #rh6, fedora13 ... + if (&using_dracut($os)) { #rh6 above, fedora13 ... # For dracut mode, only copy the drivers from rpm packages to the /lib/modules/ # The driver disk will be handled that append the whole disk to the orignial initrd @@ -3241,7 +3240,7 @@ EOMS } # dracut + driver disk, just append the driver disk to the initrd - if (<$install_dir/$os/$arch/Packages/dracut*> && @dd_list) { #new style, skip the fanagling, copy over the dds and append them... + if ( (&using_dracut($os)) && @dd_list) { #new style, skip the fanagling, copy over the dds and append them... mkpath("$dd_dir/dd"); if (scalar(@dd_list) == 1) { #only one, just append it.. copy($dd_list[0], "$dd_dir/dd/dd.img"); diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index f194bfd64..2832d7710 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -711,10 +711,16 @@ sub setdestiny { $bphash->{$_}->[0]->{initrd} = "xcat/genesis.fs.$arch.$othersuffix"; $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport destiny=$state"; } - } else { #'legacy' environment + } else { # genesis.kernel file is not there, assume 'legacy' environment + if (-r "$tftpdir/xcat/nbk.$arch") { $bphash->{$_}->[0]->{kernel} = "xcat/nbk.$arch"; $bphash->{$_}->[0]->{initrd} = "xcat/nkfs.$arch.gz"; $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport"; + $callback->({ warning => ["No genesis.kernel.$arch file found. Defaulting to legacy nbk.$arch"]}); + } else { # can not find genesis.kernel or nbk file + $callback->({ error => ["Could not find genesis.kernel.$arch or legacy nbk.$arch files"], errorcode => [1] }); + exit(1); + } } } diff --git a/xCAT-server/lib/xcat/plugins/imgport.pm b/xCAT-server/lib/xcat/plugins/imgport.pm index 8a8a9057e..ee1749fba 100644 --- a/xCAT-server/lib/xcat/plugins/imgport.pm +++ b/xCAT-server/lib/xcat/plugins/imgport.pm @@ -123,7 +123,7 @@ sub ximport { 'R|remotehost=s' => \$remoteHost, 'p|postscripts=s' => \$nodes, 'f|profile=s' => \$new_profile, - 'n|nozip' => \$nozip + 'n|nozip' => \$nozip ); if ($help) { @@ -131,8 +131,14 @@ sub ximport { return; } - # first extract the bundle - extract_bundle($request, $callback, $nodes, $new_profile, $remoteHost, $nozip ); + if ($#ARGV == -1) { + # if no arguments left after processing the options, then bundle name is missing + $xusage->(1); + } else { + # first extract the bundle + my $bundle = shift @ARGV; + extract_bundle($request, $callback, $bundle, $nodes, $new_profile, $remoteHost, $nozip ); + } } @@ -1067,10 +1073,10 @@ sub make_bundle { if (defined $remoteHost) { my $remoteFile = $remoteHost . ':' . $remoteDest; - $callback->({ data => ["Moving the image bundle to the remote system location $remoteDest"] }); + $callback->({ data => ["Moving the image bundle to the remote system location $remoteFile"] }); $rc = system("/usr/bin/scp -B $dest $remoteFile"); if ($rc) { - $callback->({ error => ["Unable to copy the image bundle $bundleName to the remote host"], errorcode => [1] }); + $callback->({ error => ["Unable to copy the image bundle $bundleName to the remote host (Maybe passwordless ssh was not setup?)"], errorcode => [1] }); } } } @@ -1114,20 +1120,18 @@ sub extract_bundle { #print Dumper($request); my $callback = shift; + my $bundle = shift; my $nodes = shift; my $new_profile = shift; my $remoteHost = shift; my $nozip = shift; - @ARGV = @{ $request->{arg} }; my $xml; my $data; my $datas; my $error = 0; my $bundleCopy; - my $bundle = shift @ARGV; - # Determine the current working directory. my $dir = $request->{cwd}; #getcwd; $dir = $dir->[0]; @@ -1152,10 +1156,10 @@ sub extract_bundle { my $remoteFile = "$remoteHost:$bundle"; $bundleCopy = `/bin/mktemp $workDir/imgimport.$$.XXXXXX`; chomp($bundleCopy); - $callback->({ data => ["Obtaining the image bundle from the remote system"] }); + $callback->({ data => ["Obtaining the image bundle from the remote system $remoteFile"] }); my $rc = system("/usr/bin/scp -v -B $remoteFile $bundleCopy"); if ($rc != 0) { - $callback->({ error => ["Unable to copy the image bundle $bundle from the remote host"], errorcode => [1] }); + $callback->({ error => ["Unable to copy the image bundle $bundle from the remote host (Maybe passwordless ssh was not setup?)"], errorcode => [1] }); $rc = system("rm -rf $bundleCopy"); if ($rc) { $callback->({ error => ["Failed to remove the local copy of the remote image bundle $bundleCopy"], errorcode => [1] }); diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index c1acfe332..7e3580561 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -3950,7 +3950,8 @@ sub initfru_zero { next; } - if ($sdr->fru_subtype == 0x1) { #DIMM + if ($sdr->id_string =~ "DIMM") { #DIMM. + # Can not always use "fru_subtype=1" for DIMM, sometimes on Power it is 2 push @{ $sessdata->{dimmfru} }, $sdr; } elsif ($sdr->fru_subtype == 0 or $sdr->fru_subtype == 2) { push @{ $sessdata->{genhwfru} }, $sdr; @@ -4213,7 +4214,14 @@ sub add_fruhash { $sessdata->{frudex} += 1; } elsif ($sessdata->{currfrutype} and $sessdata->{currfrutype} eq 'dimm') { $fruhash = decode_spd(@{ $sessdata->{currfrudata} }); + if ($fruhash->{product}->{model} =~ "Unrecognized SPD") { + # If decode_spd() was not able to parse SPD data for DIMM, try parsefru() + # + # Yes, it is a goto statement here. Ugly, but removes the need to restructure + goto PARSEFRU_DIMM; + } } else { +PARSEFRU_DIMM: my $err; $global_sessdata = $sessdata; #pass by global, evil, but practical this time ($err, $fruhash) = parsefru($sessdata->{currfrudata}); @@ -4226,7 +4234,7 @@ sub add_fruhash { $fru->rec_type("hw"); } $fru->value($err); - if ($sessdata->{currfrusdr}) { + if ($sessdata->{currfrusdr} and scalar keys %{$sessdata->{currfrusdr}} ) { $fru->desc($sessdata->{currfrusdr}->id_string); } if (exists($sessdata->{frudex})) { @@ -4245,6 +4253,7 @@ sub add_fruhash { } elsif (ref $sessdata->{currfrudata}) { if ($sessdata->{currfrutype} and $sessdata->{currfrutype} eq 'dimm') { add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "", "product", "dimm,hw", $sessdata); + add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "Board ", "board", "dimm,hw", $sessdata); } else { add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "Board ", "board", undef, $sessdata); add_textual_frus($fruhash, $sessdata->{currfrusdr}->id_string, "Product ", "product", undef, $sessdata); @@ -7528,20 +7537,22 @@ sub initsdr_withrepinfo { my $dev_rev = $sessdata->{device_rev}; my $fw_rev1 = $sessdata->{firmware_rev1}; my $fw_rev2 = $sessdata->{firmware_rev2}; + my $num_sdr_records = $sessdata->{sdr_info}->{rec_count}; #TODO: beware of dynamic SDR contents - my $cache_file = "$cache_dir/sdr_$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"; + my $cache_name_id = "$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2.$num_sdr_records"; + my $cache_file = "$cache_dir/sdr_$cache_name_id"; $sessdata->{sdrcache_file} = $cache_file; if ($enable_cache eq "yes") { - if ($sdr_caches{"$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"}) { - $sessdata->{sdr_hash} = $sdr_caches{"$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"}; + if ($sdr_caches{"$cache_name_id"}) { + $sessdata->{sdr_hash} = $sdr_caches{"$cache_name_id"}; on_bmc_connect("SUCCESS", $sessdata); #retry bmc_connect since sdr_cache is validated return; #don't proceed to slow load } else { my $rc = loadsdrcache($sessdata, $cache_file); if ($rc == 0) { - $sdr_caches{"$mfg_id.$prod_id.$device_id.$dev_rev.$fw_rev1.$fw_rev2"} = $sessdata->{sdr_hash}; + $sdr_caches{"$cache_name_id"} = $sessdata->{sdr_hash}; on_bmc_connect("SUCCESS", $sessdata); #retry bmc_connect since sdr_cache is validated return; #don't proceed to slow load } @@ -8201,6 +8212,7 @@ sub decodebcd { return ($text); } +# Save SDR "metadata" into cache file sub storsdrcache { my $file = shift; my $sessdata = shift; @@ -8228,6 +8240,7 @@ sub storsdrcache { return (0); } +# Load SDR "metadata" from cache file sub loadsdrcache { my $sessdata = shift; my $file = shift; diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 54b2c56fc..89be54d85 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3571,25 +3571,23 @@ sub lsvm { if (exists $domain_info->{"state"}) { my $state = $domain_info->{"state"}; my $state_string; - given($state) { - when ($state == &Sys::Virt::Domain::STATE_NOSTATE) - {$state_string = "The domain is active, but is not running / blocked (eg idle)";} - when ($state == &Sys::Virt::Domain::STATE_RUNNING) - {$state_string = "The domain is active and running";} - when ($state == &Sys::Virt::Domain::STATE_BLOCKED) - {$state_string = "The domain is active, but execution is blocked";} - when ($state == &Sys::Virt::Domain::STATE_PAUSED) - {$state_string = "The domain is active, but execution has been paused";} - when ($state == &Sys::Virt::Domain::STATE_SHUTDOWN) - {$state_string = "The domain is active, but in the shutdown phase";} - when ($state == &Sys::Virt::Domain::STATE_SHUTOFF) - {$state_string = "The domain is inactive, and shut down";} - when ($state == &Sys::Virt::Domain::STATE_CRUSHED) - {$state_string = "The domain is inactive, and crashed";} - when ($state == &Sys::Virt::Domain::STATE_PMSUSPENDED) - {$state_string = "The domain is active, but in power management suspend state";} - default {$state_string = "Unknown"}; - } + if ($state == &Sys::Virt::Domain::STATE_NOSTATE) + {$state_string = "The domain is active, but is not running / blocked (eg idle)";} + elsif ($state == &Sys::Virt::Domain::STATE_RUNNING) + {$state_string = "The domain is active and running";} + elsif ($state == &Sys::Virt::Domain::STATE_BLOCKED) + {$state_string = "The domain is active, but execution is blocked";} + elsif ($state == &Sys::Virt::Domain::STATE_PAUSED) + {$state_string = "The domain is active, but execution has been paused";} + elsif ($state == &Sys::Virt::Domain::STATE_SHUTDOWN) + {$state_string = "The domain is active, but in the shutdown phase";} + elsif ($state == &Sys::Virt::Domain::STATE_SHUTOFF) + {$state_string = "The domain is inactive, and shut down";} + elsif ($state == &Sys::Virt::Domain::STATE_CRUSHED) + {$state_string = "The domain is inactive, and crashed";} + elsif ($state == &Sys::Virt::Domain::STATE_PMSUSPENDED) + {$state_string = "The domain is active, but in power management suspend state";} + else {$state_string = "Unknown"}; push @vms, "State :" . $domain_info->{"state"} . " ($state_string)"; } # The following block of code copied from rscan command processng for disks diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6681768f9..456a8b802 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1255,7 +1255,8 @@ sub parse_args { my $option_s; GetOptions( 's' => \$option_s ); return ([ 1, "The -s option is not supported for OpenBMC." ]) if ($option_s); - if ( "resolved=" ~~ @ARGV) { + my @temp = grep ({"resolved" =~ $_ } @ARGV); + if ( "resolved=" eq $temp[0]) { return ([ 1, "$usage_errormsg $reventlog_no_id_resolved_errormsg" ]); } return ([ 1, "Only one option is supported at the same time for $command" ]); diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index aa783fd86..fa2980e61 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -591,7 +591,8 @@ sub process_request { return 1; } my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; - my $rc = system("$mksquashfs_command"); + xCAT::Utils->runcmd($mksquashfs_command, 0, 1); + my $rc = $::RUNCMD_RC; if ($rc) { $callback->({ error => ["Command \"$mksquashfs_command\" failed"], errorcode => [1] }); return 1; diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 88702a0e6..a72b90df6 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -91,6 +91,25 @@ sub getstate { } } +my %efistubcache; +sub has_efistub { + my $kern = shift; + my $node = shift; + my $filename = $globaltftpdir . "/" . $kern; + if (defined $efistubcache{$filename}) { + return $efistubcache{$filename}; + } + open my $kernel, '<:raw', $filename; + read $kernel, my $bytes, 512; + my $match = pack 'H*', '504500006486'; + if ($bytes =~ m/$match/) { + $efistubcache{$filename} = 1; + return 1; + } else { + $efistubcache{$filename} = 0; + return 0; + } +} sub setstate { =pod @@ -304,23 +323,36 @@ sub setstate { print $pcfg "imgargs kernel BOOTIF=" . '${netX/mac}' . "\n"; } if ($kern->{initrd}) { - print $pcfg "imgfetch http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; + print $pcfg "imgfetch -n initrd http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; } print $pcfg "imgexec kernel\n"; if ($kern->{kcmdline} and $kern->{initrd}) { #only a linux kernel/initrd pair should land here, write elilo config and uefi variant of xnba config file my $ucfg; open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); - print $ucfg "#!gpxe\n"; - print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; - close($ucfg); - open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo"); - print $ucfg 'default="xCAT"' . "\n"; - print $ucfg "delay=0\n\n"; - print $ucfg "image=/tftpboot/" . $kern->{kernel} . "\n"; - print $ucfg " label=\"xCAT\"\n"; - print $ucfg " initrd=/tftpboot/" . $kern->{initrd} . "\n"; - print $ucfg " append=\"" . $elilokcmdline . ' BOOTIF=%B"' . "\n"; - close($ucfg); + if (has_efistub($kern->{kernel}, $node)) { + print $ucfg "#!gpxe\n"; + print $ucfg "imgfetch -n kernel http://" . '${next-server}:' . $httpport.'/tftpboot/' . $kern->{kernel} . "\n"; + print $ucfg "imgload kernel\n"; + if ($kern->{kcmdline}) { + print $ucfg "imgargs kernel " . $kern->{kcmdline} . ' BOOTIF=01-${netX/mac:hexhyp} initrd=initrd' . "\n"; + } else { + print $ucfg "imgargs kernel BOOTIF=" . '${netX/mac} initrd=initrd' . "\n"; + } + print $ucfg "imgfetch -n initrd http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n"; + print $ucfg "imgexec kernel\n"; + close($ucfg); + } else { + print $ucfg "#!gpxe\n"; + print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n"; + close($ucfg); + open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo"); + print $ucfg 'default="xCAT"' . "\n"; + print $ucfg "delay=0\n\n"; + print $ucfg "image=/tftpboot/" . $kern->{kernel} . "\n"; + print $ucfg " label=\"xCAT\"\n"; + print $ucfg " initrd=/tftpboot/" . $kern->{initrd} . "\n"; + print $ucfg " append=\"" . $elilokcmdline . ' BOOTIF=%B"' . "\n"; + } } } } diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist index 0feb58550..13eb3c39b 100644 --- a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist @@ -9,3 +9,4 @@ wget python3 tar bzip2 +perl-interpreter diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist index 0feb58550..13eb3c39b 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist @@ -9,3 +9,4 @@ wget python3 tar bzip2 +perl-interpreter diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist index 1cc601f9e..c21e00a25 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist @@ -13,3 +13,4 @@ unixODBC python3 tar bzip2 +perl-interpreter diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat.ng b/xCAT-server/share/xcat/install/scripts/post.xcat.ng index 255298db8..cbbad65be 100644 --- a/xCAT-server/share/xcat/install/scripts/post.xcat.ng +++ b/xCAT-server/share/xcat/install/scripts/post.xcat.ng @@ -134,7 +134,7 @@ function download_recursive() [ "$?" -ne "0" ] && return 1 ;; esac - done < <(curl --fail --retry 20 --max-time 60 "${url}/" | grep -o '\1' | cut -d '"' -f 2) + done < <(curl --fail --retry 20 --max-time 60 "${url}/" | grep -o '.*' | egrep -v "O=D|Directory" | cut -d '"' -f 2) return 0 } diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat index 8aa5dac22..deaadde40 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite.ppc.redhat @@ -128,7 +128,12 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null + if [ -f "/usr/bin/nice" ]; then + RANDOMBYTES="-rand /usr/bin/nice" + else + RANDOMBYTES="" + fi + echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} ${RANDOMBYTES} 2>/dev/null } diff --git a/xCAT-server/share/xcat/netboot/debian/genimage b/xCAT-server/share/xcat/netboot/debian/genimage index 40ed5d484..35219e8fd 100755 --- a/xCAT-server/share/xcat/netboot/debian/genimage +++ b/xCAT-server/share/xcat/netboot/debian/genimage @@ -266,7 +266,7 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{ $extra_hash{$pass} })) { if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/fedora12/genimage b/xCAT-server/share/xcat/netboot/fedora12/genimage index 46be3324f..79a578f28 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/genimage +++ b/xCAT-server/share/xcat/netboot/fedora12/genimage @@ -178,7 +178,7 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -263,7 +263,7 @@ unless ($onlyinitrd) { } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/fedora12/geninitrd b/xCAT-server/share/xcat/netboot/fedora12/geninitrd index 62c5a1401..5b2607cdb 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/geninitrd +++ b/xCAT-server/share/xcat/netboot/fedora12/geninitrd @@ -211,7 +211,7 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -279,7 +279,7 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{ $extra_hash{$pass} })) { if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/mic/genimage b/xCAT-server/share/xcat/netboot/mic/genimage index 3b5a49c0b..e93ea2f3f 100755 --- a/xCAT-server/share/xcat/netboot/mic/genimage +++ b/xCAT-server/share/xcat/netboot/mic/genimage @@ -125,7 +125,7 @@ if ($otherpkglist) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$aiddistro-$repnum]\nname=$aiddistro-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$aiddistro-$repnum]\nname=$aiddistro-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -148,7 +148,7 @@ if ($otherpkglist) { } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $repohash{$pass}{$index} = 1; $index++; my $pa = $extra_hash{$pass}{$_}; diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index a3ac65d01..a0ee5780b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -30,3 +30,4 @@ gzip grub2 grub2-tools lsvpd +perl-interpreter diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index cbeb2b5ab..635bd5046 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -26,4 +26,5 @@ bash vim-minimal rpm iputils +perl-interpreter diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 68be043da..0620ec5af 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -336,11 +336,11 @@ if($onlyinitrd){ my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } foreach $srcdir (@pkgdir_internet) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } $repnum -= 1; @@ -516,12 +516,12 @@ if($onlyinitrd){ if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next; } foreach(@otherpkgdir_url){ - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; my $pa = $extra_hash{$pass}{$_}; @@ -1081,7 +1081,7 @@ sub mkinitrd_dracut { open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); my $dracutmodulelist = "xcat nfs base network kernel-modules syslog"; - foreach (qw/systemd systemd-initrd dracut-systemd fadump/) { + foreach (qw/systemd systemd-initrd dracut-systemd fadump kernel-modules-extra/) { my ($dir) = glob($dracutmoduledir . "[0-9]*" . $_); if (-d $dir) { $dracutmodulelist .= " $_"; @@ -1122,7 +1122,7 @@ sub mkinitrd_dracut { my $dracutmodulelist = "xcat nfs base network kernel-modules syslog"; - foreach (qw/systemd systemd-initrd dracut-systemd fadump/) { + foreach (qw/systemd systemd-initrd dracut-systemd fadump kernel-modules-extra/) { my ($dir) = glob($dracutmoduledir . "[0-9]*" . $_); if (-d $dir) { $dracutmodulelist .= " $_"; diff --git a/xCAT-server/share/xcat/netboot/rh/genimage.rh4 b/xCAT-server/share/xcat/netboot/rh/genimage.rh4 index 848d88338..97fd3e9de 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage.rh4 +++ b/xCAT-server/share/xcat/netboot/rh/genimage.rh4 @@ -211,7 +211,7 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; @@ -285,7 +285,7 @@ unless ($onlyinitrd) { foreach $pass (sort (keys(%extra_hash))) { foreach (keys(%{ $extra_hash{$pass} })) { if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE")) { next; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgcheck=0\n\n"; $index++; my $pa = $extra_hash{$pass}{$_}; $extrapkgnames{$pass} .= " " . join(' ', @$pa); diff --git a/xCAT-server/share/xcat/netboot/sles/genimage.yum b/xCAT-server/share/xcat/netboot/sles/genimage.yum index 50fa742d1..acd4c8ffd 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage.yum +++ b/xCAT-server/share/xcat/netboot/sles/genimage.yum @@ -116,14 +116,14 @@ unless ($onlyinitrd) { open($yumconfig, ">", "/tmp/genimage.$$.yum.conf"); my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgcheck=0\n\n"; $repnum += 1; } $repnum -= 1; #add the section for other packages if ($pkgnames) { - print $yumconfig "[$osver-$arch-otherpkgs]\nname=$osver-$arch-otherpkgs\nbaseurl=file://$srcdir_otherpkgs\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-otherpkgs]\nname=$osver-$arch-otherpkgs\nbaseurl=file://$srcdir_otherpkgs\ngpgcheck=0\n\n"; } close($yumconfig); diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup b/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup new file mode 100755 index 000000000..5c004c3e3 --- /dev/null +++ b/xCAT-server/share/xcat/samples/cuda11/cuda11_power9_setup @@ -0,0 +1,157 @@ +#!/bin/bash +# +# Copyright (C) 2018 International Business Machines +# Eclipse Public License, Version 1.0 (EPL-1.0) +# +# +# 2018-03-21 GONG Jie +# 2018-04-24 Matt Ezell +# +# This script is used for doing extra setup steps for NVIDIA POWER9 CUDA driver +# on RHEL 7. Please refer document below for details. +# +# http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#power9-setup +# + +umask 0022 + +# Disable a udev rule installed by default in some Linux distributions that cause hot-pluggable +# memory to be automatically onlined when it is physically probed. +# +# The overrides for /lib/udev rules should be done in /etc/udev +# +UDEV_REDHAT_SOURCE=${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +UDEV_REDHAT_TARGET=${IMG_ROOTIMGDIR}/etc/udev/rules.d/40-redhat.rules + +# If the file does not exist in /etc/udev, copy it from /lib/udev +if [ ! -e ${UDEV_REDHAT_TARGET} ]; then + cp -n ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} +fi + +# Disable udev memory auto-onlining Rule for cuda10.x +# +# For RHELS 7.5 ALT +# +sed -i "s/^\(SUBSYSTEM==\"memory\".*\)/#\1/" ${UDEV_REDHAT_TARGET} +# +# For RHELS 7.6 ALT +# +if [[ `grep 'Memory hotadd request' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null && grep 'LABEL="memory_hotplug_end' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` == 0 ]]; then + echo "Detected RHELS 7.6 ALT, modifying ${UDEV_REDHAT_TARGET}..." + # Comment out the memory hotadd request (for reference) + if [[ `grep "## Memory hotadd request" ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` != 0 ]]; then + # but only run one time, not if it's already commented out. (to handle multiple genimage calls) + #sed -i '/Memory hotadd request/,+8 s/^/#/' ${UDEV_REDHAT_TARGET} + # RH76 CUDA doc recommends the following: + sed -i s/^\SUBSYSTEM!=\"memory\"/SUBSYSTEM==\"\*\"/ ${UDEV_REDHAT_TARGET} + sed -i s/^\ACTION!=\"add\"/ACTION==\"\*\"/ /tmp/40-redhat.rules ${UDEV_REDHAT_TARGET} + fi +fi + +echo "Comparing ${UDEV_REDHAT_SOURCE} and ${UDEV_REDHAT_TARGET}" +diff ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} + +# Setting NVIDIA parameters in both /etc/modprobe.d and /usr/lib/modprobe.d + +echo "==> Setting NVIDIA options in /usr/lib/modprobe.d/gpusupport and /etc/modprobe.d" +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/gpusupport.conf +echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/etc/modprobe.d/gpusupport.conf + +grep nouveau ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +if (( $? )) +then +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +fi + +grep nouveau ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +if (( $? )) +then +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +fi + +# This is for nvprof (per George Chochia) +grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +if (( $? )) +then + echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +fi + +grep NVreg_RestrictProfilingToAdminUsers ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +if (( $? )) +then + echo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" >> ${IMG_ROOTIMGDIR}/etc/modprobe.d/nvidia.conf +fi + +#for cuda nvidia installation +unset ARCH +installed_kernel=`uname -r` + +function hack_uname() +{ + mv "$1/bin/uname" "$1/bin/uname.xcat" + cat <<-EOF >>"$1/bin/uname" +#!/bin/sh + case "\$1" in + "-m") + ARCH="\$(rpm -q kernel-\$("\$0" -r) --qf '%{arch}' 2>/dev/null)" + echo "\$ARCH" + ;; + "-r") + kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" + echo "\$kernel_version" + ;; + "-s"|"") + echo "Linux" + ;; + esac + exit 0 +EOF + + chmod 0755 "$1/bin/uname" +} + + +if [ -z "${IMG_ROOTIMGDIR}" ] +then + kernel_version="$(for d in $(ls /lib/modules | sort -V) ; do : ; done && echo $d)" + mkinitrd -v -f "/boot/initramfs-${kernel_version}.img" "${kernel_version}" + hack_uname ${IMG_ROOTIMGDIR} +else + hack_uname +fi + +updated_kernel=`uname -r` + +dnf -y module install nvidia-driver:latest-dkms +dnf -y install cuda + +#depmod nvidia_rsync_mem used installed kernel not updated kernel +if [ ${updated_kernel} != ${installed_kernel} ] +then + ln -s /lib/modules/${updated_kernel} /lib/modules/${installed_kernel} +fi +dnf -y install nvidia_peer_memory +dnf -y install nv_rsync_mem +dnf -y install nvidia_gdrcopy_kernel +if [ ${updated_kernel} != ${installed_kernel} ] +then + rm -rf /lib/modules/${installed_kernel} +fi + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" + + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nvidia_gdrcopy_kernel.service" + +[ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" +$CHROOTCMD /bin/bash -c "systemctl enable nv_rsync_mem.service" + +if [ -z "${IMG_ROOTIMGDIR}" ] +then + mv "${IMG_ROOTIMGDIR}/bin/uname.xcat" "${IMG_ROOTIMGDIR}/bin/uname" +else + mv "/bin/uname.xcat" "/bin/uname" +fi + diff --git a/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme b/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme new file mode 100644 index 000000000..d6bb77371 --- /dev/null +++ b/xCAT-server/share/xcat/samples/cuda11/cuda11_setup.readme @@ -0,0 +1,73 @@ +cuda setup scripts +================== + +This sample documents installation of the NVIDIA CUDA Toolkit v11 on IBM POWER9 servers as part of xCAT diskful provisioning of Red Hat Enterprise Linux 8.1. +For ``CUDA11``, there is a known issue that prevents successful installion of the nvidia-drivers module as part of the operating system kickstart install process used by diskful provisioning. +Diskless provisioning can still be performed using the traditional osimage method; these instructions apply to diskful provisioning only. + + +Diskful images +-------------- + +For diskful provisioning, create a new ``cudafull`` osimage definition using the default ``rhels8.1-ppc64le-install-compute`` osimage as a starting point. :: + + # lsdef -t osimage rhels8.1.0-ppc64le-install-cudafull + Object name: rhels8.1.0-ppc64le-install-cudafull + imagetype=linux + osarch=ppc64le + osdistroname=rhels8.1.0-ppc64le + osname=Linux + osvers=rhels8.1.0 + otherpkgdir=/install/post/otherpkgs/rhels8.1.0/ppc64le + pkgdir=/install/rhels8.1.0/ppc64le,/install/REPO/software/nvidia/cuda-core/11.0.1_450.36.06-1/repo/ppc64le,/install/cuda11/ppc64le/cuda-deps + pkglist=/opt/xcat/share/xcat/install/rh/compute.rhels8.cuda.pkglist + postscripts=custom.ps/nvidia/postinstall/cuda11_power9_setup + profile=compute + provmethod=install + template=/opt/xcat/share/xcat/install/rh/compute.rhels8.tmpl + + +Postscripts +^^^^^^^^^^^ + +For ``CUDA11``, there is a known issue that prevents successful installion of the nvidia-drivers module as part of the Red Hat kickstart install process used by diskful provisioning. As an example method to work around this problem, refer to the postscript named ``cuda11_power9_setup``. This postscript will install the NVIDIA CUDA packages directly instead of relying on the osimage package list mechanism. ``cuda11_power9_setup`` is only needed for diskful provisioning. + + +CUDA dependences +^^^^^^^^^^^^^^^^ + +``dkms`` and ``opencl-filesystem`` are required for the CUDA11. ``dkms`` packages can be found in the rhel8 EPEL repository. ``opencl-filesystem`` packages can be found in the rhel8 CodeReady repository. :: + + # ls -ltr /install/cuda11/ppc64le/cuda-deps + -rw-r--r-- 1 root root 82332 Jun 16 10:25 dkms-2.8.1-4.20200214git5ca628c.el8.noarch.rpm + -rw-r--r-- 1 root root 90148 Jun 16 10:29 opencl-headers-2.2-1.20180306gite986688.el8.noarch.rpm + -rw-r--r-- 1 root root 8668 Jun 16 10:29 opencl-filesystem-1.0-6.el8.noarch.rpm + drwxr-xr-x 2 root root 4096 Jun 16 15:10 repodata + + +CUDA Packages +^^^^^^^^^^^^^ + +``cuda-repo-rhel8-11-0-local-11.0.1_450.36.06-1.ppc64le.rpm`` is used for the example ``cudafull`` osimage and the contents are copied into a directory named ``/install/REPO/software/nvidia/cuda-core/11.0.1_450.36.06-1/repo/ppc64le``. +In addition to the rhels8 base pkglist, the following packages need to also be added. :: + + # diff /opt/xcat/share/xcat/install/rh/compute.rhels8.cuda.pkglist /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist + 12,27d11 + < libtirpc + < yum + < rpm + < dnf + < dracut + < dracut-network + < e2fsprogs + < #For Cuda + < kernel-devel + < kernel-headers + < make + < gcc + < pciutils + < dkms + < opencl-filesystem + + +NOTE: The samples in this directory were verified as part of the IBM HPC POWER9 Clusters service pack testing diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 9d8e76abd..c8abf7073 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -172,13 +172,13 @@ GO_XCAT_CORE_PACKAGE_LIST=() GO_XCAT_DEP_PACKAGE_LIST=() # The package list of all the packages should be installed -GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-buildkit xCAT-client +GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT-client xCAT xCAT-buildkit xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && -GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client +GO_XCAT_INSTALL_LIST=(perl-xcat xcat-client xcat xcat-buildkit xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) diff --git a/xCAT-server/share/xcat/tools/powervm/configvios b/xCAT-server/share/xcat/tools/powervm/configvios index 6f6aa49d9..28cd3e80b 100755 --- a/xCAT-server/share/xcat/tools/powervm/configvios +++ b/xCAT-server/share/xcat/tools/powervm/configvios @@ -139,7 +139,7 @@ sub get_cmd foreach (@hdisk) { - `lspv|grep $_ >/dev/nul 2>&1`; + `lspv|grep $_ >/dev/null 2>&1`; $err++ if ($? != 0) } @@ -152,7 +152,7 @@ sub get_cmd next; } - `lsvg $key > /dev/nul 2>&1`; + `lsvg $key > /dev/null 2>&1`; if ($? == 0) { #print "Invalid configuration item $key: vg $key already existed\n"; @@ -193,7 +193,7 @@ sub get_cmd next; } - `su - padmin " -c ioscli lslv $conf[0]" > /dev/nul 2>&1`; + `su - padmin " -c ioscli lslv $conf[0]" > /dev/null 2>&1`; if ($? == 0) { #print "Invalid configuration item $key:the lv name $conf[0] already existed\n"; @@ -203,7 +203,7 @@ sub get_cmd next; } - `su - padmin " -c ioscli lsvg $conf[1]" > /dev/nul 2>&1`; + `su - padmin " -c ioscli lsvg $conf[1]" > /dev/null 2>&1`; if ($? != 0) { #print "Invalid configuration item $key:the vg $conf[1] doesn't exist\n"; @@ -242,7 +242,7 @@ sub get_cmd print "Mapping logical volumes to virtual adapters..."; while (my ($key, $value) = each %config) { - `su - padmin " -c ioscli lslv $value" > /dev/nul 2>&1`; + `su - padmin " -c ioscli lslv $value" > /dev/null 2>&1`; if ($? != 0) { #print "Invalid configuration item $key: lv $value doesn't exist\n"; @@ -252,7 +252,7 @@ sub get_cmd next; } - `su - padmin " -c ioscli lsdev -virtual |grep $key " >/dev/nul 2>&1`; + `su - padmin " -c ioscli lsdev -virtual |grep $key " >/dev/null 2>&1`; if ($? != 0) { #print "Invaild configuration item $key: virtual adapter $key doesn't exist\n"; diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index 92d610f5b..89ea7e23d 100755 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -1173,7 +1173,7 @@ sub send_email { sub git_update { send_msg(2, "[git update] starting to update xcat source code from git"); - my $res = system("cd $xcatcoredir && git checkout $branch > /dev/nul 2>&1"); + my $res = system("cd $xcatcoredir && git checkout $branch > /dev/null 2>&1"); if ($res != 0) { send_msg(0, "[git update] change to branch $branch....[failed]"); return 2; @@ -1198,7 +1198,7 @@ sub git_update { return 2; } - $res = system("grep 'Already up-to-date' $gitpulloutput > /dev/nul 2>&1"); + $res = system("grep 'Already up-to-date' $gitpulloutput > /dev/null 2>&1"); if ($res == 0 && !$forceregwithoutupdate) { send_msg(2, "[git update] code is already at latest version. exit regresson"); return 1; diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 5c1f487c4..be9f40d72 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -148,7 +148,7 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca/* cp share/xcat/mypostscript/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/mypostscript cp share/xcat/scripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts cp share/xcat/conf/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/conf -cp share/xcat/samples/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples +cp -r share/xcat/samples/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples cp -r share/xcat/tools/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools cp -r share/xcat/hamn/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/hamn cp share/xcat/rollupdate/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/rollupdate diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 8b1259b22..bd0768137 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -2879,7 +2879,7 @@ sub tablerowhdl { # Check if there is any real data in response # One key ('xcatdsource' => '') is always returned. # If no other keys in response - no matches on key or attribute were returned from xcatd - if (keys @$responses[0] <= 1) { + if (keys (%{@$responses[0]}) <= 1) { @$responses[0]->{error} = "No table rows matched specified keys or attributes"; } return $responses; diff --git a/xCAT-test/autotest/bundle/restapi.bundle b/xCAT-test/autotest/bundle/restapi.bundle new file mode 100644 index 000000000..ebd58aa63 --- /dev/null +++ b/xCAT-test/autotest/bundle/restapi.bundle @@ -0,0 +1,27 @@ +restapi_setup_on_MN_CN +restapi_list_all_resources +restapi_list_globalconf +restapi_list_groups +restapi_list_nodes +restapi_list_node_CN +restapi_list_networks +restapi_list_osimages +restapi_list_policy +restapi_create_temp_CN_put +restapi_delete_temp_CN_put +restapi_create_temp_CN_post +restapi_create_temp_CN_put +restapi_list_temp_CN_2 +restapi_delete_temp_CN_2 +restapi_create_temp_CN_put +restapi_add_id_temp_CN +restapi_modify_vmmemory_temp_CN +restapi_delete_id_temp_CN +restapi_show_temp_CN_osimage +restapi_list_nodes_wrong_password +restapi_list_nodes_invalid_option +restapi_list_invalid_resource +restapi_list_wrong_osimage +restapi_modify_wrong_field_CN +restapi_delete_temp_CN_put +restapi_cleanup_on_MN_CN diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 9c45ac82c..0e45189e3 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 updatenode_P_script2 @@ -23,6 +24,7 @@ updatenode_syncfile_MERGE updatenode_v updatenode_without_flag updatenode_without_options +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdcp_src_dst xdsh_E diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index e8b5b87d9..0fc86d278 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -17,12 +17,14 @@ bmcdiscover_range_z bmcdiscover_help bmcdiscover_q bmcdiscover_version +xcatprobe_work confignetwork_static_installnic get_xcat_postscripts_loginfo nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 51c605833..29bda82ab 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -2,6 +2,7 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 updatenode_P_script2 @@ -23,6 +24,7 @@ updatenode_syncfile_MERGE updatenode_v updatenode_without_flag updatenode_without_options +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdcp_src_dst xdsh_E diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index 267fabddb..6b39cbd14 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -17,12 +17,14 @@ bmcdiscover_range_z bmcdiscover_help bmcdiscover_q bmcdiscover_version +xcatprobe_work confignetwork_static_installnic get_xcat_postscripts_loginfo nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 4579ab45b..63dfc7e00 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -2,10 +2,12 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q bmcdiscover_version +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdsh_E xdsh_Q_command diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index 388887cd4..ddfa86713 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -15,6 +15,7 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index ac69cd322..7aaf23dc5 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -2,10 +2,12 @@ SN_setup_case reg_linux_diskless_installation_hierarchy reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q bmcdiscover_version +#INCLUDE:restapi.bundle# xdcp_nonroot_user xdsh_E xdsh_Q_command diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index 76767fa1f..a523a0746 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -15,6 +15,7 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +compare_postscripts reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 2ac01f264..983d59527 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 5e4ffac31..84f8f6968 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,6 +1,7 @@ reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat +compare_postscripts assign_certain_command_permission bmcdiscover_help bmcdiscover_q diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index f49f69f92..d98f9fc7a 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -30,8 +30,13 @@ do echo "rinstall $node osimage=$osimage" rinstall $node osimage=$osimage if [ $? != 0 ];then - echo "rinstall command failed ..." - exit 1 + echo "First attempt to run rinstall command failed ..." + # First rinstall failed, try again with verbose flag + rinstall $node osimage=$osimage -V + if [ $? != 0 ];then + echo "Second attempt to run rinstall command failed ..." + exit 1 + fi fi #sleep while for installation. diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 414883423..911f01641 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -166,20 +166,20 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcf check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi @@ -278,7 +278,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;second2ip=$var2$var3;chdef $$CN nicips.$$SECONDNIC="$second1ip|$second2ip" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="confignetworks_test1|confignetworks_test2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;second2ip=$var2$var3;chdef $$CN nicips.$$SECONDNIC="$second1ip|$second2ip" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="confignetworks_test1|confignetworks_test2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" check:rc==0 cmd:makehosts $$CN check:rc==0 @@ -287,12 +287,12 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~BOOTPROTO=none|static check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes @@ -301,8 +301,8 @@ cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts @@ -512,7 +512,7 @@ check:rc==0 cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -522,28 +522,28 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=105.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=106.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test7 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3;second7ip=$var2$var3;chdef $$CN nicnetworks.$$SECONDNIC.6=confignetworks_test6 nicnetworks.$$SECONDNIC.7=confignetworks_test7 nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=$second6ip nicips.$$SECONDNIC.7=$second7ip nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3;second7ip=$var2$var3;chdef $$CN nicnetworks.$$SECONDNIC.6=confignetworks_test6 nicnetworks.$$SECONDNIC.7=confignetworks_test7 nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=$second6ip nicips.$$SECONDNIC.7=$second7ip nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3;xdsh $$CN "ip addr del $second6ip/8 dev $$SECONDNIC.6" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second6ip=$var1$var3;xdsh $$CN "ip addr del $second6ip/8 dev $$SECONDNIC.6" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test6 cmd:rmdef -t network -o confignetworks_test7 cmd:xdsh $$CN "ip link del dev $$SECONDNIC.6" cmd:xdsh $$CN "ip link del dev $$SECONDNIC.7" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC.6 /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/;else echo \"Sorry,this is not supported os\"; fi" @@ -607,14 +607,14 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -622,7 +622,7 @@ cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -630,7 +630,7 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -639,7 +639,7 @@ cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;xdsh $$CN "ip addr del $bond0ip/16 dev bond0" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;xdsh $$CN "ip addr del $bond0ip/16 dev bond0" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi @@ -663,30 +663,30 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0= +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0= check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.$$SECONDNIC=bond0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.$$SECONDNIC=bond0 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:rmdef -t network -o confignetworks_test1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 @@ -712,14 +712,14 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1500 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -729,13 +729,13 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 mtu=1500 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;bond3ip=$var2$var3;chdef $$CN nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nicips.bond0.2=$bond2ip nicips.bond0.3=$bond3ip nicnetworks.bond0.2=confignetworks_test3 nicnetworks.bond0.3=confignetworks_test4 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;bond3ip=$var2$var3;chdef $$CN nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nicips.bond0.2=$bond2ip nicips.bond0.3=$bond3ip nicnetworks.bond0.2=confignetworks_test3 nicnetworks.bond0.3=confignetworks_test4 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 @@ -751,10 +751,10 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifc check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:rmdef -t network -o confignetworks_test4 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;xdsh $$CN "ip addr del $bond2ip/16 dev bond0.2" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;xdsh $$CN "ip addr del $bond3ip/16 dev bond0.3" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond2ip=$var1$var3;xdsh $$CN "ip addr del $bond2ip/16 dev bond0.2" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;bond3ip=$var2$var3;xdsh $$CN "ip addr del $bond3ip/16 dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" @@ -780,21 +780,21 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;chdef $$CN nicnetworks.br0=confignetworks_test3 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=$br0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;chdef $$CN nicnetworks.br0=confignetworks_test3 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=$br0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -802,7 +802,7 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi @@ -811,9 +811,9 @@ cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:xdsh $$CN "ip link del dev br0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi @@ -835,14 +835,14 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 @@ -851,34 +851,36 @@ check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;br33ip=$var2$var3;chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=confignetworks_test3 nicnetworks.br33=confignetworks_test4 nicips.br22=$br22ip nicips.br33=$br33ip nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;br33ip=$var2$var3;chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=confignetworks_test3 nicnetworks.br33=confignetworks_test4 nicips.br22=$br22ip nicips.br33=$br33ip nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 +cmd:xdsh $$CN "ip addr show bond0.3" +cmd:xdsh $$CN "ip addr show br33" cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" cmd:xdsh $$CN "ip link del dev br22" cmd:rmdef -t network -o confignetworks_test4 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var2;xdsh $$CN "ip addr del $br33ip/16 dev br33" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br33ip=$var1$var2;xdsh $$CN "ip addr del $br33ip/16 dev br33" cmd:xdsh $$CN "ip link del dev br33" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 @@ -900,7 +902,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 @@ -966,7 +968,7 @@ cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 check:rc==0 cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index ed886e3fc..06fb8c869 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -114,7 +114,7 @@ if ($genesis_nodesetshell_test) { if ($genesis_runcmd_test) { send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); if (&testxdsh(&rungenesiscmd(&get_arch))) { - send_msg(0, "[$$]:Could not verify test results using xdsh..............."); + send_msg(0, "[$$]:Could not verify runcmd test results using testxdsh() ..............."); exit 1; } send_msg(2, "[$$]:Running runcmd test success..............."); @@ -125,7 +125,7 @@ if ($genesis_runcmd_test) { if ($genesis_runimg_test) { send_msg(2, "[$$]:Run nodeset NODE runimage test..............."); if (&testxdsh(&rungenesisimg)) { - send_msg(0, "[$$]:Could not verify test results using xdsh ..............."); + send_msg(0, "[$$]:Could not verify runimage test results using testxdsh() ..............."); exit 1; } @@ -199,9 +199,13 @@ sub rungenesiscmd { if ($?) { send_msg(0, "mknb $arch failed for runcmd test."); } - `rinstall $noderange "runcmd=cmdtest,shell"`; + my $rinstall_cmd = "rinstall $noderange \"runcmd=cmdtest,shell\""; + `$rinstall_cmd`; if ($?) { - send_msg(0, "rinstall noderange shell failed for runcmd test"); + send_msg(0, "Command \"$rinstall_cmd\" failed for runcmd test"); + } + else { + send_msg(2, "Installing with \"$rinstall_cmd\" for runcmd test"); } return $value; } @@ -247,7 +251,7 @@ sub rungenesisimg { ######################################### sub testxdsh { my $value = shift; - print "The input parameter is $value \n"; + send_msg(2, "The input parameter for testxdsh() is $value \n"); my $checkstring; my $checkfile; my $nodestatus; @@ -266,7 +270,7 @@ sub testxdsh { if (($value == 1) || ($value == 2) || ($value == 3)) { `$xdsh_command`; if ($?) { - my @i = (1..10); + my @i = (1..5); for (@i) { sleep 300; $nodestatus=`lsdef $noderange -i status -c 2>&1 | awk -F'=' '{print \$2}'`; diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 48b97ff28..7af0f0b10 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -21,10 +21,6 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi -#Pull down core and deps repomd.xml on SLES to prevent caching of the wrong file -cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then xdsh $$CN "wget --no-cache http://xcat.org/files/xcat/repos/yum/devel/core-snap/repodata/repomd.xml"; fi -cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then os=`echo __GETNODEATTR($$CN,os)__ | cut -d "." -f1 | sed s/sle1/sles1/` && xdsh $$CN "wget --no-cache http://xcat.org/files/xcat/repos/yum/devel/xcat-dep/$os/__GETNODEATTR($$CN,arch)__/repodata/repomd.xml"; fi - #Install additional packages on Ubuntu cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi @@ -34,12 +30,12 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #Set flag to accept install dependent packages by default on Ubuntu cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi -#Install devel version of xCAT +#Install devel version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh; lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -78,12 +74,12 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #Set flag to accept install dependent packages by default on Ubuntu cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi -#Install GA version of xCAT +#Install GA version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -122,21 +118,21 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #Set flag to accept install dependent packages by default on Ubuntu cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi -#Install GA version of xCAT +#Install GA version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running #Update to devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y update" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT updated successfully first time"; else echo "First attempt to update xCAT failed, attempting to update xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y update"; fi +check:output=~xCAT updated successfully first time|xCAT has been successfully updated +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 @@ -176,12 +172,12 @@ cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp - #Set flag to accept install dependent packages by default on Ubuntu cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi -#Install GA version of xCAT +#Install GA version of xCAT. If first attempt fails, try again cmd:xdsh $$CN "cd /; ./go-xcat -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" -check:rc==0 +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running @@ -195,8 +191,8 @@ check:output=~could not be found|dead|no such service xcatd #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" -check:rc==0 -cmd:xdsh $$CN "cat /tmp/go-xcat.log" +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat -y --xcat-version=devel install"; fi +check:output=~xCAT installed successfully first time|xCAT has been installed cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -a" check:rc==0 cmd:xdsh $$CN "service xcatd status" diff --git a/xCAT-test/autotest/testcase/imgimport/cases0 b/xCAT-test/autotest/testcase/imgimport/cases0 index 2683d62ec..5e71e7d07 100644 --- a/xCAT-test/autotest/testcase/imgimport/cases0 +++ b/xCAT-test/autotest/testcase/imgimport/cases0 @@ -9,17 +9,6 @@ check:output=~usage|Usage end -start:imgimport_v -os:Linux -description:imgimport -v and --version -label:others -cmd:imgimport -v -check:output=~version|Version -cmd:imgimport --version -check:output=~version|Version -end - - start:imgimport_bundlefile os:Linux description:imgimport foo.tgz diff --git a/xCAT-test/autotest/testcase/installation/compare_postscripts b/xCAT-test/autotest/testcase/installation/compare_postscripts new file mode 100644 index 000000000..049024101 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/compare_postscripts @@ -0,0 +1,16 @@ +start:compare_postscripts +os:Linux +label:provision +cmd:cd /install/postscripts; tar cvf /tmp/mn.tar * +cmd:xdsh $$CN "cd /xcatpost; tar cvf /tmp/cn.tar *" +cmd:scp $$CN:/tmp/cn.tar /tmp +cmd:xdsh $$CN "rm /tmp/cn.tar" +cmd:mkdir -p /tmp/mn; tar xvf /tmp/mn.tar -C /tmp/mn +cmd:mkdir -p /tmp/cn; tar xvf /tmp/cn.tar -C /tmp/cn; rm /tmp/cn/mypost* +cmd:diff -r /tmp/mn /tmp/cn > /tmp/diff.list +check:rc==0 +cmd:cat /tmp/diff.list +check:rc==0 + +cmd:rm -fr /tmp/mn; rm -fr /tmp/cn; rm /tmp/mn.tar; rm /tmp/diff.list +end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index b07c66ed2..3c8628865 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -20,7 +20,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +cmd:a=0;while true; do [ $a -eq 100 ] && { echo "After 100 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 @@ -106,7 +106,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +cmd:a=0;while true; do [ $a -eq 100 ] && { echo "After 100 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 5586630d4..f05480679 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -162,6 +162,8 @@ cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES cmd:if [[ "$$OS" =~ "sle" ]]; then zypper install -y squashfs; fi +cmd:fdisk -l +cmd:df -T cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~archive method:squashfs diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 new file mode 100644 index 000000000..94b30dd59 --- /dev/null +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -0,0 +1,239 @@ +start:restapi_setup_on_MN_CN +description: Set up the REST API on MN and CN +label:restapi +#Install the mod_ssl package on Red Hat +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi +check:rc==0 +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then service httpd restart; fi +check:rc==0 +#Configure the SLES environment +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then a2enmod ssl; a2enflag SSL; cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/vhost-ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/apache2/vhosts.d/vhost-ssl.conf; fi +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/apache2/vhosts.d/vhost-ssl.conf; fi +check:rc==0 +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then service apache2 restart; fi +check:rc==0 +cmd:scp /install/postscripts/ca/ca-cert.pem $$CN:/root +check:rc==0 +cmd:tabch key=xcat,username=__GETTABLEVALUE(key,system,username,passwd)__ passwd.password=__GETTABLEVALUE(key,system,password,passwd)__ +check:rc==0 +end + +start:restapi_cleanup_on_MN_CN +description: Clean up the REST API on MN and CN +label:restapi +cmd:xdsh $$CN "rm /root/ca-cert.pem" +check:rc==0 +cmd:tabch -d key=xcat passwd +check:rc==0 +#Remove the mod_ssl package on Red Hat +cmd:if cat /etc/*release | grep "Red Hat" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi +check:rc==0 +#Clean up the SLES environment +cmd:if cat /etc/*release | grep "SLES" >/dev/null; then rm /etc/apache2/vhosts.d/vhost-ssl.conf; service apache2 restart; fi +check:rc==0 +end + +start:restapi_list_all_resources +description: List all resources on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws?userName=$username&userPW=$password'" +check:rc==0 +check:output=~nodes +end + +start:restapi_list_globalconf +description: List globalconf on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/globalconf?debug=2&userName=$username&userPW=$password'" +check:rc==0 +check:output=~"tftpdir":"/tftpboot" +end + +start:restapi_list_groups +description: List groups on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;curl_v=`xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/groups?userName=$username&userPW=$password' | sed 's/\"//g' | sed 's/\[//' | sed 's/\]//'"`;lsdef -t group > list; tr -d '\n' < list > list1; sed -i 's/[[:blank:]][[:blank:]]/,/g' list1; sed -i 's/(group)//g' list1; sed -i 's/,$//' list1; sed -i 's/^/$$CN: /' list1; lsdef_v=`cat list1`; echo $curl_v; echo $lsdef_v; rm -f list list1; if [[ $curl_v = $lsdef_v ]]; then echo Match; else echo No-match; fi +check:rc==0 +check:output=~Match +end + +start:restapi_list_nodes +description: List nodes on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?&userName=$username&userPW=$password'" +check:rc==0 +check:output=~$$SN +end + +start:restapi_list_node_CN +description: Display details of the compute node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/$$CN?pretty=1&xcoll=1&userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__ +end + +start:restapi_list_networks +description: List networks on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s -k --cacert /root/ca-cert.pem 'https://$$MN/xcatws/networks?userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETTABLEVALUE(mtu,1500,netname,networks)__ +end + +start:restapi_list_osimages +description: List osimages on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/osimages?userName=$username&userPW=$password'" +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +end + +start:restapi_list_policy +description: List policies on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/policy?userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETTABLEVALUE(rule,trusted,priority,policy)__ +end + +start:restapi_create_temp_CN_put +description: Created a temporary compute node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"groups\":\"all\",\"mgt\":\"kvm\",\"vmmemory\":\"2048\"}'" +check:rc==0 +cmd:lsdef +check:output=~temp_node1 +end + +start:restapi_delete_temp_CN_put +description: Delete a temporary compute node with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password'" +check:rc==0 +cmd:lsdef +check:output!~temp_node1 +end + +start:restapi_delete_temp_CN_2 +description: Delete two temporary compute nodes with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X DELETE -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" +check:rc==0 +cmd:lsdef +check:output!~temp_node1 +end + +start:restapi_list_temp_CN_2 +description: List two temporary compute nodes with "curl -X DELETE" and with various range options +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node[1-2]/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1+1/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/all/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/mgt==kvm/nodels?userName=$username&userPW=$password'" +check:rc==0 +check:output=~temp_node1 +check:output=~temp_node2 +cmd:lsdef +check:output=~temp_node1 +check:output=~temp_node2 +end + +start:restapi_create_temp_CN_post +description: Created a temporary compute node with "curl -X POST" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X POST -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node2?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"groups\":\"all\",\"mgt\":\"kvm\",\"vmmemory\":\"2048\"}'" +check:rc==0 +cmd:lsdef +check:output=~temp_node2 +end + +start:restapi_add_id_temp_CN +description: Add an id field of a temporary compute node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"id\":\"100\"}'" +check:rc==0 +cmd:lsdef temp_node1 +check:output=~id=100 +end + +start:restapi_modify_vmmemory_temp_CN +description: Modify the vmmemory field of a temporary computer node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?xcoll=1&userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"vmmemory\":\"4096\"}'" +check:rc==0 +cmd:lsdef temp_node1 +check:output=~vmmemory=4096 +end + +start:restapi_delete_id_temp_CN +description: Delete the id field of a temporary compute node with "curl -X DELETE" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/temp_node1?userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"id\":\" \"}'" +check:rc==0 +cmd:lsdef temp_node1 +check:output!~id= +end + +start:restapi_show_temp_CN_osimage +description: Show the detail of the osimage of CN with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/osimages/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute?pretty=1&userName=$username&userPW=$password'" +check:rc==0 +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +end + +start:restapi_list_nodes_wrong_password +description: List nodes on the management node with an invalid password with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?userName=$username&userPW=invalid_password'" +check:rc==0 +check:output=~Authentication failure +end + +start:restapi_list_nodes_invalid_option +description: List nodes on the management node with an invalid option with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes?xyz=123&userName=$username&userPW=$password'" +check:rc==0 +end + +start:restapi_list_invalid_resource +description: List nodes on the management node with an invalid option with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/abc?userName=$username&userPW=invalid_password&xyz=123'" +check:rc==0 +check:output=~Unsupported resource +end + +start:restapi_list_wrong_osimage +description: List a wrong osimage on the management node with "curl -X GET" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X GET -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/osimages/wrong_image?userName=$username&userPW=$password'" +check:output=~Could not find an object named 'wrong_image' +end + +start:restapi_modify_wrong_field_CN +description: Modify the vmmemori field of the computer node with "curl -X PUT" +label:restapi +cmd:username=__GETTABLEVALUE(key,system,username,passwd)__;password=__GETTABLEVALUE(key,system,password,passwd)__;xdsh $$CN "curl -X PUT -s --cacert /root/ca-cert.pem 'https://$$MN/xcatws/nodes/$$CN?debug=1&userName=$username&userPW=$password' -H Content-Type:application/json --data '{\"vmmemori\":\"4096\"}'" +check:rc==0 +check:output=~'vmmemori' is not a valid attribute name for an object type +end diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 37837a98e..561ea7683 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -18,7 +18,7 @@ Attribute: $$CN-The operation object of rpower command label:cn_bmc_ready,hctrl_general #If rpower fails on the first try, try again with smaller memory -cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi +cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' VM with memory $memory failed with error ${out}. Trying with smaller memory $((memory-2048))."; rpower $$CN on; fi cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 5 ];then break;fi done cmd:rpower $$CN stat @@ -47,7 +47,7 @@ cmd:rpower $$CN stat check:output=~Not Activated|off # Display active VMs and memory on VM host cmd:vmhost=`lsdef $$CN -i vmhost -c | cut -d '=' -f 2`; if [[ ! -z $vmhost ]]; then echo "Memory on vmhost $vmhost"; ssh $vmhost free -m; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi -cmd:rpower $$CN boot +cmd:rpower_boot_out=`rpower $$CN boot`; if [[ $rpower_boot_out =~ qemu-kvm ]]; then echo "rpower boot failed with $rpower_boot_out. Will retry"; rpower $$CN boot; else echo "rpower boot success on first try: $rpower_boot_out"; exit 0; fi check:rc==0 cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend index 029878e6f..201a833ab 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend @@ -6,7 +6,7 @@ cmd: rm -rf /tmp/backend_test/ cmd:rm -rf ~/.xcatinv/inventory.cfg.bak.backend_init check: rc==0 cmd: mkdir -p ~/.xcatinv/ -cmd: [ -f ~/.xcatinv/inventory.cfg ] && mv ~/.xcatinv/inventory.cfg ~/.xcatinv/inventory.cfg.bak.backend_init +cmd: if [[ -f ~/.xcatinv/inventory.cfg ]]; then mv ~/.xcatinv/inventory.cfg ~/.xcatinv/inventory.cfg.bak.backend_init; fi cmd: cp /opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/templates/inventory.cfg ~/.xcatinv/inventory.cfg cmd: xcat-inventory init check: rc==0 @@ -86,7 +86,7 @@ check: output!=~ws cmd: XCATBYPASS=1 restorexCATdb -p /tmp/backend_test/backup/db check: rc==0 -cmd: [ -f "~/.xcatinv/inventory.cfg.bak.backend_init" ] && rm -rf "~/.xcatinv/inventory.cfg" && mv "~/.xcatinv/inventory.cfg.bak.backend_init" "~/.xcatinv/inventory.cfg" +cmd: if [[ -f "~/.xcatinv/inventory.cfg.bak.backend_init" ]]; then rm -rf "~/.xcatinv/inventory.cfg"; mv "~/.xcatinv/inventory.cfg.bak.backend_init" "~/.xcatinv/inventory.cfg"; fi cmd: rm -rf /tmp/backend_test/ end diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index f95a839b9..01ec0b777 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1867,9 +1867,11 @@ sub getvar { my $str = shift; my $config_ref = shift; + my @vars = ($str =~ /\$\$(\w+)/g); + my @reverse_sorted_vars = reverse sort @vars; - while ($str =~ /\$\$(\w+)/) { - my $varname = $1; + # let $$AA and $$A have the same chance to be replaced. + for my $varname (@reverse_sorted_vars) { if (exists($$config_ref{var}{$varname})) { $str =~ s/\$\$$varname/$$config_ref{var}{$varname}/g; } else { diff --git a/xCAT/postscripts/check_mlnx_firmware b/xCAT/postscripts/check_mlnx_firmware index 560c11436..79cc966b5 100755 --- a/xCAT/postscripts/check_mlnx_firmware +++ b/xCAT/postscripts/check_mlnx_firmware @@ -6,7 +6,7 @@ # BINARIES="ofed_info mst ibdev2netdev" for PROG in ${BINARIES}; do - RC=`command -v ${PROG} >> /dev/nul 2>&1; echo $?` + RC=`command -v ${PROG} >> /dev/null 2>&1; echo $?` if [[ ${RC} != 0 ]]; then echo "${PROG} is not installed on this node, unable to check firmware levels." exit 1 diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 76f1ce2a2..6644600e7 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -524,6 +524,7 @@ elif [ "$1" = "-s" ];then str_inst_mask='' str_inst_gateway='' str_inst_mtu='' + str_inst_dns='' if [ "$str_os_type" = "aix" ];then log_error "configeth on $NODE: aix does not support -s flag" exit 1 @@ -578,6 +579,7 @@ elif [ "$1" = "-s" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` + str_inst_dns=`grep domain-name-servers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` else if [ -n "$MACADDRESS" ];then str_inst_mac=$MACADDRESS @@ -734,6 +736,11 @@ elif [ "$1" = "-s" ];then if [ $networkmanager_active -eq 2 ]; then echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file fi + if [ -n "${str_inst_dns}" ];then + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name ipv4.dns ${str_inst_dns} + fi + fi if [ -n "${str_inst_mtu}" ];then if [ $networkmanager_active -eq 1 ]; then nmcli con modify $con_name mtu ${str_inst_mtu} diff --git a/xCAT/postscripts/enablecapi b/xCAT/postscripts/enablecapi index 64a67158b..abe114bb8 100644 --- a/xCAT/postscripts/enablecapi +++ b/xCAT/postscripts/enablecapi @@ -29,7 +29,7 @@ function logerr { #check if mlnx ofed commands are installed COMMANDS="ofed_info mst mlxconfig" for CMD in ${COMMANDS}; do - RC=`command -v ${CMD} >> /dev/nul 2>&1; echo $?` + RC=`command -v ${CMD} >> /dev/null 2>&1; echo $?` if [[ ${RC} != 0 ]]; then ERRMSG="Command: ${CMD} is not found, unable to run the scripts" logerr $ERRMSG diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 30349eb48..d5750fddd 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -58,11 +58,6 @@ if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then echo "ONBOOT=yes" >> $CONFFILE echo "IPADDR=$IP" >> $CONFFILE echo "NETMASK=$MASK" >> $CONFFILE - else - echo "DEVICE=$ETHX" > $CONFFILE - echo "BOOTPROTO=dhcp" >> $CONFFILE - echo "HWADDR=$MACX" >> $CONFFILE - echo "ONBOOT=yes" >> $CONFFILE fi fi @@ -222,6 +217,10 @@ EOF for i in $nfsvers do if [ $i -eq 3 ] && ! [ grep -w nfs /proc/filesystems >/dev/null 2>&1 ]; then + if (pmatch $OSVER "rhel8*") || (pmatch $OSVER "rhels8*");then + # For RHEL8 do not mount with vers=3 option + continue + fi nfsver=3 break elif [ $i -eq 4 ] && ! [ grep -w nfs4 /proc/filesystems >/dev/null 2>&1 ]; then diff --git a/xCAT/postscripts/getcredentials.awk b/xCAT/postscripts/getcredentials.awk index 67300becf..0cbf2fdfb 100755 --- a/xCAT/postscripts/getcredentials.awk +++ b/xCAT/postscripts/getcredentials.awk @@ -1,9 +1,19 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" + } else { + randombytes = "" + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) { - server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/getpostscript.awk b/xCAT/postscripts/getpostscript.awk index 985b34dcb..e4ffd3006 100755 --- a/xCAT/postscripts/getpostscript.awk +++ b/xCAT/postscripts/getpostscript.awk @@ -1,9 +1,19 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" + } else { + randombytes = "" + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 780b1da7b..c59d39592 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -756,9 +756,12 @@ function check_brctl() { function check_and_set_device_managed() { devname=$1 rc=1 + log_info "check_and_set_device_managed for device $devname" $nmcli device show $devname >/dev/null 2>/dev/null if [ $? -ne 0 ]; then log_error "Device $devname not found" + # Could not find the device we wanted. Display all devices + $nmcli device show else $nmcli -g GENERAL.STATE device show $devname|grep unmanaged >/dev/null 2>/dev/null if [ $? -eq 0 ]; then diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index c9af5345b..0c85ae262 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -1,9 +1,19 @@ #!/usr/bin/awk -f BEGIN { + if (!system("test -f /usr/bin/nice")) { + randombytes = "-rand /usr/bin/nice" + } else { + randombytes = "" + } + if (!system("test -f openssl")) { + print "Error: openssl utility missing" + exit 1 + } + if (ENVIRON["USEOPENSSLFORXCAT"]) { - server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " "randombytes" 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index ff2381495..51c16262c 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -304,8 +304,8 @@ fi # Do not even touch rsyslog.conf # There is no /etc/sysconfig/rsyslog file, so we use rsyslogd -v to get the version if [ -e "/sbin/rsyslogd" -o -e "/usr/sbin/rsyslogd" ]; then - SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` - SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` + SYSLOGPROD=`rsyslogd -v | grep rsyslogd |grep -v PID |awk {'print $1'}` + SYSLOGVER=`rsyslogd -v | grep rsyslogd |grep -v PID |awk {'print $2'}` if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then config_rsyslog_V8 #keep a record