diff --git a/.travis.yml b/.travis.yml index d8f18824b..a9ede4ae6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ os: linux -dist: xenial -sudo: required +dist: bionic before_install: -- sudo apt-get install -y git fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common +- sudo apt-get install -y git fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl libcgi-pm-perl quilt openssh-server dpkg looptools genometools software-properties-common - perl -v #- echo "yes" | sudo cpan -f -i Capture::Tiny diff --git a/Version b/Version index 0e7079b69..43c85e792 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.16.1 +2.16.2 diff --git a/docs/source/advanced/hierarchy/databases/index.rst b/docs/source/advanced/hierarchy/databases/index.rst index e7e1d6520..57551a075 100644 --- a/docs/source/advanced/hierarchy/databases/index.rst +++ b/docs/source/advanced/hierarchy/databases/index.rst @@ -1,6 +1,8 @@ Configure a Database ==================== +SQLite +------ xCAT uses the SQLite database (https://www.sqlite.org/) as the default database and it is initialized during xCAT installation of the Management Node. If using Service Nodes, SQLite **cannot** be used because Service Nodes require remote access to the xCAT database. One of the following databases should be used: * :ref:`mysql_reference_label` diff --git a/docs/source/advanced/hierarchy/databases/mysql_install.rst b/docs/source/advanced/hierarchy/databases/mysql_install.rst index ef6094a8e..9847bf094 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_install.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_install.rst @@ -82,7 +82,7 @@ Debian/Ubuntu mysql-server mysql-common libdbd-mysql-perl - libmysqlclient18 + libmysqlclient* mysql-client-5* mysql-client-core-5* mysql-server-5* diff --git a/docs/source/advanced/hierarchy/define_service_node.rst b/docs/source/advanced/hierarchy/define_service_node.rst index 3c2d8ec1f..f53430441 100644 --- a/docs/source/advanced/hierarchy/define_service_node.rst +++ b/docs/source/advanced/hierarchy/define_service_node.rst @@ -61,7 +61,7 @@ Now set some of the common attributes for the SNs at the group level: :: provmethod=rhels7-x86_64-install-service Add Service Nodes to the ``servicenode`` Table ------------------------------------------- +---------------------------------------------- An entry must be created in the ``servicenode`` table for each service node or the **service** group. This table describes all the services you would like xcat to diff --git a/docs/source/conf.py b/docs/source/conf.py index df334cef4..9dc81f2a9 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.16.1' +release = '2.16.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index bd09ac1d1..eb03b2018 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -33,7 +33,7 @@ The partition file must follow the partitioning syntax of the respective install * The file ``/root/anaconda-ks.cfg`` is a sample kickstart file created by RedHat installing during the installation process based on the options that you selected. * system-config-kickstart is a tool with graphical interface for creating kickstart files - * SLES: `Autoyast documentation `_ + * SLES: `Autoyast documentation `_ * Use yast2 autoyast in GUI or CLI mode to customize the installation options and create autoyast file * Use yast2 clone_system to create autoyast configuration file ``/root/autoinst.xml`` to clone an existing system @@ -384,7 +384,7 @@ Create a shell script that will be run on the node during the install process to The purpose of the partition script is to create the ``/tmp/partionfile`` that will be inserted into the kickstart/autoyast/preseed template, the script could include complex logic like select which disk to install and even configure RAID, etc -**Note**: the partition script feature is not thoroughly tested on SLES, there might be problems, use this feature on SLES at your own risk. +.. note:: the partition script feature is not thoroughly tested on SLES, there might be problems, use this feature on SLES at your own risk. .. END_Partition_Definition_Script_Create_partition_script_content @@ -460,7 +460,7 @@ Run below commands to associate partition script with osimage: :: - The ``s:`` preceding the filename tells nodeset that this is a script. - For RedHat, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will add the execution of the contents of this script to the %pre section of that file. The ``nodeset`` command will then replace the ``#XCAT_PARTITION_START#...#XCAT_PARTITION_END#`` directives from the osimage template file with ``%include /tmp/partitionfile`` to dynamically include the tmp definition file your script created. - - For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will replace the ``#XCA_PARTMAN_RECIPE_SCRIPT#`` directive and add the execution of the contents of this script to the ``/install/autoinst/.pre``, the ``/install/autoinst/.pre`` script will be run in the preseed/early_command. +- For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will replace the ``#XCA_PARTMAN_RECIPE_SCRIPT#`` directive and add the execution of the contents of this script to the ``/install/autoinst/.pre``, the ``/install/autoinst/.pre`` script will be run in the preseed/early_command. .. END_Partition_Definition_Script_Associate_partition_script_with_osimage_common diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst index 19d232d97..2a31a51cc 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/driver_update_disk.rst @@ -19,7 +19,7 @@ No matter which approach chosen, there are two steps to make new drivers work. o There are two approaches for xCAT to find the driver disk (pick one): -#. Specify the location of the driver disk in the osimage object (*This is ONLY supported in 2.8 and later*) +#. Specify the location of the driver disk in the osimage object (*This is ONLY supported in xCAT 2.8 and later*) The value for the 'driverupdatesrc' attribute is a comma separated driver disk list. The tag 'dud' must be specified before the full path of 'driver update disk' to specify the type of the file: :: @@ -66,14 +66,16 @@ If 'osupdatename' is specified, the kernel shipped with the 'osupdatename' will - If specifying the driver disk location in the osimage, there are two ways to inject drivers: - #. :: + #. Using nodeset command only: :: + nodeset osimage= - #. :: + #. Using geninitrd with nodeset command: :: + geninitrd nodeset osimage= --noupdateinitrd -**Note:** 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for a diskful node. 'geninitrd' only needs be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. +.. note:: 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for a diskful node. 'geninitrd' only needs be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. - If putting the driver disk in /driverdisk//: @@ -94,7 +96,7 @@ There are two ways to inject drivers: geninitrd [--ignorekernelchk] nodeset osimage= --noupdateinitrd -**Note:** 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for diskful nodes. 'geninitrd' only needs to be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. +.. note:: 'geninitrd' + 'nodeset --noupdateinitrd' is useful when you need to run nodeset frequently for diskful nodes. 'geninitrd' only needs to be run once to rebuild the initrd and 'nodeset --noupdateinitrd' will not touch the initrd and kernel in /tftpboot/xcat/osimage//. The option '--ignorekernelchk' is used to skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. To use this flag, you should make sure the drivers in the driver rpms are usable for the target kernel. .. END_inject_into_initrd__for_diskful_for_RPM diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst index 2fa03bed8..48bc9e559 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst @@ -1,8 +1,5 @@ .. _Using-Postscript-label: -Using Postscript ----------------- - xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. Types of scripts @@ -358,7 +355,7 @@ THE ``#NETWORK_FOR_DISKLESS_EXPORT#`` line will provide diskless networks inform .. #NETWORK_FOR_DISKLESS_EXPORT# -Note: the ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode -P syslog``. +.. note:: The ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode -P syslog``. The ``#INCLUDE_POSTSCRIPTS_LIST#`` flag provides a list of postscripts defined for this ``$NODE``. :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst index 4ca419812..390b30ed0 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/pre_script.rst @@ -26,7 +26,7 @@ Identify the scripts to be run for each node by adding entries to the prescripts Format for naming prescripts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The general format for the prescripts-begin or prescripts-end attribute is: :: +The general format for the ``prescripts-begin`` or ``prescripts-end`` attribute is: :: [action1:]s1,s2...[|action2:s3,s4,s5...] @@ -42,19 +42,17 @@ If actions are omitted, the scripts apply to all actions. Examples: - * myscript1,myscript2 - run scripts for all supported commands - * install:myscript1,myscript2|netboot:myscript3 + * ``myscript1,myscript2`` - run scripts for all supported commands + * ``install:myscript1,myscript2|netboot:myscript3`` - Run scripts ``myscript1`` and ``myscript2`` for nodeset(install), runs ``myscript3`` for nodeset(netboot). -Run scripts 1,2 for nodeset(install), runs script3 for nodeset(netboot). - -All the scripts should be copied to /install/prescripts directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local /install directory (i.e. /install is not mounted from the xCAT management node to the service nodes), you will need to synchronize your /install/prescripts directory to your service node anytime you create new scripts or make changes to existing scripts. +All the scripts should be copied to ``/install/prescripts`` directory and made executable for root and world readable for mounting. If you have service nodes in your cluster with a local ``/install`` directory (i.e. ``/install`` is not mounted from the xCAT management node to the service nodes), you will need to synchronize your ``/install/prescripts`` directory to your service node anytime you create new scripts or make changes to existing scripts. The following two environment variables will be passed to each script: - * NODES - a comma separated list of node names on which to run the script - * ACTION - current nodeset action. + * ``NODES`` - a comma separated list of node names on which to run the script + * ``ACTION`` - current nodeset action. -By default, the script will be invoked once for all nodes. However, if **'#xCAT setting:MAX_INSTANCE=number'** is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in **number** will be invoked at at a time. +By default, the script will be invoked once for all nodes. However, if ``#xCAT setting:MAX_INSTANCE=`` is specified in the script, the script will be invoked for each node in parallel, but no more than number of instances specified in ```` will be invoked at a time. Exit values for prescripts ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -67,7 +65,7 @@ If there is no error, a prescript should return with 0. If an error occurs, it s If one of the prescripts returns 1, the command will finish the rest of the prescripts in that section and then exit out with value 1. For example, a node has three begin prescripts s1,s2 and s3, three end prescripts s4,s5,s6. If s2 returns 1, the prescript s3 will be executed, but other code and the end prescripts will not be executed by the command. -If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have **'#xCAT setting:MAX_INSTANCE=number'**. +If one of the prescripts returns 2 or greater, then the command will exit out immediately. This only applies to the scripts that do not have ``#xCAT setting:MAX_INSTANCE=``. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst index e31ba49b8..4b35ba62c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst @@ -72,7 +72,7 @@ You can use the ``updatenode`` command to perform the following functions after * Rerun postscripts defined in the postscripts table. * Run any additional postscript one time. -Go to :ref:`Using-Postscript-label` to see how to configure postscript. +Go to :ref:`Using Postscript ` to see how to configure postscript. Go to :ref:`Using-Prescript-label` to see how to configure prepostscript. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst new file mode 100644 index 000000000..11e0c6c18 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/postscript_execution.rst @@ -0,0 +1,27 @@ + +Using Postscript +---------------- + +Postscript Execution Order Summary +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++-----------------------------------------------------------------------------------+ +| Diskful | ++----------------+-------------------------+----------------------------------------+ +| Stage | Scripts | Execute Order | ++================+=========================+========================================+ +| N/A | postinstall | Does not execute for diskfull install | ++----------------+-------------------------+---+------------------------------------+ +| Install/Create | | 1 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | postscripts | 2 | osimage | +| | (execute before reboot) +---+------------------------------------+ +| | | 3 | node | ++----------------+-------------------------+---+------------------------------------+ +| Boot/Reboot | postbootscripts | 4 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | | 5 | osimage | +| | +---+------------------------------------+ +| | | 6 | node | ++----------------+-------------------------+---+------------------------------------+ + +.. include:: ../../../common/deployment/prepostscripts/post_script.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst index f281030d5..150d397de 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/pre_post_script.rst @@ -5,6 +5,6 @@ Prescripts and Postscripts :maxdepth: 2 ../../../common/deployment/prepostscripts/pre_script.rst - ../../../common/deployment/prepostscripts/post_script.rst + ./postscript_execution.rst ../../../common/deployment/prepostscripts/suggestions.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst new file mode 100644 index 000000000..16bab9fa3 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/postscript_execution.rst @@ -0,0 +1,28 @@ + +Using Postscript +---------------- + +Postscript Execution Order Summary +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ++---------------------------------------------------------------------------+ +| Diskless | ++----------------+-----------------+----------------------------------------+ +| Stage | Scripts | Execute Order | ++================+=================+========================================+ +| Install/Create | postinstall | genimage, after packages are installed | ++----------------+-----------------+---+------------------------------------+ +| Boot/Reboot | | 1 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | postscripts | 2 | osimage | +| | +---+------------------------------------+ +| | | 3 | node | +| +-----------------+---+------------------------------------+ +| | postbootscripts | 4 | postscripts.xcatdefaults | +| | +---+------------------------------------+ +| | | 5 | osimage | +| | +---+------------------------------------+ +| | | 6 | node | ++----------------+-----------------+---+------------------------------------+ + +.. include:: ../../../common/deployment/prepostscripts/post_script.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst index f186b874c..e9502ad3e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script.rst @@ -5,7 +5,7 @@ Prescripts and Postscripts :maxdepth: 2 ../../../common/deployment/prepostscripts/pre_script.rst - ../../../common/deployment/prepostscripts/post_script.rst + ./postscript_execution.rst ../../../common/deployment/prepostscripts/postinstall_script.rst ../../../common/deployment/prepostscripts/suggestions.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 10b395b81..5f784f157 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -19,7 +19,7 @@ Open a console to ``compute1``: :: rcons compute1 -**Note:** The keystroke ``ctrl+e c .`` will disconnect you from the console. +.. note:: The keystroke ``ctrl+e c .`` will disconnect you from the console. Troubleshooting @@ -30,14 +30,14 @@ General ``xCAT`` has been integrated with 3 kinds of console server service, they are - - `conserver `_ + - `conserver `_ **[Deprecated]** - `goconserver `_ - `confluent `_ ``rcons`` command relies on one of them. The ``conserver`` and ``goconserver`` packages should have been installed with xCAT as they are part of the xCAT -dependency packages. If you hope to try ``confluent``, -see `confluent `_. +dependency packages. If you want to try ``confluent``, +see :doc:`confluent server `. For systemd based systems, ``goconserver`` is used by default. If you are having problems seeing the console, try the following. @@ -56,7 +56,7 @@ having problems seeing the console, try the following. #. Invoke the console again: ``rcons `` -More details for goconserver, see `goconserver documentation `_. +More details for goconserver, see :doc:`goconserver documentation `. **[Deprecated]** If ``conserver`` is used, try the following. diff --git a/docs/source/guides/admin-guides/references/man1/genimage.1.rst b/docs/source/guides/admin-guides/references/man1/genimage.1.rst index d28fd3880..85107fe69 100644 --- a/docs/source/guides/admin-guides/references/man1/genimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/genimage.1.rst @@ -33,14 +33,13 @@ DESCRIPTION Generates a stateless and a statelite image that can be used to boot xCAT nodes in a diskless mode. -genimage will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings, and will be written back to the osimage definition. +\ **genimage**\ will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings and will be written back to the osimage definition. If \ **genimage**\ runs on the management node, both the \ *osimage*\ table and \ *linuximage*\ table will be updated with the given values from the options. -The \ **genimage**\ command will generate two initial ramdisks for \ **stateless**\ and \ **statelite**\ , one is \ **initrd-stateless.gz**\ , the other one is \ **initrd-statelite.gz**\ . +The \ **genimage**\ command will generate two initial ramdisks, \ **initrd-stateless.gz**\ for \ **stateless**\ mode, and \ **initrd-statelite.gz**\ for \ **statelite**\ mode. -After your image is generated, you can chroot to the -image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. +After your image is generated, you can chroot to the image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. for stateless: \ **packimage**\ @@ -50,8 +49,7 @@ Besides prompting for some parameter values, the \ **genimage**\ command takes If \ **-**\ **-onlyinitrd**\ is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. -The \ **genimage**\ command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be -used on. If the management node is not the same architecture or same distro level, copy the contents of +The \ **genimage**\ command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be used on. If the management node is not the same architecture or same distro level, copy the contents of /opt/xcat/share/xcat/netboot/ to a system that is the proper architecture, and mount /install from the management node to that system. Then change directory to /opt/xcat/share/xcat/netboot/ and run ./genimage. @@ -72,13 +70,13 @@ OPTIONS \ **-a**\ \ *arch*\ - The hardware architecture of this node: x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. + The hardware architecture of this node: ppc64le, x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. \ **-o**\ \ *osver*\ - The operating system for the image: fedora8, rhel5, sles10, etc. The OS packages must be in + The operating system for the image: rhels8.2.0, sle15, ubuntu18.04.2, etc. The OS packages must be in /install// (use copycds(8)|copycds.8). @@ -121,10 +119,9 @@ OPTIONS Regenerates the initrd for a stateless image to be used for a diskless install. - Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/stateli - te mode. + Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/statelite mode. - The \ **genimage -**\ **-onlyinitrd**\ command will generate two initial ramdisks, one is \ **initrd-statelite.gz**\ for \ **statelite**\ mode, the other one is \ **initrd-stateless.gz**\ for \ **stateless**\ mode. + The \ **genimage -**\ **-onlyinitrd**\ command will generate two initial ramdisks, \ **initrd-stateless.gz**\ for \ **stateless**\ mode, and \ **initrd-statelite.gz**\ for \ **statelite**\ mode. diff --git a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst index 49732546a..7ec1fd495 100644 --- a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst @@ -19,7 +19,7 @@ xdcp.1 **************** -\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command] [\ \*\*-R\*\*\ ] [\ \*\*-t\*\*\ \ \*timeout\*\ ] [\ \*\*-T\*\*\ ] [\ \*\*-v\*\*\ ] [\ \*\*-q\*\*\ ] [\ \*\*-X\*\*\ \ \*env_list\*\ ] \ \*sourcefile.... targetpath\*\ *\ +\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *user_ID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command*\ ] [\ **-R**\ ] [\ **-t**\ \ *timeout*\ ] [\ **-T**\ ] [\ **-v**\ ] [\ **-q**\ ] [\ **-X**\ \ *env_list*\ ] \ *sourcefile.... targetpath*\ \ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsynclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] @@ -46,7 +46,7 @@ If the Management Node is target node, it must be defined in the xCAT database w \ **REMOTE**\ \ **USER**\ : -A user_ID can be specified for the remote copy command. Remote user +A \ *user_ID*\ can be specified for the remote copy command. Remote user specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. See the \ **xdsh**\ command for more information. @@ -165,8 +165,8 @@ standard output or standard error is displayed. \ **-P | -**\ **-pull**\ Pulls (copies) the files from the targets and places them in - the \ *targetpath*\ directory on the local host. The \ *targetpath*\ - must be a directory. Files pulled from remote machines have + the \ *targetpath*\ directory on the local host. The \ *targetpath*\ must + be a directory. Files pulled from remote machines have \ **._target**\ appended to the file name to distinguish between them. When the \ **-P**\ flag is used with the \ **-R**\ flag, \ **._target**\ is appended to the directory. Only one file per invocation of the @@ -201,7 +201,7 @@ standard output or standard error is displayed. -\ **-R | -**\ **-recursive**\ \ *recursive*\ +\ **-R | -**\ **-recursive**\ Recursively copies files from a local directory to the remote targets, or when specified with the \ **-P**\ flag, recursively pulls diff --git a/docs/source/guides/admin-guides/references/man5/bootparams.5.rst b/docs/source/guides/admin-guides/references/man5/bootparams.5.rst index 13f261616..6fd7195df 100644 --- a/docs/source/guides/admin-guides/references/man5/bootparams.5.rst +++ b/docs/source/guides/admin-guides/references/man5/bootparams.5.rst @@ -56,7 +56,7 @@ bootparams Attributes: \ **kcmdline**\ - Arguments to be passed to the kernel + (Deprecated, use addkcmdline instead) Arguments to be passed to the kernel. diff --git a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst index 11bbee003..5ac845089 100644 --- a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst +++ b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst @@ -62,13 +62,13 @@ openbmc Attributes: \ **username**\ - The BMC userid. + The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default. \ **password**\ - The BMC password. + The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default. diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 45b7d3f85..72c006ac8 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -85,7 +85,7 @@ group Attributes: or - The BMC password. + The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -141,7 +141,7 @@ group Attributes: or - The BMC userid. + The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -459,7 +459,7 @@ group Attributes: \ **kcmdline**\ (bootparams.kcmdline) - Arguments to be passed to the kernel + (Deprecated, use addkcmdline instead) Arguments to be passed to the kernel. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index e8ae749db..5bece505e 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -97,7 +97,7 @@ node Attributes: or - The BMC password. + The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -153,7 +153,7 @@ node Attributes: or - The BMC userid. + The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default. @@ -471,7 +471,7 @@ node Attributes: \ **kcmdline**\ (bootparams.kcmdline) - Arguments to be passed to the kernel + (Deprecated, use addkcmdline instead) Arguments to be passed to the kernel. diff --git a/docs/source/guides/admin-guides/references/man8/copycds.8.rst b/docs/source/guides/admin-guides/references/man8/copycds.8.rst index 37c399113..5e4af8f43 100644 --- a/docs/source/guides/admin-guides/references/man8/copycds.8.rst +++ b/docs/source/guides/admin-guides/references/man8/copycds.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **copycds**\ [{\ **-n|-**\ **-name|-**\ **-osver**\ }=\ *distroname*\ ] [{\ **-a|-**\ **-arch**\ }=\ *architecture*\ ] [{\ **-p|-**\ **-path**\ }=\ *ospkgpath*\ ] [\ **-o | -**\ **-noosimage**\ ] [\ **-w | -**\ **-nonoverwrite**\ ] {\ *iso | device-path*\ } ... +\ **copycds**\ [{\ **-n|-**\ **-name|-**\ **-osver**\ } \ *distroname*\ ] [{\ **-a|-**\ **-arch**\ } \ *architecture*\ ] [{\ **-p|-**\ **-path**\ } \ *ospkgpath*\ ] [\ **-o | -**\ **-noosimage**\ ] [\ **-w | -**\ **-nonoverwrite**\ ] {\ *iso | device-path*\ } ... \ **copycds**\ [\ **-i | -**\ **-inspection**\ ] {\ *iso | device-path*\ } @@ -44,19 +44,19 @@ OPTIONS -\ **-n|-**\ **-name|-**\ **-osver**\ =\ *distroname*\ +\ **-n|-**\ **-name|-**\ **-osver**\ \ *distroname*\ The linux distro name and version that the ISO/DVD contains. Examples: rhels6.3, sles11.2, fedora9. Note the 's' in rhels6.3 which denotes the Server version of RHEL, which is typically used. -\ **-a|-**\ **-arch**\ =\ *architecture*\ +\ **-a|-**\ **-arch**\ \ *architecture*\ The architecture of the linux distro on the ISO/DVD. Examples: x86, x86_64, ppc64, s390x. -\ **-p|-**\ **-path**\ =\ *ospkgpath*\ +\ **-p|-**\ **-path**\ \ *ospkgpath*\ The destination directory to which the contents of ISO/DVD will be copied. When this option is not specified, the default destination directory will be formed from the \ **installdir**\ site table attribute and the distro name and architecture, for example: /install/rhel6.3/x86_64. This option is only supported for distributions of sles, redhat and windows. diff --git a/docs/source/guides/admin-guides/references/man8/makedns.8.rst b/docs/source/guides/admin-guides/references/man8/makedns.8.rst index a97c1401a..37e266219 100644 --- a/docs/source/guides/admin-guides/references/man8/makedns.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makedns.8.rst @@ -33,7 +33,7 @@ DESCRIPTION \ **makedns**\ configures a DNS server on the system you run it on, which is typically the xCAT management node. -The list of nodes to include comes from either the \ **noderange**\ provided on the command line or the entries in the local /etc/hosts files. +The list of nodes to include comes from either the \ **noderange**\ provided on the command line or the entries in the local \ */etc/hosts*\ files. There are several bits of information that must be included in the xCAT database before running this command. @@ -45,12 +45,11 @@ An xCAT \ **network**\ definition must be defined for each network used in the A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definition corresponding to the node or in the \ **site**\ definition. -Only entries in /etc/hosts or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. +Only entries in \ */etc/hosts*\ or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. -By default, \ **makedns**\ sets up the \ **named**\ service and updates the DNS records on the local system (management node). If the -e flag is specified, it will also update the DNS records on any external DNS server that is listed in the /etc/resolv.conf on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) +By default, \ **makedns**\ sets up the \ **named**\ service and updates the DNS records on the local system (management node). If the \ **-e**\ flag is specified, it will also update the DNS records on any external DNS server that is listed in the \ */etc/resolv.conf*\ on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) -For more information on Cluster Name Resolution: -Cluster_Name_Resolution +For more information on Cluster Name Resolution see https://xcat-docs.readthedocs.io/en/stable/advanced/domain_name_resolution/domain_name_resolution.html ******* @@ -79,13 +78,13 @@ OPTIONS \ **-e | -**\ **-external**\ - Update DNS records to the external DNS server listed in /etc/resolv.conf. + Update DNS records to the external DNS server listed in \ */etc/resolv.conf*\ . - Enabling the site attribute \ *externaldns*\ means use 'external' DNS by default. If setting \ *externaldns*\ to 1, you need NOT use \ **-e**\ flag in every makedns call. + Enabling the site attribute \ *externaldns*\ means use 'external' DNS by default. If setting \ *externaldns*\ to 1, you need NOT use \ **-e**\ flag in every \ **makedns**\ call. -\ **noderange**\ +\ *noderange*\ A set of comma delimited node names and/or group names. See the "noderange" man page for details on additional supported formats. diff --git a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst index 6cead8f4d..0ee0733c3 100644 --- a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst @@ -35,9 +35,9 @@ The \ **makenetworks**\ command can be used to gather network information from Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save that information in the xCAT database. -You can use the "-d" option to display the network information without writing it to the database. +You can use the \ **-d**\ option to display the network information without writing it to the database. You can also redirect the output to a file that can be used with the xCAT \ **mkdef**\ command to define the networks. @@ -53,9 +53,9 @@ For example: This features allows you to verify and modify the network information before writing it to the database. -When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the mkdef, chdef, lsdef, and rmdef commands to manage this data. +When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the \ **mkdef**\ , \ **chdef**\ , \ **lsdef**\ , and \ **rmdef**\ commands to manage this data. -The default naming convention is to use a hyphen separated "net" and "mask" value with the "." replace by "_". (ex. "8_124_47_64-255_255_255_0") +The default naming convention is to use a hyphen separated "net" and "mask" values with the "." replaced by "_". (ex. "8_124_47_64-255_255_255_0") You can also modify the xCAT "networks" database table directly using the xCAT \ **tabedit**\ command. @@ -121,13 +121,19 @@ EXAMPLES makenetworks -d - The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the lsdef, mkdef, chdef and rmdef commands. + The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the \ **lsdef**\ , \ **mkdef**\ , \ **chdef**\ and \ **rmdef**\ commands. + + + .. code-block:: perl + + 9_114_37_0-255_255_255_0: + objtype=network + gateway=9.114.37.254 + mask=255.255.255.0 + net=9.114.37.0 + mgtifname=ens3 + mtu=1500 - 9_114_37_0-255_255_255_0: - objtype=network - gateway=9.114.37.254 - mask=255.255.255.0 - net=9.114.37.0 diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index ae69165bc..9e9a9778c 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,3 +1,4 @@ Version,Release Date,New OS Supported,Release Notes +2.16.2,2021-05-25,"RHEL 8.3",`2.16.2 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/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index d4b2d2470..7f7145113 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -330,7 +330,7 @@ passed as argument rather than by table value', 'node' => 'The node or group name', 'kernel' => 'The kernel that network boot actions should currently acquire and use. Note this could be a chained boot loader such as memdisk or a non-linux boot loader', 'initrd' => 'The initial ramdisk image that network boot actions should use (could be a DOS floppy or hard drive image if using memdisk as kernel)', - 'kcmdline' => 'Arguments to be passed to the kernel', + 'kcmdline' => '(Deprecated, use addkcmdline instead) Arguments to be passed to the kernel.', 'addkcmdline' => 'User specified kernel options for os provision process(no prefix) or the provisioned os(with prefix "R::"). The options should be delimited with spaces(" ")', 'dhcpstatements' => 'xCAT manipulated custom dhcp statements (not intended for user manipulation)', 'adddhcpstatements' => 'Custom dhcp statements for administrator use (not implemneted yet)', @@ -452,8 +452,8 @@ passed as argument rather than by table value', bmc => 'The hostname of the BMC adapter.', consport => 'The console port for OpenBMC.', taggedvlan => 'bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.', - username => 'The BMC userid.', - password => 'The BMC password.', + username => 'The BMC userid. If not specified, the key=openbmc row in the passwd table is used as the default.', + password => 'The BMC password. If not specified, the key=openbmc row in the passwd table is used as the default.', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 5f3b2724f..445cf5eab 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -135,6 +135,8 @@ our %distnames = ( "1299104542.844706" => "SL6", #x86_64 DVD ISO "1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install + "1529960248.065311" => "ol6.10", # x86_64, Oracle Linux 6.10 + "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM ); diff --git a/travis.pl b/travis.pl index abcf39047..5cab615ec 100644 --- a/travis.pl +++ b/travis.pl @@ -327,10 +327,10 @@ sub install_xcat{ my @cmds = ("cd ./../../xcat-core && sudo ./mklocalrepo.sh", "sudo chmod 777 /etc/apt/sources.list", - "sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list", - "sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep bionic main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep bionic main\" >> /etc/apt/sources.list", "sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -", - "sudo apt-get -qq update"); + "sudo apt-get -qq --allow-insecure-repositories update"); my @output; foreach my $cmd (@cmds){ print "[install_xcat] running $cmd\n"; diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 588db7011..3d0cd6fcf 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -148,30 +148,6 @@ if (-e "/etc/debian_version") { # determine whether redhat or sles $::linuxos = xCAT::Utils->osver(); -# SLES SP 1 -my $sp1flag; - -# if linuxos==sles12 -if ($::linuxos == "sles12") { - - # open /etc/os-release - my @lines; - my $relfile; - $sp1flag = 0; - open($relfile, "<", "/etc/os-release"); - - # parse lines - @lines = <$relfile>; - close($relfile); - chomp(@lines); - - # for sles12.x - $sp1flag = 1; -} - -# set flag -# SLES SP 1 - # is this MariaDB or MySQL $::MariaDB = 0; my $cmd; @@ -226,28 +202,24 @@ if (grep(/$mysqlcheck/, @output)) $::mysqlrunning = 1; } -#for ubuntu 14, after install mysql/maria server, the mysql will running -#need to stop mysql in order to setup init xcat mysql -if ($::debianflag or $sp1flag) { - $cmd = "pidof mysqld"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC == 0) +# Stop mysql in order to setup init xcat mysql +$cmd = "pidof mysqld"; +xCAT::Utils->runcmd($cmd, -1); +if ($::RUNCMD_RC == 0) +{ + if ($::INIT) { - if ($::INIT) + my $ret = xCAT::Utils->stopservice("mysql"); + if ($ret != 0) { - my $ret = xCAT::Utils->stopservice("mysql"); - if ($ret != 0) - { - xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb."); - exit(1); - } - } - else { - $::mysqlrunning = 1; + xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb."); + exit(1); } + } else { + $::mysqlrunning = 1; } - } + if (-e ("/etc/xcat/cfgloc")) # check to see if xcat is using mysql { # cfgloc exists $cmd = "fgrep mysql /etc/xcat/cfgloc"; @@ -928,14 +900,12 @@ sub initmysqldb } $cmd = "$sqlcmd --user=mysql"; - #on rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip, - #but it's available at the /usr/bin/resolveip - if ($::linuxos == "rhels7.7") { - my $resolveip="/usr/libexec/resolveip"; - if (!(-x ($resolveip))) { - my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; - xCAT::Utils->runcmd($linkcmd, 0); - } + # On rhels7.7, /usr/bin/mysql_install_db requires /usr/libexec/resolveip + # Link it to /usr/bin/resolveip for all OSes, just in case some future releases have the same requirement + my $resolveip="/usr/libexec/resolveip"; + if (!(-x ($resolveip))) { + my $linkcmd="ln -s /usr/bin/resolveip $resolveip"; + xCAT::Utils->runcmd($linkcmd, 0); } } xCAT::Utils->runcmd($cmd, 0); @@ -1012,10 +982,8 @@ sub mysqlstart for ($i = 0 ; $i < 12 ; $i++) { my @output = xCAT::Utils->runcmd($cmd, 0); - my $mysqlcheck = "--datadir"; # see if really running - if ($::debianflag or $sp1flag) { - $mysqlcheck = "mysqld"; - } + $mysqlcheck = "mysqld"; + if (grep(/$mysqlcheck/, @output)) { sleep 10; # give a few extra seconds to be sure @@ -1027,7 +995,7 @@ sub mysqlstart } } xCAT::MsgUtils->message("E", - " Could not start the mysql daemon, in time allocated ( 2minutes)"); + " Could not start the mysql daemon, in time allocated (2 minutes)"); exit(1); } diff --git a/xCAT-client/pods/man1/genimage.1.pod b/xCAT-client/pods/man1/genimage.1.pod index 56dfb2af1..8145a637e 100644 --- a/xCAT-client/pods/man1/genimage.1.pod +++ b/xCAT-client/pods/man1/genimage.1.pod @@ -16,14 +16,13 @@ B [B<-h> | B<--help> | B<-v> | B<--version>] Generates a stateless and a statelite image that can be used to boot xCAT nodes in a diskless mode. -genimage will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings, and will be written back to the osimage definition. +B will use the osimage definition for information to generate this image. Additional options specified on the command line will override any corresponding previous osimage settings and will be written back to the osimage definition. If B runs on the management node, both the I table and I table will be updated with the given values from the options. -The B command will generate two initial ramdisks for B and B, one is B, the other one is B. +The B command will generate two initial ramdisks, B for B mode, and B for B mode. -After your image is generated, you can chroot to the -image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. +After your image is generated, you can chroot to the image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment. for stateless: B @@ -33,8 +32,7 @@ Besides prompting for some parameter values, the B command takes defau If B<--onlyinitrd> is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. -The B command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be -used on. If the management node is not the same architecture or same distro level, copy the contents of +The B command must be run on a system that is the same architecture and same distro with same major release version as the nodes it will be used on. If the management node is not the same architecture or same distro level, copy the contents of /opt/xcat/share/xcat/netboot/ to a system that is the proper architecture, and mount /install from the management node to that system. Then change directory to /opt/xcat/share/xcat/netboot/ and run ./genimage. @@ -50,11 +48,11 @@ I specifies the name of an os image definition to be used. The specif =item B<-a> I -The hardware architecture of this node: x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. +The hardware architecture of this node: ppc64le, x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used. =item B<-o> I -The operating system for the image: fedora8, rhel5, sles10, etc. The OS packages must be in +The operating system for the image: rhels8.2.0, sle15, ubuntu18.04.2, etc. The OS packages must be in /install// (use L). =item B<-p> I @@ -88,10 +86,9 @@ The maximum size allowed for the root file system in the image. Specify in byte Regenerates the initrd for a stateless image to be used for a diskless install. -Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/stateli -te mode. +Regenerates the initrd that is part of a stateless/statelite image that is used to boot xCAT nodes in a stateless/statelite mode. -The B command will generate two initial ramdisks, one is B for B mode, the other one is B for B mode. +The B command will generate two initial ramdisks, B for B mode, and B for B mode. =item B<--permission> I diff --git a/xCAT-client/pods/man1/xdcp.1.pod b/xCAT-client/pods/man1/xdcp.1.pod index bd41741bc..3ce346d34 100644 --- a/xCAT-client/pods/man1/xdcp.1.pod +++ b/xCAT-client/pods/man1/xdcp.1.pod @@ -4,7 +4,7 @@ B - Concurrently copies files to or from multiple nodes. In addition, prov =head1 B -B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I +B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-R>] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I B I [B<-F> I] [B<-r> I] @@ -28,7 +28,7 @@ If the Management Node is target node, it must be defined in the xCAT database w B B: -A user_ID can be specified for the remote copy command. Remote user +A I can be specified for the remote copy command. Remote user specification is identical for the B and B commands. See the B command for more information. @@ -130,8 +130,8 @@ the configured remote copy command. =item B<-P>|B<--pull> Pulls (copies) the files from the targets and places them in -the I directory on the local host. The I -must be a directory. Files pulled from remote machines have +the I directory on the local host. The I must +be a directory. Files pulled from remote machines have B<._target> appended to the file name to distinguish between them. When the B<-P> flag is used with the B<-R> flag, B<._target> is appended to the directory. Only one file per invocation of the @@ -162,7 +162,7 @@ Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B 3) if the destination file specified in synclist file is an existing directory on target node, B will fail with "scp: : Is a directory" -=item B<-R>|B<--recursive> I +=item B<-R>|B<--recursive> Recursively copies files from a local directory to the remote targets, or when specified with the B<-P> flag, recursively pulls diff --git a/xCAT-client/pods/man8/makedns.8.pod b/xCAT-client/pods/man8/makedns.8.pod index 047adc2fe..b6a46014e 100644 --- a/xCAT-client/pods/man8/makedns.8.pod +++ b/xCAT-client/pods/man8/makedns.8.pod @@ -14,7 +14,7 @@ B [B<-V>|B<--verbose>] [B<-e>|B<--external>] [B<-d>|B<--delete> I configures a DNS server on the system you run it on, which is typically the xCAT management node. -The list of nodes to include comes from either the B provided on the command line or the entries in the local /etc/hosts files. +The list of nodes to include comes from either the B provided on the command line or the entries in the local I files. There are several bits of information that must be included in the xCAT database before running this command. @@ -26,12 +26,11 @@ An xCAT B definition must be defined for each network used in the clust A network B and B values must be provided either in the B definition corresponding to the node or in the B definition. -Only entries in /etc/hosts or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. +Only entries in I or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. -By default, B sets up the B service and updates the DNS records on the local system (management node). If the -e flag is specified, it will also update the DNS records on any external DNS server that is listed in the /etc/resolv.conf on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) +By default, B sets up the B service and updates the DNS records on the local system (management node). If the B<-e> flag is specified, it will also update the DNS records on any external DNS server that is listed in the I on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.) -For more information on Cluster Name Resolution: -Cluster_Name_Resolution +For more information on Cluster Name Resolution see https://xcat-docs.readthedocs.io/en/stable/advanced/domain_name_resolution/domain_name_resolution.html =head1 OPTIONS @@ -51,11 +50,11 @@ Remove the DNS records. =item B<-e>|B<--external> -Update DNS records to the external DNS server listed in /etc/resolv.conf. +Update DNS records to the external DNS server listed in I. -Enabling the site attribute I means use 'external' DNS by default. If setting I to 1, you need NOT use B<-e> flag in every makedns call. +Enabling the site attribute I means use 'external' DNS by default. If setting I to 1, you need NOT use B<-e> flag in every B call. -=item B +=item I A set of comma delimited node names and/or group names. See the "noderange" man page for details on additional supported formats. diff --git a/xCAT-client/pods/man8/makenetworks.8.pod b/xCAT-client/pods/man8/makenetworks.8.pod index 402873c43..f7c4f3173 100644 --- a/xCAT-client/pods/man8/makenetworks.8.pod +++ b/xCAT-client/pods/man8/makenetworks.8.pod @@ -16,9 +16,9 @@ The B command can be used to gather network information from an xC Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save that information in the xCAT database. -You can use the "-d" option to display the network information without writing it to the database. +You can use the B<-d> option to display the network information without writing it to the database. You can also redirect the output to a file that can be used with the xCAT B command to define the networks. @@ -30,9 +30,9 @@ For example: This features allows you to verify and modify the network information before writing it to the database. -When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the mkdef, chdef, lsdef, and rmdef commands to manage this data. +When the network information is gathered a default value is created for the "netname" attribute. This is done to make it possible to use the B, B, B, and B commands to manage this data. -The default naming convention is to use a hyphen separated "net" and "mask" value with the "." replace by "_". (ex. "8_124_47_64-255_255_255_0") +The default naming convention is to use a hyphen separated "net" and "mask" values with the "." replaced by "_". (ex. "8_124_47_64-255_255_255_0") You can also modify the xCAT "networks" database table directly using the xCAT B command. @@ -77,13 +77,15 @@ Display cluster network information but do not write the network definitions to makenetworks -d -The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the lsdef, mkdef, chdef and rmdef commands. +The output would be one or more stanzas of information similar to the following. The line that ends with a colon is the value of the "netname" attribute and is the name of the network object to use with the B, B, B and B commands. -9_114_37_0-255_255_255_0: + 9_114_37_0-255_255_255_0: objtype=network gateway=9.114.37.254 mask=255.255.255.0 net=9.114.37.0 + mgtifname=ens3 + mtu=1500 =back diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index 6fbf59cd5..fa31e84e7 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -282,15 +282,11 @@ sub is_firewall_open { my $output = `iptables -nvL -t filter 2>&1`; - `echo "$output" |grep "Chain INPUT (policy ACCEPT" > /dev/null 2>&1`; - $rst = 1 if ($?); - - `echo "$output" |grep "Chain FORWARD (policy ACCEPT" > /dev/null 2>&1`; - $rst = 1 if ($?); - - `echo "$output" |grep "Chain OUTPUT (policy ACCEPT" > /dev/null 2>&1`; - $rst = 1 if ($?); - + if ($output =~ /DROP|RETURN/) { + # If output contains DROP or RETURN rules, assume firewall + # is blocking some traffic + $rst=1; + } return $rst; } diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index f2f6ed1da..ecabd128e 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -48,7 +48,7 @@ Description: Options: -h : Get usage information of $program_name -V : Output more information for debug - -i : Specify the network interface name of provision network on management node. if not specified, will guess the provision network from site table master attribute. Recommand to use -i option. If there is vlan in the network interface, provide the network interface with vlan infomation, such as '-i .'. + -i : Specify the network interface name of provision network on management node. if not specified, will guess the provision network from 'site' table 'master' attribute. Use of '-i' option is recommended. If there is vlan in the network interface, provide the network interface with vlan information, such as '-i .'. "; sub do_main_job { @@ -62,7 +62,7 @@ sub do_main_job { #check if all xcat daemons are running ($rst, $flag) = check_all_xcat_daemons(\$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); return $rst if ($rst); #check if xcatd can receive request @@ -89,13 +89,13 @@ sub do_main_job { #check important directory ($rst, $flag) = check_directory(\%sitetable, \$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check if SElinux is disabled ($rst, $flag) = check_selinux(\$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check http service @@ -106,12 +106,13 @@ sub do_main_job { #check tftp service ($rst, $flag) = check_tftp_service($installnicip, \$checkpoint, \@error); print_check_result($checkpoint, $flag, $rst, \@error); - $rst = 0 if ($flag == "w"); + $rst = 0 if ($flag eq "w"); $rc |= $rst; #check DNS service - $rst = check_dns_service(\%sitetable, $installnicip, \$checkpoint, \@error); - print_check_result($checkpoint, "f", $rst, \@error); + ($rst, $flag) = check_dns_service(\%sitetable, $installnicip, \$checkpoint, \@error); + print_check_result($checkpoint, $flag, $rst, \@error); + $rst = 0 if ($flag == "w"); $rc |= $rst; #check DHCP service @@ -151,7 +152,7 @@ sub do_main_job { print_check_result($checkpoint, $flag, $rst, \@error); $rc |= $rst; - #some sepecific check points in MN + #some specific check points in MN if (!$is_sn) { #check xCAT daemon attributes configuration @@ -173,12 +174,13 @@ sub do_main_job { $rst = check_dhcp_leases(\$checkpoint, \@error); print_check_result($checkpoint, "w", $rst, \@error); $rc |= $rst; - } else { - $rst = check_db_pkgs(\$checkpoint, \@error); - print_check_result($checkpoint, "f", $rst, \@error); - $rc |= $rst; } + #check if database packages are installed + $rst = check_db_pkgs(\$checkpoint, \@error); + print_check_result($checkpoint, "f", $rst, \@error); + $rc |= $rst; + cleanup(); return $rc; } @@ -310,7 +312,7 @@ sub check_all_xcat_daemons { foreach my $daemon (@daemon_list) { my $counter = $output =~ s/$daemon/$daemon/g; if ($counter > 1) { - if ($daemon == "SSL listener") { + if ($daemon eq "SSL listener") { my $cur_pid = `cat /var/run/xcatd.pid`; my @ssl_pids = `ps aux 2>&1|grep -v grep|grep "xcatd: $daemon"|awk -F' ' '{print \$2}'`; foreach my $ssl_pid (@ssl_pids) { @@ -320,7 +322,7 @@ sub check_all_xcat_daemons { $rst_type = "w" if ($child_pid); } } - push @$error_ref, "More Daemon '$daemon' is running"; + push @$error_ref, "More than one instance of '$daemon' is running"; $rst = 1; } elsif ($counter == 0) { push @$error_ref, "Daemon '$daemon' isn't running"; @@ -348,7 +350,7 @@ sub check_xcatd_receive_request { push @$error_ref, $_ foreach (@lines); $rst = 1; }elsif($cmdoutput =~ /Permission denied for request/){ - push @$error_ref, "Permission denied for request, please checking xcatd"; + push @$error_ref, "Permission denied for request, check xcatd"; $rst = 1; } return $rst if ($rst); @@ -361,7 +363,7 @@ sub check_xcatd_receive_request { if ($port) { my $cmdoutput = `netstat -ant 2>&1|grep LISTEN|grep $port`; if ($?) { - push @$error_ref, "Attribute '$port_attr' in site table is set to $port, but xcatd isn't listening on $port"; + push @$error_ref, "Attribute '$port_attr' in 'site' table is set to $port, but xcatd isn't listening on $port"; $rst = 1; } } else { @@ -396,10 +398,10 @@ sub check_site_table { if (($attr eq "master") and (!xCAT::NetworkUtils->isIpaddr("$value"))) { my $masterip = xCAT::NetworkUtils->getipaddr("$value"); if (! defined $masterip){ - push @$error_ref, "The value of 'master' in 'site' table isn't an IP addres and can not be resolved to a IP addres"; + push @$error_ref, "The value of 'master' in 'site' table isn't an IP address and can not be resolved to a IP address"; $rst = 1; }else{ - probe_utils->send_msg("$output", "i", "The value of 'master' in 'site' table is $value, can be resolve to $masterip") if($verbose); + probe_utils->send_msg("$output", "i", "The value of 'master' in 'site' table is $value, can be resolved to $masterip") if($verbose); $value = $masterip; } } @@ -488,7 +490,7 @@ sub check_network { my @tmp1 = split("\\\\", $str); my @tmp2 = split(" ", $tmp1[0]); $installnic=$tmp2[-1]; - probe_utils->send_msg("$output", "w", "No interface provided by '-i' option, detected site table IP attribute $$serverip_ref, checking xCAT configuration using interface: $installnic"); + probe_utils->send_msg("$output", "w", "No interface provided by '-i' option, detected 'site' table IP attribute $$serverip_ref, checking xCAT configuration using interface: $installnic"); probe_utils->send_msg("$output", "w", "If this is incorrect, rerun with -i option"); } } @@ -551,7 +553,7 @@ sub check_directory { $rst = 1; } else { if (!-e "$sitetable_ref->{$dir}") { - push @$error_ref, "There isn't '$sitetable_ref->{$dir}' directory on current server, there is something wrong during xCAT installation"; + push @$error_ref, "There isn't '$sitetable_ref->{$dir}' directory on current server, something went wrong during xCAT installation"; $rst = 1; } else { if ($is_sn) { @@ -571,7 +573,7 @@ sub check_directory { } if ($mountip ne $sitetable_ref->{master}) { - push @$error_ref, "$dir '$sitetable_ref->{$dir}' isn't mounted from the management node,please check SN's configuration"; + push @$error_ref, "$dir '$sitetable_ref->{$dir}' isn't mounted from the management node, check SN's configuration"; $rst = 1; } } elsif (($dir eq "tftpdir" and $sitetable_ref->{sharedtftp} ne "1") or @@ -659,7 +661,7 @@ sub check_disk { } my $mountmun = $#{$mountpointinfo{$mountpoint}{mount}} +1 ; if($mountmun >1){ - $msg .= "these directories are parts of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough."; + $msg .= "these directories are part of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough."; }else{ $msg .= "this directory is a part of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough."; } @@ -727,7 +729,7 @@ sub check_http_service { `which wget > /dev/null 2>&1`; if ($?) { - push @$error_ref, "HTTP check need 'wget' tool, please install 'wget' tool and try again"; + push @$error_ref, "HTTP check needs 'wget' tool, install 'wget' tool and try again"; } else { { my $httpinfo = `lsdef -t site -i installdir,httpport -c 2>&1`; @@ -787,13 +789,13 @@ sub check_tftp_service { if ($checktftp) { `which tftp > /dev/null 2>&1`; if ($?) { - push @$error_ref, "TFTP check need 'tftp' tool, please install 'tftp' tool and try again"; + push @$error_ref, "TFTP check needs 'tftp' tool, install 'tftp' tool and try again"; } else { { my $tftpdir = `lsdef -t site -i tftpdir -c 2>&1| awk -F'=' '{print \$2}'`; chomp($tftpdir); unless($tftpdir){ - push @$error_ref, "TFTP work path isn't configured in 'sit' table"; + push @$error_ref, "TFTP work path isn't configured in 'site' table"; last; } unless(-d "$tftpdir"){ @@ -893,7 +895,7 @@ sub check_log_record { my @grep_logs = `grep "$log_msg on SN" $log_file | grep -v "Allowing" | grep -v "dispatch"`; foreach my $grep_log (@grep_logs) { - if ($grep_log =~ /.+ \d+:\d+:\d+ (\w+) xcat: $log_msg on SN/) { + if ($grep_log =~ /.+ \d+:\d+:\d+ (\w+) xcat.*: .* $log_msg on SN/) { push @checked_nodes, $1; } } @@ -901,7 +903,7 @@ sub check_log_record { my %hash_pass = map{$_=>1} @checked_nodes; my @error_nodes = grep {!$hash_pass{$_}} @valid_nodes; if (@error_nodes) { - push @$error_ref, "Failed to store logs come from " . join(",", @error_nodes) . " to $log_file on MN"; + push @$error_ref, "Failed to store logs sent from SN " . join(",", @error_nodes) . " to $log_file on MN"; $rst = 1; } if (@invld_nodes) { @@ -924,7 +926,7 @@ sub check_ntp_service{ if($?){ `which ntpq > /dev/null 2>&1`; if ($?) { - push @$error_ref, "ntp service check need 'ntpq' or 'chronyc' tool, please install and try again"; + push @$error_ref, "ntp service check needs 'ntpq' or 'chronyc' tool, install and try again"; $rst = 1; } else { my $error; @@ -979,7 +981,7 @@ sub check_dns_service { if ($checkdns) { `which nslookup > /dev/null 2>&1`; if ($?) { - push @$error_ref, "DNS check need 'nslookup' tool, please install 'nslookup' tool and try again"; + push @$error_ref, "DNS check needs 'nslookup' tool, install 'nslookup' tool and try again"; $rst = 1; } else { if ($is_sn) { @@ -1005,12 +1007,31 @@ sub check_dns_service { } } else { - # if there is no sn, nslookup mnip + # if there is no sn, "nslookup mnip mnip" my $nslkp = `nslookup -type=A $serverip $serverip 2>&1`; chomp($nslkp); my $tmp = grep { $_ =~ "Server:[\t\s]*$serverip" } split(/\n/, $nslkp); if (!$tmp) { $rc = 1; + } else { + # "nslookup mnip mnip" was ok, + # now check if nameserver in /etc/resolv.conf can resolve server name + my $nslkp = `nslookup -type=A $serverip 2>&1`; + chomp($nslkp); + my $nameserverip = "n/a"; + if ($nslkp =~ /Server:[\t\s]*(\d+).(\d+).(\d+).(\d+)/) { + $nameserverip = "$1.$2.$3.$4"; + } + if ($nslkp =~ /server can't find/) { + push @$error_ref, "DNS nameserver $nameserverip can not resolve $serverip"; + # Just a warning + return (1, 'w'); + } + if ($nslkp =~ /no servers could be reached/) { + push @$error_ref, "DNS nameserver can not be reached"; + # Just a warning + return (1, 'w'); + } } } if ($rc) { @@ -1023,7 +1044,7 @@ sub check_dns_service { $rst = 2; } - return $rst; + return ($rst, 'f'); } @@ -1197,7 +1218,7 @@ sub check_ulimits { my $percent = $open_num/$nofile_num; unless ($percent < 0.8) { - push @$error_ref, "The number of open files is not enough for xcatd service, increase the limits for it according to xCAT document"; + push @$error_ref, "The number of open files is not enough for xcatd service, increase the limits for it according to xCAT documentation"; $rst = 1; if ($percent >= 1) { $rst_type = "f"; @@ -1226,7 +1247,7 @@ sub check_network_parameter { my $percent = $arp_num/$net_gc_thresh; unless ($percent < 0.8) { - push @$error_ref, "Most ARP has been used, please tuning network parameter as document"; + push @$error_ref, "Most ARP has been used, tune network parameters"; $rst = 1; if ($percent >= 1) { $rst_type = "f"; @@ -1284,13 +1305,18 @@ sub check_db_pkgs { my $error_ref = shift; my $rst = 0; - $$checkpoint_ref = "Checking DB packages installatio..."; + $$checkpoint_ref = "Checking DB packages installation..."; @$error_ref = (); my $cfgloc_file = "/etc/xcat/cfgloc"; if (! -e $cfgloc_file) { - push @$error_ref, "$cfgloc_file does not exist, please check xcat installation."; - return 1; + # no $cfgloc_file, check if running with default SQLite + if (-d "/etc/xcat") { + return 0; #Default SQLite + } else { + push @$error_ref, "Can not find $cfgloc_file or /etc/xcat, check xcat database installation."; + return 1; + } } my $db_type = `cat $cfgloc_file | awk -F ':' '{print \$1}'`; chomp($db_type); @@ -1298,13 +1324,13 @@ sub check_db_pkgs { my $db_name; if ($db_type eq "mysql") { $db_name = "perl-DBD-MySQL or perl-DBD-mysql"; - $db_pkg = `rpm qa | grep -e perl-DBD-MySQL -e perl-DBD-mysql`; + $db_pkg = `rpm -qa | grep -e perl-DBD-MySQL -e perl-DBD-mysql`; } elsif ($db_type eq "Pg") { $db_name = "perl-DBD-Pg"; $db_pkg = `rpm -qa | grep $db_name`; } if (!$db_pkg) { - push @$error_ref, "$db_name is not installed, please install it."; + push @$error_ref, "$db_name is not installed."; $rst = 1; } return $rst; diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index 0873872b7..324d8e451 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -## IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html +## IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html package xCAT::Goconserver; diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 457a948ff..398c134ab 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -# IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html +# IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html #(C)IBM Corp #modified by jbjohnso@us.ibm.com #This module abstracts the session management aspects of IPMI diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 5ace2f59c..030215717 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -## IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html +## IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html package xCAT::OPENBMC; diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index ca60228d2..0c34e40ac 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -299,7 +299,7 @@ sub subvars { my $writerepo; my $c = 0; foreach my $pkgdir (@pkgdirs) { - if ($platform =~ /^(rh|SL|centos|fedora)$/) { + if ($platform =~ /^(rh|SL|centos|ol|fedora)$/) { if ($c == 0) { # After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x # the rhels5.9 will not be installed successfully. So put in kickstart directly. @@ -342,6 +342,9 @@ sub subvars { $product_dir=$subdir; if($subdir =~ /^Module-/){ $product_name="sle-".lc($subdir); + }elsif($subdir =~ /^Product-SUSE-Manager-Server|^Product-SLES_SAP|^Product-SLED/){ + # Skip product directories that are not "SLES", causes conflict on SLE15.2 + next; }elsif($subdir =~ /^Product-/){ $subdir=~s/Product-//; $product_name=$subdir; diff --git a/xCAT-server/lib/perl/xCAT/XML.pm b/xCAT-server/lib/perl/xCAT/XML.pm new file mode 100644 index 000000000..972b331d2 --- /dev/null +++ b/xCAT-server/lib/perl/xCAT/XML.pm @@ -0,0 +1,83 @@ +#!/usr/bin/perl +# IBM(c) 2021 EPL license http://www.eclipse.org/legal/epl-v10.html +# +# This module extends XML::Simple class. +# +# For versions of XML::Simple class which implement new_xml_parser(): +# Overwrite XML::Simple::new_xml_parser() to pass parser options +# directly to the XML::Parser. The passing of parser options with +# XML::Simple::XMLin() has been depricated. +# +# +# For older versions of XML::Simple class which do not implement new_xml_parser(): +# Overwrite XML::Simple::build_tree_xml_parser() to pass parser options +# directly to the XML::Parser. The passing of parser options with +# XML::Simple::XMLin() has been depricated. +# +package xCAT::XML; +use XML::Simple; +use xCAT::MsgUtils; +use Carp; +$XML::Simple::PREFERRED_PARSER = 'XML::Parser'; +use parent 'XML::Simple'; + +sub build_tree_xml_parser { + my $self = shift; + my $filename = shift; + my $string = shift; + + # Check if parent class XML::Simple has implemented new_xml_parser(), + # if it has, just call XML::Simple::build_tree_xml_parser() from parent + # and it in turn will call new_xml_parser() overwritten by this module. + # + # If parent class XML::Simple does not have new_xml_parser() implemented, + # fall through and execute the build_tree_xml_parser() overwritten + # by this module. + # + if (exists &{XML::Simple::new_xml_parser}) { + return $self->SUPER::build_tree_xml_parser($filename, $string); + } + + eval { + local($^W) = 0; # Suppress warning from Expat.pm re File::Spec::load() + require XML::Parser; # We didn't need it until now + }; + if($@) { + croak "XMLin() requires either XML::SAX or XML::Parser"; + } + + if($self->{opt}->{nsexpand}) { + carp "'nsexpand' option requires XML::SAX"; + } + + my $xp = XML::Parser->new(Style => 'Tree', + [ load_ext_dtd => 0, + ext_ent_handler => undef, + no_network => 1, + expand_entities => 0, + ]); + my($tree); + if($filename) { + # $tree = $xp->parsefile($filename); # Changed due to prob w/mod_perl + open(my $xfh, '<', $filename) || croak qq($filename - $!); + $tree = $xp->parse($xfh); + } + else { + $tree = $xp->parse($$string); + } + + return($tree); +} + +sub new_xml_parser { + my($self) = @_; + my $xp = XML::Parser->new(Style => 'Tree', + [ load_ext_dtd => 0, + ext_ent_handler => undef, + no_network => 1, + expand_entities => 0, + ]); + $xp->setHandlers(ExternEnt => sub {return $_[2]}); + return $xp; +} +1; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 3ec1be39c..e36d7b00d 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2036,7 +2036,7 @@ sub copycd if (-r $mntpath . "/.discinfo") { - print "DEBUG - [anaconda.pm] Attempt to detemine OS information from the .discinfo file ...\n"; + print "DEBUG - [anaconda.pm] Attempt to detemine OS information from the $mntpath/.discinfo file ...\n"; open($dinfo, $mntpath . "/.discinfo"); $did = <$dinfo>; chomp($did); @@ -2103,7 +2103,7 @@ sub copycd $dno = $1; } } - print "DEBUG - [anaconda.pm] Distname=$distname, OS=$desc, ARCH=$arch, Version=$dno\n"; + print "DEBUG - [anaconda.pm] Distname=$distname, OS=$desc, ARCH=$darch, Version=$dno\n"; unless ($distname) { @@ -2139,6 +2139,26 @@ sub copycd } close($dinfo); } + elsif ($desc =~ /Oracle Linux/) + { + # + # Attempt to auto-detect for OL8 OS, the last element + # (accessed with [-1] array index) has typically been the version + # ex: "Oracle Linux 8.3.0" + # + my @ol_version = split / /, $desc; + $distname = "ol" . $ol_version[-1]; + } + elsif ($desc =~ /OL-/) + { + # + # Attempt to auto-detect for OL7 OS, the first element + # (after "-") has typically been the version + # ex: OL-7.9 Server.x86_64 + # + my @ol_version = split /[- ]/, $desc; + $distname = "ol" . $ol_version[1]; + } elsif ($desc =~ /^[\d\.]+$/) { open($dinfo, $mntpath . "/.treeinfo"); diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index 9fb75072b..62b2e6ed5 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -65,7 +65,7 @@ sub process_request { 'w|nonoverwrite' => \$nonoverwrite, ); if ($help) { - $callback->({ info => "copycds [{-p|--path}=path] [{-n|--name|--osver}=distroname] [{-a|--arch}=architecture] [-i|--inspection] [{-o|--noosimage}] [{-w|--nonoverwrite}] 1st.iso [2nd.iso ...]." }); + $callback->({ info => "copycds [{-p|--path} path] [{-n|--name|--osver} distroname] [{-a|--arch} architecture] [-i|--inspection] [{-o|--noosimage}] [{-w|--nonoverwrite}] 1st.iso [2nd.iso ...]." }); return; } if ($arch and $arch =~ /i.86/) { @@ -115,7 +115,7 @@ sub process_request { return; } - if (grep /$file: data/, @filestat) { + if ((grep /$file: data/, @filestat) || (grep /$file: .* \(binary data/, @filestat)) { if ($xcatdebugmode) { $callback->({ info => "run copydata for data file = $file" }); } diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 89be54d85..8f5851ff0 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -814,13 +814,52 @@ sub build_xmldesc { } my $devhash = XMLin($devxml); + if (defined $devhash->{capability}->{type} and $devhash->{capability}->{type} =~ /pci/i) { my %tmphash; $tmphash{mode} = 'subsystem'; $tmphash{type} = $devhash->{capability}->{type}; $tmphash{managed} = "yes"; $tmphash{driver}->{name} = "vfio"; - $tmphash{source}->{address}->[0] = \%{ $devhash->{'capability'}->{'iommuGroup'}->{'address'} }; + + if (ref $devhash->{'capability'}->{'iommuGroup'}->{'address'} ne 'ARRAY') + { + # There is only one record of address. + + $tmphash{source}->{address}->[0] = \%{ $devhash->{'capability'}->{'iommuGroup'}->{'address'} }; + } + else + { + # There are multiple records of address. Extract the function portion of the PCI devname. + + my $numaddr; + my $tmpval; + my $devfunction; + my $tmpfunction; + + $devname =~ /pci_([0-9]*)_([0-9]*)_([0-9]*)_([0-9]*)/; + + $devfunction = $4; + + $numaddr = length (ref $devhash->{'capability'}->{'iommuGroup'}->{'address'}); + + for (my $i = 0; $i < $numaddr; $i++) + { + $tmpval = $devhash->{'capability'}->{'iommuGroup'}->{'address'}->[$i]->{'function'}; + + $tmpval =~ /0x([0-9]*)/; + + $tmpfunction = $1; + + # Compare the function portion of the PCI devname against that of the XML structure.:w + if ($devfunction eq $tmpfunction) + { + $tmphash{source}->{address}->[0] = \%{ $devhash->{'capability'}->{'iommuGroup'}->{'address'}->[$i] }; + last; + } + } + } + push(@prdevarray, \%tmphash); } diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 09e834fcb..5c019ce10 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -457,7 +457,13 @@ sub donets my $firstoctet = $ent[0]; $firstoctet =~ s/^(\d+)\..*/$1/; - if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239) or $ent[0] eq "127.0.0.0") + # Do not process network entries that + # match 169.254.0.0 or 127.0.0.0 + # OR + # in range 224.x.x.x thru 239.x.x.x + # OR + # do not contain '/' + if ($ent[0] eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239) or $ent[0] eq "127.0.0.0" or $ent[0] !~ "/") { next; } diff --git a/xCAT-server/lib/xcat/plugins/onie.pm b/xCAT-server/lib/xcat/plugins/onie.pm index 35cae4d6d..ccd49f4e1 100644 --- a/xCAT-server/lib/xcat/plugins/onie.pm +++ b/xCAT-server/lib/xcat/plugins/onie.pm @@ -306,7 +306,7 @@ sub nodeset { my $flag=0; if (-r $image_pkgdir) { my @filestat = `file $image_pkgdir`; - if (grep /$image_pkgdir: data/, @filestat) { + if ((grep /$image_pkgdir: data/, @filestat) || (grep /$image_pkgdir: .* \(binary data/, @filestat)) { $flag=1; } } diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 456a8b802..19076b962 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1496,7 +1496,7 @@ sub parse_args { # Updateid was passed, check flags allowed with update id if ($option_flag !~ /^--delete$|^-a$|^--activate$/) { my $optional_help_msg = ""; - if ($option_flag == "-d") { + if ($option_flag eq "-d") { # For this special case, -d was changed to pass in a directory. $optional_help_msg = "Did you mean --delete?" } diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 7a765cf7f..ca795ac00 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -117,9 +117,7 @@ my $dispatch_requests = 1; # govern whether commands are dispatchable use IO::Socket; use IO::Handle; use IO::Select; -use XML::Simple; -$XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use XML::LibXML; +use xCAT::XML; use xCAT::Table; my $dbmaster; use xCAT::ExtTab; @@ -692,12 +690,9 @@ sub do_discovery_process { IO::Uncompress::Gunzip::gunzip(\$data, \$bigdata); $data = $bigdata; } - my $req = eval { XMLin($data, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ - load_ext_dtd => 0, - ext_ent_handler => undef, - no_network => 1, - expand_entities => 0, - ]) }; + my $xs = xCAT::XML->new(); + my $req = eval { $xs->XMLin($data, SuppressEmpty => undef, ForceArray => qr/.*/) }; + xCAT::MsgUtils->message("S", "xcatd: Error parsing XML data - $@") if $@; if ($req and $req->{command} and ($req->{command}->[0] eq "findme" and $sport < 1000)) { # only consider priveleged port requests to start with $req->{'_xcat_clientip'} = $clientip; $req->{'_xcat_clientport'} = $sport; @@ -2690,14 +2685,14 @@ sub send_response { } } } - $xml = XMLout($response, KeyAttr => [], NoAttr => 1, KeepRoot => 1); + $xml = xCAT::XML::XMLout($response, KeyAttr => [], NoAttr => 1, KeepRoot => 1); } else { if ($MYXCATSERVER) { unless (exists($response->{serverdone})) { $response->{xcatdsource}->[0] = $MYXCATSERVER; } } - $xml = XMLout($response, RootName => 'xcatresponse', NoAttr => 1); + $xml = xCAT::XML::XMLout($response, RootName => 'xcatresponse', NoAttr => 1); } $xml =~ tr/\011-\177/?/c; @@ -2722,12 +2717,8 @@ sub send_response { my $cmdlog_xml = ""; $tmp_xml =~ s/\e/xxxxESCxxxx/g; $cmdlog_xml .= $tmp_xml . ""; - my $cmdlog_rsp = XMLin($cmdlog_xml, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ - load_ext_dtd => 0, - ext_ent_handler => undef, - no_network => 1, - expand_entities => 0, - ]); + my $xs = xCAT::XML->new(); + my $cmdlog_rsp = $xs->XMLin($cmdlog_xml, SuppressEmpty => undef, ForceArray => qr/.*/ ); cmdlog_collectlog($cmdlog_rsp); # ----used for command log end -------- @@ -2784,12 +2775,10 @@ sub get_request { return undef; } } - return eval { XMLin($request, SuppressEmpty => undef, ForceArray => qr/.*/, ParserOpts => [ - load_ext_dtd => 0, - ext_ent_handler => undef, - no_network => 1, - expand_entities => 0, - ]) }; + my $xs = xCAT::XML->new(); + my $request_hash = eval { $xs->XMLin($request, SuppressEmpty => undef, ForceArray => qr/.*/) }; + xCAT::MsgUtils->message("S", "xcatd: Error parsing XML request - $@") if $@; + return $request_hash; } elsif ($encode eq "storable") { my $return = eval { fd_retrieve($sock); }; # suppres end of stream err return $return; diff --git a/xCAT-server/sbin/xcatsnap b/xCAT-server/sbin/xcatsnap index 3b3d1318b..829c9a02e 100755 --- a/xCAT-server/sbin/xcatsnap +++ b/xCAT-server/sbin/xcatsnap @@ -103,7 +103,7 @@ sub run_cmd { eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 600; - @output = `$Command`; + @output = `/bin/bash -c \'$Command\'`; alarm 0; }; if ($@) { @@ -209,7 +209,12 @@ sub snap_it { "/etc/rsyslog.conf", "/etc/rsyslog.d/*", "/var/lib/dhcpd/dhcpd.leases", "/etc/hosts", "/etc/resolv.conf", "/etc/named.conf", "/etc/conserver.cf", "/var/log/conserver", - "/etc/nsswitch.conf", "/var/log/messages", "/var/log/xcat/*"); + "/etc/nsswitch.conf", "/var/log/messages", "/var/log/xcat/*", + "/etc/dhcp/dhcpd.conf", "/etc/dhcp/dhcpd6.conf", + "/etc/dhcpd6.conf", "/var/lib/dhcp/db/dhcpd.leases", + "/var/lib/dhcp/dhcpd.leases","/etc/goconserver/server.conf", + "/var/log/goconserver/*", "/etc/logrotate.d/goconserver", + "/etc/bind/named.conf"); print("@files_array \n"); } foreach my $item (@files_array) { @@ -220,15 +225,12 @@ sub snap_it { print "Gathering system configuration...\n\n"; $output_dir = "$logDirectory/commands_output/"; my $xcatroot = $ENV{'XCATROOT'}; - my $installdir; - chop($installdir = - `tabdump site | grep installdir | cut -f2 -d ,`); make_output_dir(); if ($OSname eq "AIX") { @Commands_array = ( "uname -a", "ifconfig -a", "netstat -in", "netstat -rn", "env", "reventlog -a", "lsmod", "/sbin/lspci", "lssrc -a", "rpm -qa", - "ls $installdir", "/bin/crontab -l", + "ls $INSTALLDIR", "/bin/crontab -l", "find /tftpboot -size -32k", "ls -lR $xcatroot", "arp -a", "ps -edlf", "ps -aux", "ulimit -a", "df -k", "oslevel", "netstat -A", "errpt -a", "/usr/sbin/instfix -i", @@ -237,8 +239,8 @@ sub snap_it { elsif ($OSname eq "Linux") { @Commands_array = ( "uname -a", "ifconfig -a", "netstat -in", "netstat -rn", "env", - "reventlog -a", "lsmod", "/sbin/lspci", "lssrc -a", "rpm -qa", - "ls $installdir", "/usr/bin/crontab -l", + "reventlog -a", "lsmod", "lspci", "lssrc -a", "rpm -qa", + "ls $INSTALLDIR", "/usr/bin/crontab -l", "apt list", "find /tftpboot -size -32k", "ls -lR $xcatroot", "arp -a", "ps -edlf", "ps -aux", "ulimit -a", "df -k", "cat /etc/issue", "lsxcatd -a", "cat /proc/meminfo", "cat /proc/cpuinfo", "journalctl -b --no-pager -u xcatd"); diff --git a/xCAT-server/share/xcat/install/ol/compute.ol7.pkglist b/xCAT-server/share/xcat/install/ol/compute.ol7.pkglist new file mode 120000 index 000000000..57567949a --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol7.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels7.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/compute.ol7.tmpl b/xCAT-server/share/xcat/install/ol/compute.ol7.tmpl new file mode 120000 index 000000000..f44d7121c --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol7.tmpl @@ -0,0 +1 @@ +../rh/compute.rhels7.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/compute.ol8.pkglist b/xCAT-server/share/xcat/install/ol/compute.ol8.pkglist new file mode 120000 index 000000000..ccb1fe4ef --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol8.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/compute.ol8.tmpl b/xCAT-server/share/xcat/install/ol/compute.ol8.tmpl new file mode 100644 index 000000000..746eb1ad5 --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/compute.ol8.tmpl @@ -0,0 +1,59 @@ +#version=OL8 +# Use text install +text +# Use network installation +%include /tmp/repos +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +#KICKSTARTNET# +# Root password +rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password# +# Not run the Setup Agent on first boot +firstboot --disable +# Do not configure the X Window System +skipx +# System services +#services --enabled="chronyd" +# System timezone +timezone #TABLE:site:key=timezone:value# --isUtc +# Partition clearing information +zerombr +clearpart --all --initlabel +#XCAT_PARTITION_START# +%include /tmp/partitionfile +#XCAT_PARTITION_END# + +# Do not configure any iptables rules +firewall --disable +selinux --disable +reboot + +%packages +#INCLUDE_DEFAULT_PKGLIST# + +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +%end +%pre +{ +echo "Running Kickstart Pre-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# +} &>>/tmp/pre-install.log +%end +%post --interpreter=/bin/bash +mkdir -p /var/log/xcat/ +cat /tmp/pre-install.log >>/var/log/xcat/xcat.log +{ +echo "Running Kickstart Post-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels8# +} &>>/var/log/xcat/xcat.log +%end diff --git a/xCAT-server/share/xcat/install/ol/service.ol7.tmpl b/xCAT-server/share/xcat/install/ol/service.ol7.tmpl new file mode 120000 index 000000000..453d4b94a --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol7.tmpl @@ -0,0 +1 @@ +../rh/service.rhels7.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..7166f39c2 --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist new file mode 120000 index 000000000..8836bf046 --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol7.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.pkglist b/xCAT-server/share/xcat/install/ol/service.ol8.pkglist new file mode 120000 index 000000000..818f670ec --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist new file mode 120000 index 000000000..ed90f050f --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.ppc64le.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.ppc64le.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.tmpl b/xCAT-server/share/xcat/install/ol/service.ol8.tmpl new file mode 120000 index 000000000..373e2f6eb --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.tmpl @@ -0,0 +1 @@ +../rh/service.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/install/ol/service.ol8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 48f07d97a..5fce34a03 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -4,16 +4,17 @@ # # Get proper disk to install OS # -# 1. Check all partitions list in /proc/partitions, whether -# there is disk had OS installed. If there is, add it to +# 1. Check all partitions listed in /proc/partitions, whether +# there is a disk that had OS installed. If there is, add it to # the disk array. -# 2. If there is disk had OS installed, check disks list -# generated in Step 1. Else, check all disks get from -# /proc/partitions file. Sort them by WWN/PATH and driver -# type, select the first one. -# 3. Select the default one: /dev/sda. +# 2. If there is no disk that had OS installed found +# in Step 1, then check all disks in +# /proc/partitions file. Sort them by driver type, then by WWN/PATH +# select the first one. +# 3. If no disks selected in Steps 1 or 2, then +# select the default disk: /dev/sda. # -# Output: /tmp/xcat.install_disk +# Output: Install disk name written to /tmp/xcat.install_disk # #----------------------------------------------------------- @@ -31,7 +32,7 @@ tmpfile="$tmpdir/getinstalldisk_" if [ -z "$install_disk" ]; then - echo "[get_install_disk]Information from /proc/partitions:" + echo "[get_install_disk]Contents of /proc/partitions:" cat /proc/partitions echo "" @@ -44,9 +45,10 @@ if [ -z "$install_disk" ]; then # Classify entries by DEVTYPE for entry in $entries; do - DEVSIZE=$(udevadm info --attribute-walk --name=$entry|grep {size}| sed -e 's/[^"]*"//' -e 's/"//'|tail -n 1) + DEVSIZE=$(udevadm info --attribute-walk --name=$entry|grep \{size\}| sed -e 's/[^"]*"//' -e 's/"//'|tail -n 1) if [ -z "$DEVSIZE" -o $DEVSIZE -lt 262144 ]; then # ignore small devices, that are likely remote media or similar + echo "[get_install_disk] Skipping partition $entry. Size too small: $DEVSIZE" continue fi @@ -67,6 +69,7 @@ if [ -z "$install_disk" ]; then mkdir -p $mount_dir; disk_array="" + umount_rc=0 for partition in $partitions; do echo "[get_install_disk]Check the partition $partition." @@ -106,8 +109,17 @@ if [ -z "$install_disk" ]; then # If there is kernel file, add partition's disk into disk_array # It seems the kernel file in ubuntu and sles are named like vmlinux, but in RH it is called vmlinuz # To check both vmlinux and vmlinuz, use regular expression "vmlinu*" to match them - for i in $ker_dir/vmlinu*; do - disk_part=${partition%%[0-9]*} + for i in $(find $ker_dir -maxdepth 1 -name "vmlinu*"); do + case $partition in + nvme*) + # Expected nvme partition format example: nvme0n1p1 + disk_part=${partition%%p*} + ;; + *) + # Expected sd partition format example: sda1 + disk_part=${partition%%[0-9]*} + ;; + esac touch "$tmpfile$disk_part" disk_array=$disk_array"$disk_part " echo "[get_install_disk] The partition $partition has kernel file." @@ -115,6 +127,10 @@ if [ -z "$install_disk" ]; then done umount -l $mount_dir || echo "[get_install_disk] $partition umount failed." + if [ $? -ne 0 ]; then + # Preserve a umount failure RC + umount_rc=$? + fi else echo "[get_install_disk] Partition $partition mount failed or the partition is swap." fi @@ -128,7 +144,13 @@ if [ -z "$install_disk" ]; then echo "" fi - rmdir $mount_dir; + if [ $umount_rc -eq 0 ]; then + rmdir $mount_dir; + else + # Do not remove $mount_dir if there was a umount failure, as it might wipe out + # the contents of a still mounted disk + echo "[get_install_disk]There was a umount failure earlier, not removing $mount_dir" + fi for file in $tmpfile*; do rm $file; @@ -172,7 +194,7 @@ if [ -z "$install_disk" ]; then disk_data=$disk_wwn elif [ $has_wwn -eq 1 ]; then echo "[get_install_disk] The disk $disk has no wwn info." - echo "[get_install_disk] There is other disk has wwn info, so don't record this disk." + echo "[get_install_disk] There is another disk with wwn info, so don't record this disk." continue; elif [ "$disk_path" ]; then has_path=1 @@ -180,7 +202,7 @@ if [ -z "$install_disk" ]; then disk_data=$disk_path elif [ $has_path -eq 1 ]; then echo "[get_install_disk] The disk $disk has no wwn or path info." - echo "[get_install_disk] There is other disk has path info, so don't record this disk." + echo "[get_install_disk] There is another disk with path info, so don't record this disk." continue; else file_pre="other" @@ -239,7 +261,7 @@ rm -rf $tmpdir; # Cannot find proper disk for OS install, select the default one "/dev/sda" if [ -z "$install_disk" ]; then install_disk="/dev/sda" - echo "[get_install_disk]The default install_disk is $install_disk." + echo "[get_install_disk]Choosing default install_disk $install_disk." fi # Output the result to $install_disk_file diff --git a/xCAT-server/share/xcat/install/sle/compute.sle15.tmpl b/xCAT-server/share/xcat/install/sle/compute.sle15.tmpl index ce94dfba3..a634649ee 100644 --- a/xCAT-server/share/xcat/install/sle/compute.sle15.tmpl +++ b/xCAT-server/share/xcat/install/sle/compute.sle15.tmpl @@ -33,6 +33,7 @@ true true true + true diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl index f3f8be272..7062fedaa 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl @@ -12,7 +12,7 @@ - GMT + UTC #TABLE:site:key=timezone:value# @@ -40,42 +40,6 @@ XCATPARTITIONHOOK true all - - - true - false - device - 65 - 1 - false - 8225280 - - - true - false - swap - true - false - swap - uuid - 130 - 2 - false - auto - - - true - false - btrfs - true - false - / - uuid - 131 - 3 - 100% - - diff --git a/xCAT-server/share/xcat/install/sles/service.sle15.pkglist b/xCAT-server/share/xcat/install/sles/service.sle15.pkglist index 63bff5bf3..a2bf0e341 100644 --- a/xCAT-server/share/xcat/install/sles/service.sle15.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sle15.pkglist @@ -22,4 +22,4 @@ perl-DBD-mysql mariadb-client #libmysqlclient18 vim - +wget diff --git a/xCAT-server/share/xcat/install/sles/service.sle15.tmpl b/xCAT-server/share/xcat/install/sles/service.sle15.tmpl index b1ed324ea..f91d1f5e5 100644 --- a/xCAT-server/share/xcat/install/sles/service.sle15.tmpl +++ b/xCAT-server/share/xcat/install/sles/service.sle15.tmpl @@ -32,6 +32,7 @@ true true true + true diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist new file mode 120000 index 000000000..338644a02 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels7.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist new file mode 120000 index 000000000..1161417ef --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels7.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall new file mode 120000 index 000000000..f8605039f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol7.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels7.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist new file mode 120000 index 000000000..a6d9c0135 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist new file mode 120000 index 000000000..5ecd4c4d1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall new file mode 120000 index 000000000..3e16d254e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/compute.ol8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/dracut_047 b/xCAT-server/share/xcat/netboot/ol/dracut_047 new file mode 120000 index 000000000..fe26fce05 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/dracut_047 @@ -0,0 +1 @@ +../rh/dracut_047 \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/geninitrd b/xCAT-server/share/xcat/netboot/ol/geninitrd new file mode 120000 index 000000000..073e03e56 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/geninitrd @@ -0,0 +1 @@ +../rh/geninitrd \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist new file mode 120000 index 000000000..71786c8e0 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.exlist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..7166f39c2 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist new file mode 120000 index 000000000..8836bf046 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall new file mode 120000 index 000000000..bce5cd2cd --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol7.x86_64.postinstall @@ -0,0 +1 @@ +../rh/service.rhels7.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist new file mode 120000 index 000000000..9d1e45244 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.exlist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist new file mode 120000 index 000000000..cba1edc0e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall new file mode 120000 index 000000000..cd4cbff17 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ol/service.ol8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 64fdc65e8..5de3d3009 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -365,6 +365,14 @@ if($onlyinitrd){ $yumcmd .= "--setopt=module_platform_id=platform:el" . $majorrel . " "; } } + + if ($osver =~ /^ol\D*(\d*)[.\d]*.*$/) { + $majorrel = $1; + if ($majorrel > 7) { + $yumcmd .= "--releasever=" . $majorrel . " "; + $yumcmd .= "--setopt=module_platform_id=platform:el" . $majorrel . " "; + } + } foreach (0 .. $repnum) { $yumcmd .= "--enablerepo=$osver-$arch-$_ "; @@ -784,6 +792,18 @@ if (-e "$rootimg_dir/etc/yum.repos.d/CentOS-Base.repo") { } # +#-- Oracle Linux, disable internet repositories +if (-e "$rootimg_dir/etc/yum.repos.d/oracle-linux-ol8.repo") { + my $repo_content = `sed -e '/enabled/d' $rootimg_dir/etc/yum.repos.d/oracle-linux-ol8.repo | sed -e '/^gpgkey/i enabled=0'`; + system("echo '$repo_content' > $rootimg_dir/etc/yum.repos.d/oracle-linux-ol8.repo"); +} + +if (-e "$rootimg_dir/etc/yum.repos.d/uek-ol8.repo") { + my $repo_content = `sed -e '/enabled/d' $rootimg_dir/etc/yum.repos.d/uek-ol8.repo | sed -e '/^gpgkey/i enabled=0'`; + system("echo '$repo_content' > $rootimg_dir/etc/yum.repos.d/uek-ol8.repo"); +} +# + #-- run postinstall script unless ($imagename) { $postinstall_filename = imgutils::get_profile_def_filename($osver, $profile, $arch, $customdir, "postinstall"); @@ -1005,6 +1025,11 @@ sub mkinitrd_dracut { $dracutmoduledir = "$rootimg_dir/usr/lib/dracut/modules.d/"; } + # For whatever reasons Oracle Linux have both /usr/lib/dracut and /usr/share/dracut folders + # so we just check if it /etc/oracle-release exists and force the correct path + if ((-f "$rootimg_dir/etc/oracle-release")) { + $dracutmoduledir = "$rootimg_dir/usr/lib/dracut/modules.d/"; + } if ($dracutver >= "033") { my $perm = (stat("$fullpath/$dracutdir/patch/syslog/module-setup.sh"))[2]; @@ -1950,6 +1975,10 @@ sub using_systemd { if ($1 >= 7) { return 1; } + } elsif ($os =~ /ol(\d+)/) { + if ($1 >= 7) { + return 1; + } } elsif ($os =~ /rhelhpc(\d+)/) { if ($1 >= 7) { return 1; diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index c406cdc9c..610483d38 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -299,12 +299,20 @@ unless ($onlyinitrd) { if (-d "$dir/1") { $ddir .= "/1"; } - system("zypper -R $rootimg_dir $non_interactive ar file:$ddir $osver-$i"); - $i++; - if (-d "$dir/2") { - $ddir = $dir . "/2"; + if (-d "$ddir/Product-SLES" && -d "$ddir/Module-Basesystem" && -d "$ddir/Module-Legacy") { + # If "Module" and "Product" directories are there, use them for package repositories + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Product-SLES $osver-$i-Product-SLES"); + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Basesystem $osver-$i-Module-Basesystem"); + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir/Module-Legacy $osver-$i-Module-Legacy"); + + } else { system("zypper -R $rootimg_dir $non_interactive ar file:$ddir $osver-$i"); $i++; + if (-d "$dir/2") { + $ddir = $dir . "/2"; + system("zypper -R $rootimg_dir $non_interactive ar file:$ddir $osver-$i"); + $i++; + } } } @@ -1999,8 +2007,21 @@ sub generic_post { # This function is meant to leave the image in a state approx print $cfgfile "NETWORKING=yes\n"; close($cfgfile); - # SLE15 has a symlink to /run/netconfig/resolv.conf and does not need a dummy file + # Check resolv.conf file. + # If it is a link and link leads to an empty file, remove that link + # If it is a link and link leads to a non emply file, leave it alone + # If it is not a link, fill it it with some "dummy" text + if (-l "$rootimg_dir/etc/resolv.conf" ) { + my $link_file = readlink "$rootimg_dir/etc/resolv.conf"; + if (-z "$rootimg_dir/$link_file") { + # Link leading to an empty file + # Remove resolv.conf, so that link is gone and code below will + # create a dummy file + unlink("$rootimg_dir/etc/resolv.conf"); + } + } if (! -l "$rootimg_dir/etc/resolv.conf") { + # Not a link, fill in with "dummy" text open($cfgfile, ">", "$rootimg_dir/etc/resolv.conf"); print $cfgfile "#Dummy resolv.conf to make boot cleaner"; close($cfgfile); diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index c8abf7073..69a7d4ed1 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.46 +# Version 1.0.48 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -32,6 +32,10 @@ # 2020-5-7 Nic Mays # - Handles 'stable' as a flag to install latest version via the command: # go-xcat --xcat-version=stable install +# 2021-02-18 Mark Gurevich +# - On Ubuntu remove packages one at a time +# 2021-05-07 Mark Gurevich +# - Add support for Oracle Linux # @@ -176,7 +180,7 @@ 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 +# For Debian/Ubuntu, it will need a slightly different package list type dpkg >/dev/null 2>&1 && GO_XCAT_INSTALL_LIST=(perl-xcat xcat-client xcat xcat-buildkit xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server @@ -187,7 +191,7 @@ GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps xCAT-buildkit conserver-xcat) -# For Debian/Ubuntu, it will need a sight different package list +# For Debian/Ubuntu, it will need a slightly different package list type dpkg >/dev/null 2>&1 && GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn @@ -1395,6 +1399,7 @@ function add_xcat_dep_repo_yum_or_zypper() local distro="${GO_XCAT_LINUX_DISTRO}${GO_XCAT_LINUX_VERSION%%.*}" case "${distro}" in "centos"*) distro="rh${distro#centos}" ;; + "ol"*) distro="rh${distro#ol}" ;; "fedora10"|"fedora11") distro="fedora9" ;; "fedora1"[678]) distro="rh6" ;; "fedora19"|"fedora2"?) distro="rh7" ;; @@ -1588,8 +1593,12 @@ function remove_package_apt() type apt-get >/dev/null 2>&1 || return 255 local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift - apt-get --allow-unauthenticated remove "${yes[@]}" "$@" - warn_if_bad "$?" "Unable to remove xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` + # For each package, remove one at a time + for package in "$@" + do + apt-get --allow-unauthenticated remove "${yes[@]}" ${package} + warn_if_bad "$?" "Unable to remove xCAT package ${package}" + done } function remove_package() @@ -1603,8 +1612,12 @@ function purge_package_apt() type apt-get >/dev/null 2>&1 || return 255 local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift - apt-get --allow-unauthenticated purge "${yes[@]}" "$@" - warn_if_bad "$?" "Unable to purge xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` + # For each package, remove one at a time + for package in "$@" + do + apt-get --allow-unauthenticated purge "${yes[@]}" ${package} + warn_if_bad "$?" "Unable to purge xCAT package ${package}" + done } function purge_package_others() @@ -2086,7 +2099,7 @@ Version: ${GO_XCAT_LINUX_VERSION} EOF case "${GO_XCAT_LINUX_DISTRO}" in -"centos"|"fedora"|"rhel"|"sles"|"ubuntu") +"centos"|"fedora"|"rhel"|"sles"|"ubuntu"|"ol") ;; *) warn_if_bad 1 "${GO_XCAT_LINUX_DISTRO}: unsupported Linux distro" diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index d6f823432..30ab5af31 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -68,7 +68,7 @@ Requires: grub2-xcat >= 2.02-0.76.el7.1.snap201905160255 perl-Net-HTTPS-NB perl- %else %ifos linux # do this for non-fsm linux -Requires: perl-IO-Tty perl-Crypt-SSLeay make +Requires: perl-IO-Tty perl-Crypt-SSLeay make httpd %endif %endif diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 0d9eed54a..50a0de914 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -3,6 +3,7 @@ tabdump_servicenode reg_linux_diskless_installation_hierarchy tabdump_servicenode reg_linux_diskfull_installation_hierarchy +makentp_extntpserver_value tabdump_servicenode updatenode_P_script1 updatenode_P_script1_script2 @@ -140,6 +141,7 @@ makeknownhosts_node_d tabdump_servicenode makentp_h makentp_v +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 0e45189e3..a39991440 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 +makentp_extntpserver_value compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 @@ -141,6 +142,7 @@ makehosts_null makeknownhosts_node_d makentp_h makentp_v +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 29bda82ab..608e862ee 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 +makentp_extntpserver_value compare_postscripts updatenode_P_script1 updatenode_P_script1_script2 @@ -141,6 +142,7 @@ makehosts_null makeknownhosts_node_d makentp_h makentp_v +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 63dfc7e00..db5fb3832 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_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 +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help @@ -101,6 +102,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index 7aaf23dc5..33c28f32a 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_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 +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help @@ -101,6 +102,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 983d59527..92a9daad8 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 +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help @@ -70,6 +71,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 84f8f6968..712a82052 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 +makentp_extntpserver_value compare_postscripts assign_certain_command_permission bmcdiscover_help @@ -70,6 +71,7 @@ makehosts_help makehosts_n makehosts_n_noderange makeknownhosts_node_d +makenetworks_d_V mkdef_null mkdef_regex_bmc mkdef_regex_ip diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index d98f9fc7a..76ace4f45 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -7,13 +7,16 @@ node=$1 osimage=$2 vmhost=`lsdef $node -i vmhost -c | cut -d '=' -f 2` times=3 +wait_for_provision=30 #Min to wait for node to provision +check_status=10 #Sec to keep checking status +iterations=$wait_for_provision*60/$check_status #Iterations to check for "booted" status if [ $# -eq 3 ]; then times=$3 fi -echo "Try to rinstall for $times times ......" +echo "Try to rinstall for $times times (allowing $wait_for_provision min for each try) ......" for (( tryreinstall = 1 ; tryreinstall <= $times ; ++tryreinstall )) do @@ -43,11 +46,11 @@ do sleep 360 while [ ! `lsdef -l $node|grep status|grep booted` ] do - sleep 10 + sleep $check_status stat=`lsdef $node -i status -c | cut -d '=' -f 2` echo "[$a] The status is not booted... ($stat)" a=++a - if [ $a -gt 400 ];then + if [ $a -gt $(($iterations + 0)) ];then a=0 break fi diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 911f01641..132aff547 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -253,14 +253,16 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/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 -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:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" 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 -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 +check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 end start:confignetwork_secondarynic_nicextraparams_updatenode @@ -788,7 +790,7 @@ 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,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 -cmd:updatenode $$CN -P confignetwork +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 @@ -796,7 +798,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. check:rc==0 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 +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 @@ -844,7 +846,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. check:rc==0 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 +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 @@ -853,7 +855,7 @@ 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,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 +cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 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 @@ -949,14 +951,15 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -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 +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";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";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";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 check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" 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: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 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +check:rc==0 cmd:chtab -d node=$$CN nics +check:rc==0 end start:confignetwork__bridge_false diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 2061dcdb3..3d5628ef8 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -46,13 +46,13 @@ check:rc==0 cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo . check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";path2="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";path2="rh";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path2$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; check:rc==0 #add support python in sn @@ -106,7 +106,7 @@ check:rc==0 cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN "rpm -qa|grep python2-greenlet"; else echo "there is no xCAT-openbmc-py installed in MN, skip check python2-greenlet installation in SN"; exit 0;fi check:rc==0 cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" -cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi +cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" || "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi check:rc==0 cmd:makentp -a 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 f05480679..6f483fbfd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -107,6 +107,9 @@ cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 cmd:chdef -m -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" check:rc==0 +# Remove diskless image to free up disk space +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 end start:reg_linux_diskless_installation_hierarchy_squashfs @@ -153,8 +156,8 @@ cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netb cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -#Make sure squashfs-tools rpm is installed on RHEL -cmd:if [[ "$$OS" =~ "rhel" ]]; then yum install -y squashfs-tools; fi +#Make sure squashfs-tools rpm is installed on RHEL and OL +cmd:if [[ "$$OS" =~ "rhel" || "$$OS" =~ "ol" ]]; then yum install -y squashfs-tools; fi #Make sure squashfs-tools rpm is installed on Ubuntu cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi @@ -206,5 +209,8 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconserverc cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 +# Remove diskless image to free up disk space +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 64e3fca66..5027166db 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -72,8 +72,13 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compu check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +#Before doing prsync of /install to the service node, check if there is enough space there +cmd:du -sh /install +cmd:xdsh $$SN df -H cmd:prsync /install $$SN:/ check:rc==0 +check:output=~$$SN: done +check:output!~write failed cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 6337a694f..ea2ab343c 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -65,9 +65,13 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compu check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +#Before doing prsync of /install to the service node, check if there is enough space there +cmd:du -sh /install +cmd:xdsh $$SN df -H cmd:prsync /install $$SN:/ check:rc==0 - +check:output=~$$SN: done +check:output!~write failed cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index 312e12854..7877a3fb1 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -13,7 +13,7 @@ check:output=~on|skip cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then tabdump -w node==$$CN kvm_nodedata; fi check:rc==0 -cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" -a "__GETNODEATTR($$SN,mgt)__" != "openbmc" ];then echo "SN node $$SN is a VM, mgt is __GETNODEATTR($$SN,mgt)__, starting to recreate the VM"; echo "rpower $$SN off"; rpower $$SN off; sleep 3; echo "rpower $$SN stat"; rpower $$SN stat; var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`; echo "The disk type of $$SN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$SN"; mkvm $$SN; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN"; mkvm $$SN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$SN -s 30G -f"; mkvm $$SN -s 30G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 30G -f"; mkvm $$SN -s 30G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix disk type $var"; exit 2; else echo "Unsupported disk type $var"; exit 3;fi;else echo "SN node $$SN is not a VM; do not need to recreate it";fi +cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" -a "__GETNODEATTR($$SN,mgt)__" != "openbmc" ];then echo "SN node $$SN is a VM, mgt is __GETNODEATTR($$SN,mgt)__, starting to recreate the VM"; echo "rpower $$SN off"; rpower $$SN off; sleep 3; echo "rpower $$SN stat"; rpower $$SN stat; var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`; echo "The disk type of $$SN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$SN"; mkvm $$SN; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN"; mkvm $$SN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$SN -s 50G -f"; mkvm $$SN -s 50G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 50G -f"; mkvm $$SN -s 50G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix disk type $var"; exit 2; else echo "Unsupported disk type $var"; exit 3;fi;else echo "SN node $$SN is not a VM; do not need to recreate it";fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index 28eef1e18..cf5a27d64 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -46,30 +46,26 @@ cmd:lsdef -t site -o clustersite -i extntpservers -c >/tmp/extntpserver check:rc==0 cmd:chtab key=extntpservers site.value="$$extntpserversip" check:rc==0 +cmd:date | awk '{print $6}' > /tmp/currentyear +check:rc==0 cmd:date -s 20000101 check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock -w;else hwclock -w ; fi check:rc==0 cmd:makentp check:rc==0 -check:output=~configuring management node: $$MN -cmd:makentp -V +cmd:curryear=`cat /tmp/currentyear`;date | grep $curryear check:rc==0 -check:output=~configuring management node: $$MN -check:output=~checking if nptd is installed -check:output=~backing up the ntp configuration file /etc/ntp.conf -check:output=~ntp servers are: $$extntpserversip -check:output=~stopping ntpserver -check:output=~starting ntpserver -check:output=~enabling ntpserver -cmd:date -check:output=~$$DATE -cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock ;else hwclock ; fi +check:output=~\d +cmd:curryear=`cat /tmp/currentyear`;if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]];then clock | grep $curryear;else hwclock | grep $curryear ; fi check:rc==0 -check:output=~$$DATE +check:output=~\d cmd:extntpserver=`cat /tmp/extntpserver | awk -F = '{print \$2}'`;chtab key=extntpservers site.value=$extntpserver check:rc==0 cmd:rm -rf /tmp/extntpserver +check:rc==0 +cmd:rm -f /tmp/currentyear +check:rc==0 end start:updatenode_computenode_P_setupntp diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a0afec2a5..2a606a2d2 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -45,7 +45,7 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "rm -rf /oldxcat" cmd:xdsh $$CN "mkdir -p /oldxcat" check:rc==0 -cmd:xdsh $$CN "zypper install bzip2" +cmd:xdsh $$CN "zypper -n install bzip2" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION1_DEP" check:rc==0 @@ -164,7 +164,7 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "rm -rf /oldxcat" cmd:xdsh $$CN "mkdir -p /oldxcat" check:rc==0 -cmd:xdsh $$CN "zypper install bzip2" +cmd:xdsh $$CN "zypper -n install bzip2" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION2_CORE" check:rc==0 @@ -189,7 +189,7 @@ check:rc==0 cmd:xdsh $$CN "zypper -n install xCAT" check:rc==0 # Name of createrepo package on sles15 is different from sles12 -cmd:if [ "__GETNODEATTR($$CN,os)__" = "sle15" ]; then xdsh $$CN "zypper -n install createrepo_c"; else xdsh $$CN "zypper -n install createrepo";fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "sle15" ]]; then xdsh $$CN "zypper -n install createrepo_c"; else xdsh $$CN "zypper -n install createrepo";fi check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh" check:rc==0 diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 01ec0b777..47ebfa45f 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -962,6 +962,10 @@ sub load_case { my $fd = undef; my %invalidcases; + + # invalidoptions saves invalid OS, or ARCH, or HCP + my %invalidoptions; + my %case_name_index_map_bak; foreach my $file (@files) { if (!open($fd, "<$file")) { @@ -1036,7 +1040,7 @@ sub load_case { my @newvalidoslist = (); foreach my $validos (@validoslist) { if ($validos =~ /linux/i) { - push(@newvalidoslist, ("rhel", "sles", "ubuntu")); + push(@newvalidoslist, ("rhels", "sles", "ubuntu")); } else { push(@newvalidoslist, $validos); } @@ -1062,6 +1066,7 @@ sub load_case { delete $$case_name_index_map_ref{ $case_ref->[$i]->{name} }; if (!grep (/$case_ref->[$i]->{name}/, @{ $invalidcases{"noruncases"} })) { push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + push @{ $invalidoptions{"invalid-os"} }, "$case_ref->[$i]->{os}"; } } } @@ -1121,6 +1126,7 @@ sub load_case { delete $$case_name_index_map_ref{ $case_ref->[$i]->{name} }; if (!grep (/$case_ref->[$i]->{name}/, @{ $invalidcases{"noruncases"} })) { push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + push @{ $invalidoptions{"invalid-arch"} }, "$case_ref->[$i]->{arch}"; } } } @@ -1152,6 +1158,7 @@ sub load_case { delete $$case_name_index_map_ref{ $case_ref->[$i]->{name} }; if (!grep (/$case_ref->[$i]->{name}/, @{ $invalidcases{"noruncases"} })) { push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + push @{ $invalidoptions{"invalid-hcp"} }, "$case_ref->[$i]->{hcp}"; } } } @@ -1249,7 +1256,18 @@ sub load_case { } if ($invalidcases{"noruncases"} && @{ $invalidcases{"noruncases"} }) { - log_this($running_log_fd, "Unsuitable current environment:", @{ $invalidcases{"noruncases"} }); + my $temp_invalid_op; + my $test_case = $invalidcases{"noruncases"}[0]; + if (exists $invalidoptions{"invalid-os"}) { + $temp_invalid_op = $invalidoptions{"invalid-os"}[0]; + print "Test case $test_case has an invalid OS option - $temp_invalid_op\n"; + } elsif (exists $invalidoptions{"invalid-arch"}) { + $temp_invalid_op = $invalidoptions{"invalid-arch"}[0]; + print "Test case $test_case has an invalid ARCH option - $temp_invalid_op\n"; + } elsif (exists $invalidoptions{"invalid-hcp"}) { + $temp_invalid_op = $invalidoptions{"invalid-hcp"}[0]; + print "Test case $test_case has an invalid HCP option - $temp_invalid_op\n"; + } push @wrong_cases, @{ $invalidcases{"noruncases"} }; $caseerror = 2; } diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 7c089d253..0b481d013 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -867,9 +867,9 @@ EOF` fi elif [ $haszypper -eq 1 ]; then if [ $VERBOSE ]; then - echo "$envlist zypper --non-interactive update --auto-agree-with-license" + echo "$envlist zypper --non-interactive update --auto-agree-with-licenses" fi - result=`eval $envlist zypper --non-interactive update --auto-agree-with-license 2>&1` + result=`eval $envlist zypper --non-interactive update --auto-agree-with-licenses 2>&1` R=$? if [ $R -ne 0 ]; then diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index a95c621da..c0466607a 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -145,7 +145,7 @@ fi unset MASTER unset NTPSERVERS -check_exec_or_exit cp cat logger +check_exec_or_exit cp cat logger grep check_exec_or_exit systemctl timedatectl hwclock systemctl stop ntp.service 2>/dev/null @@ -167,6 +167,16 @@ warn_if_bad "$?" "Failed to configure the system to maintain the RTC in universa # Synchronize and set the system clock once logger -t $log_label -p local4.info "Syncing the clock ..." + +if [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null +then + # Some versions of chronyd on Ubuntu distros have an issue + # with the valid option "pidfile /dev/null". + pidfile_option="" +else + pidfile_option="pidfile /dev/null" +fi + chronyd -f /dev/null -q "$( if [ "${#NTP_SERVERS[@]}" -gt "0" ] then @@ -174,7 +184,7 @@ chronyd -f /dev/null -q "$( else echo "pool pool.ntp.org iburst" fi -)" "pidfile /dev/null" +)" "$pidfile_option" rm -f /etc/adjtime # Set the hardware clock from the system clock