diff --git a/Version b/Version index 3b1fc7950..6d28a11dd 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.15.1 +2.16 diff --git a/docs/source/QA/makehosts_qa.rst b/docs/source/QA/makehosts_qa.rst deleted file mode 100644 index 375c4c75b..000000000 --- a/docs/source/QA/makehosts_qa.rst +++ /dev/null @@ -1,132 +0,0 @@ -DNS,hostname and alias Q/A list -------------------------------- - -Q: When there are multiple NICs, how to generate ``/etc/hosts`` records? -```````````````````````````````````````````````````````````````````````` - -When there are multiple NICs, and you want to use ``confignetwork`` to configure these NICs, suggest to use ``hosts`` table to configure installnic and use ``nics`` table to configure secondary NICs. You can refer to the following best practice example to generate ``/etc/hosts`` records. - -**Best practice example**: - - * There are 2 networks in different domains: ``mgtnetwork`` and ``pubnetwork`` - * ``mgtnetwork`` is xCAT management network - * There are 2 adapters in system node1: ``eth0`` and ``eth1`` - * Add installnic ``eth0`` ``10.5.106.101`` record in ``/etc/hosts``, its alias is ``mgtnic`` - * hostnames ``node1-pub`` and ``node1.public.com`` are for nic ``eth1``, ip is ``192.168.30.101`` - -**Steps**: - - #. Add networks entry in ``networks`` table: :: - - chdef -t network mgtnetwork net=10.0.0.0 mask=255.0.0.0 domain=cluster.com - chdef -t network pubnetwork net=192.168.30.0 mask=255.255.255.0 domain=public.com - - #. Create ``node1`` with installnic ip ``10.5.106.101``, its alias is ``mgtnic``: :: - - chdef node1 ip=10.5.106.101 hostnames=mgtnic groups=all - - #. Configure ``eth1`` in ``nics`` table: :: - - chdef node1 nicips.eth1=192.168.30.101 nichostnamesuffixes.eth1=-pub nicaliases.eth1=node1.public.com nictypes.eth1=Ethernet nicnetworks.eth1=pubnetwork - - #. Check ``node1`` definition: :: - - lsdef node1 - Object name: node1 - groups=all - ip=10.5.106.101 - hostnames=mgtnic - nicaliases.eth1=node1.public.com - nichostnamesuffixes.eth1=-pub - nicips.eth1=192.168.30.101 - nicnetworks.eth1=pubnetwork - nictypes.eth1=Ethernet - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - - #. Execute ``makehosts -n`` to generate ``/etc/hosts`` records: :: - - makehosts -n - - #. Check results in ``/etc/hosts``: :: - - 10.5.106.101 node1 node1.cluster.com mgtnic - 192.168.30.101 node1-pub node1.public.com - - #. Edit ``/etc/resolv.conf``, xCAT management node ip like ``10.5.106.2`` is nameserver: :: - - search cluster.com public.com - nameserver 10.5.106.2 - - #. Execute ``makedns -n`` to configure DNS - -Q: How to configure aliases? -```````````````````````````` - -There are 3 methods to configure aliases: - -#. Use ``hostnames`` in ``hosts`` table to configure aliases for the installnic. -#. If you want to use script ``confignetwork`` to configure secondary NICs, suggest to use ``aliases`` in ``nics`` table to configure aliases, you can refer to :doc:`Configure Aliases <../guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_aliases>` -#. If you want to generate aliases records in ``/etc/hosts`` for secondary NICs, and don't want to use script ``confignetwork`` to configure these NICs, suggest to use ``otherinterfaces`` in ``hosts`` table to configure aliases. You can refer to following example: - - * If you want to add ``node1-hd`` ``20.1.1.1`` in ``hosts`` table, and don't use ``confignetwork`` to configure it, you can add ``otherinterfaces`` like this: :: - - chdef node1 otherinterfaces="node1-hd:20.1.1.1" - - * After executing ``makehosts -n``, you can get records in ``/etc/hosts`` like following: :: - - 20.1.1.1 node1-hd - -**Note**: If suffixes or aliases for the same IP are configured in both ``hosts`` table and ``nics`` table, will cause conflicts. ``makehosts`` will use values from ``nics`` table. The values from ``nics`` table will over-write that from ``hosts`` table to create ``/etc/hosts`` records. - -Q: How to handle the same short hostname in different domains? -`````````````````````````````````````````````````````````````` - -You can follow the best practice example. - -**Best practice example**: - - * There are 2 networks in different domains: ``mgtnetwork`` and ``pubnetwork`` - * ``mgtnetwork`` is xCAT management network - * Generate 2 records with the same hostname in ``/etc/hosts``, like: :: - - 10.5.106.101 node1.cluster.com - 192.168.20.101 node1.public.com - - * Nameserver is xCAT management node IP - -**Steps**: - - #. Add networks entry in ``networks`` table: :: - - chdef -t network mgtnetwork net=10.0.0.0 mask=255.0.0.0 domain=cluster.com - chdef -t network pubnetwork net=192.168.30.0 mask=255.255.255.0 domain=public.com - - #. Create ``node1`` with ``ip=10.5.106.101``, xCAT can manage and install this node: :: - - chdef node1 ip=10.5.106.101 groups=all - - #. Create ``node1-pub`` with ``ip=192.168.30.101``, this node is only used to generate ``/etc/hosts`` records for public network, can use ``_unmanaged`` group name to label it: :: - - chdef node1-pub ip=192.168.30.101 hostnames=node1.public.com groups=_unmanaged - - #. Execute ``makehosts -n`` to generate ``/etc/hosts`` records: :: - - makehosts -n - - #. Check results in ``/etc/hosts``: :: - - 10.5.106.101 node1 node1.cluster.com - 192.168.30.101 node1-pub node1.public.com - - #. Edit ``/etc/resolv.conf``, for example, xCAT management node IP is 10.5.106.2 : :: - - search cluster.com public.com - nameserver 10.5.106.2 - - #. Execute ``makedns -n`` to configure DNS - -Q: When to use ``hosts`` table and ``nics`` table? -`````````````````````````````````````````````````` - -``hosts`` table is used to store IP addresses and hostnames of nodes. ``makehosts`` use these data to create ``/etc/hosts`` records. ``nics`` table is used to stores secondary NICs details. Some scripts like ``confignetwork`` use data from ``nics`` table to configure secondary NICs. ``makehosts`` also use these data to create ``/etc/hosts`` records for each NIC. diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index 03eaeaad3..063be13f2 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -301,7 +301,7 @@ nicips example: :: NOTE: The management interface **(eth0)**, that the **compute02** IP is configured on, is not included in the list of additional nics. Although adding it to the list of nics would do no harm. -This **nicips** value indicates that there are two additional interfaces to be configured on node compute02,eth1 and eth2. The **eth1** interface will get the IP address **11.10.1.2**. The **eth2** interface will get two IP addresses, **"80.0.0.2" and "70.0.0.2"**. +This **nicips** value indicates that there are two additional interfaces to be configured on node compute02, eth1 and eth2. The **eth1** interface will get the IP address **11.10.1.2**. The **eth2** interface will get two IP addresses, **"80.0.0.2" and "70.0.0.2"**. nichostnamesuffixes example: :: @@ -329,7 +329,7 @@ nicnetworks example: :: chdef -t node -o compute02 nicnetworks.eth1=clstrnet11 nicnetworks.eth2='clstrnet80|clstrnet-lab' -In this example we are saying that the IP address of "eth0" (ie. compute02-eth1 -> 11.10.1.2) is part of the xCAT network named **"clstrnet11"**. **"compute02-eth2"** is in network **"clstrnet80"** and **"compute02-eth2-lab"** is in **"clstrnet-lab"**. +In this example we are saying that the IP address of **"eth1"** (ie. compute02-eth1 -> 11.10.1.2) is part of the xCAT network named **"clstrnet11"**. **"compute02-eth2"** is in network **"clstrnet80"** and **"compute02-eth2-lab"** is in **"clstrnet-lab"**. By default the xCAT code will attempt to match the interface IP to one of the xCAT network definitions. diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst index ab574af45..9c6ff0d2a 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst @@ -499,13 +499,13 @@ The operating system is installed on the internal disks. #. Create file systems on shared disks - Run the ``mkfs.ext3`` command on the primary management node to create file systems on the shared disk that will contain the xCAT data. For example: :: + Run the ``mkfs.ext4`` command on the primary management node to create file systems on the shared disk that will contain the xCAT data. For example: :: - mkfs.ext3 -v /dev/sdc1 - mkfs.ext3 -v /dev/sdc2 - mkfs.ext3 -v /dev/sdc3 - mkfs.ext3 -v /dev/sdc4 - mkfs.ext3 -v /dev/sdc5 + mkfs.ext4 -v /dev/sdc1 + mkfs.ext4 -v /dev/sdc2 + mkfs.ext4 -v /dev/sdc3 + mkfs.ext4 -v /dev/sdc4 + mkfs.ext4 -v /dev/sdc5 If you place entries for the disk in ``/etc/fstab``, which is not required, ensure that the entries do not have the system automatically mount the disk. diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index 5e1d14785..259a748a0 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -3,7 +3,7 @@ Define Service Nodes This next part shows how to configure a xCAT Hierarchy and provision xCAT service nodes from an existing xCAT cluster. -*The document assumes that the compute nodes that are part of your cluster have already been defined into the xCAT database and you have successfully provisioned the compute nodes using xCAT* +.. note:: The document assumes that the compute nodes that are part of your cluster have already been defined into the xCAT database and you have successfully provisioned the compute nodes using xCAT The following table illustrates the cluster being used in this example: @@ -42,7 +42,7 @@ The following table illustrates the cluster being used in this example: chdef -t node -o r1n01,r2n01 -p groups=service -#. When ``copycds`` was run against the ISO image, several osimages are created into the ``osimage`` table. The ones named ``*-service`` are provided by easily help provision xCAT service nodes. :: +#. When ``copycds`` was run against the ISO image, several osimages were created into the ``osimage`` table. The ones named ``*-service`` are provided to easily help provision xCAT service nodes. :: # lsdef -t osimage | grep rhels7.1 rhels7.1-ppc64le-install-compute (osimage) @@ -58,14 +58,14 @@ The following table illustrates the cluster being used in this example: setupconserver=2 **Tips/Hint** - * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to 0, otherwise xCAT will not recognize the node as a service node + * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to ``0``, otherwise xCAT will not recognize the node as a service node * See the ``setup*`` attributes in the node definition man page for the list of available services: ``man node`` - * For clusters with subnetted management networks, you might want to set ``setupupforward=1`` + * For clusters with subnetted management networks, you might want to set ``setupipforward=1`` * For the ``setupconserver`` attribute, if ``conserver`` is used, set to ``1``, if ``goconserver`` is used, set to ``2`` #. Add additional postscripts for Service Nodes (optional) - By default, xCAT will execute the ``servicenode`` postscript when installed or diskless booted. This postscript will set up the necessary credentials and installs the xCAT software on the Service Nodes. If you have additional postscripts that you want to execute on the service nodes, copy to ``/install/postscripts`` and run the following: :: + By default, xCAT will execute the ``servicenode`` postscript when installed or diskless booted. This postscript will set up the necessary credentials and install the xCAT software on the Service Nodes. If you have additional postscripts that you want to execute on the service nodes, copy to ``/install/postscripts`` and run the following: :: chdef -t group -o service -p postscripts= @@ -76,21 +76,21 @@ The following table illustrates the cluster being used in this example: * ``servicenode`` - defines which Service Node the **Management Node** should send commands to (e.g ``xdsh``) and should be set to the hostname or IP address of the service node that the management node can contact it by. * ``xcatmaster`` - defines which Service Node the **Compute Node** should boot from and should be set to the hostname or IP address of the service node that the compute node can contact it by. - You must set both ``servicenode`` and ``xcatmaster`` regardless of whether or not you are using service node pools, for most scenarios, the value will be identical. :: + You must set both ``servicenode`` and ``xcatmaster`` regardless of whether or not you are using service node pools. For most scenarios, the value will be identical. :: chdef -t group -o rack1 servicenode=r1n01 xcatmaster=r1n01 chdef -t group -o rack2 servicenode=r2n01 xcatmaster=r2n01 -#. Set the conserver and monserver attributes +#. Set the ``conserver`` and ``monserver`` attributes - Set which service node should run the conserver (console) and monserver (monitoring) daemon for the nodes in the group. The most typical setup is to have the service node also ad as it's conserver and monserver. :: + Set which service node should run the conserver (console) and monserver (monitoring) daemon for the nodes in the group. The most typical setup is to have the service node also act as it's conserver and monserver. :: chdef -t group -o rack1 conserver=r1n01 monserver=r1n01 chdef -t group -o rack2 conserver=r2n01 monserver=r2n01 #. Choose location of ``/install`` and ``/tftpboot`` directories (optional). - The ``site`` table attributes ``installloc`` and ``sharedtftp`` control mounting of ``/install`` and ``/tftpboot`` directories from Management Node to Service node. + The ``site`` table attributes ``installloc`` and ``sharedtftp`` control mounting of ``/install`` and ``/tftpboot`` directories from Management Node to Service Node. To mount ``/install`` and ``/tftpboot`` directories from Management node to each Service Node: :: diff --git a/docs/source/advanced/networks/infiniband/network_configuration.rst b/docs/source/advanced/networks/infiniband/network_configuration.rst index 3f675a7ba..c708d387e 100644 --- a/docs/source/advanced/networks/infiniband/network_configuration.rst +++ b/docs/source/advanced/networks/infiniband/network_configuration.rst @@ -3,7 +3,7 @@ IB Network Configuration xCAT provides a script ``configib`` to help configure the Infiniband adapters on the compute nodes. -The Infiniband adapter is considered an additional interface for xCAT. The process for configuring Infiniband adapters complies with the process of :doc:`Configure Additional Network Interfaces <../../../../guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter>`. +The Infiniband adapter is considered an additional interface for xCAT. The process for configuring Infiniband adapters complies with the process of :doc:`Configure Additional Network Interfaces <../../../../guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter>`. Below are an simple example to configure Mellanox IB in Ubuntu 14.04.1 on Power8 LE @@ -25,12 +25,12 @@ If your target Mellanox IB adapter has 2 ports, and you plan to give port ib0 4 * To configure during node installation :: - chdef -p postscripts="confignics --ibaports=2" + chdef -p postscripts="confignetwork --ibaports=2" nodeset osimage= rsetboot net rpower reset * To configure on a node which has had operating system :: - updatenode -P "confignics --ibaports=2" + updatenode -P "confignetwork --ibaports=2" diff --git a/docs/source/conf.py b/docs/source/conf.py index 0a3d8b2c3..9ea646c4c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.15.1' +release = '2.15.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 cc170bd82..bd09ac1d1 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 @@ -36,7 +36,7 @@ The partition file must follow the partitioning syntax of the respective install * 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 + * Use yast2 clone_system to create autoyast configuration file ``/root/autoinst.xml`` to clone an existing system * Ubuntu: `Preseed documentation `_ @@ -107,7 +107,7 @@ Here is partition definition file example for SLES standard partition in X86_64 true - ext3 + ext4 true / path @@ -131,7 +131,7 @@ The following is an example of a partition definition file for a SLES LVM Partit true false - ext3 + ext4 true false device @@ -148,7 +148,7 @@ The following is an example of a partition definition file for a SLES LVM Partit true false - ext3 + ext4 true false /boot @@ -211,7 +211,7 @@ The following is an example of a partition definition file for a SLES LVM Partit true false - ext3 + ext4 true false root @@ -248,7 +248,7 @@ Here is partition definition file example for SLES standard partition in ppc64 m true false - ext3 + ext4 false false device @@ -274,7 +274,7 @@ Here is partition definition file example for SLES standard partition in ppc64 m true false - ext3 + ext4 true acl,user_xattr false @@ -328,19 +328,19 @@ Here is partition definition file example for Ubuntu standard partition in x86_6 filesystem{ vfat } mountpoint{ /boot/efi } . - 256 256 512 ext3 + 256 256 512 ext4 $primary{ } method{ format } format{ } use_filesystem{ } - filesystem{ ext3 } + filesystem{ ext4 } mountpoint{ /boot } . 64 512 300% linux-swap method{ swap } format{ } . - 512 1024 4096 ext3 + 512 1024 4096 ext4 $primary{ } method{ format } format{ } @@ -348,7 +348,7 @@ Here is partition definition file example for Ubuntu standard partition in x86_6 filesystem{ ext4 } mountpoint{ / } . - 100 10000 1000000000 ext3 + 100 10000 1000000000 ext4 method{ format } format{ } use_filesystem{ } @@ -376,13 +376,13 @@ To generate the configuration, run the ``nodeset`` command: :: .. BEGIN_Partition_Definition_Script_overview -Create a shell script that will be run on the node during the install process to dynamically create the disk partitioning definition. This script will be run during the OS installer %pre script on RedHat or preseed/early_command on Unbuntu execution and must write the correct partitioning definition into the file /tmp/partitionfile on the node +Create a shell script that will be run on the node during the install process to dynamically create the disk partitioning definition. This script will be run during the OS installer %pre script on RedHat or preseed/early_command on Unbuntu execution and must write the correct partitioning definition into the file ``/tmp/partitionfile`` on the node .. END_Partition_Definition_Script_overview .. BEGIN_Partition_Definition_Script_Create_partition_script_content -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 +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. @@ -403,7 +403,7 @@ Here is an example of the partition script on RedHat and SLES, the partitioning else FSTYPE=ext3 fi - BOOTFSTYPE=ext3 + BOOTFSTYPE=ext4 EFIFSTYPE=vfat if uname -r|grep ^3.*el7 > /dev/null; then FSTYPE=xfs @@ -429,21 +429,21 @@ Here is an example of the partition script on RedHat and SLES, the partitioning .. BEGIN_Partition_Definition_Script_Create_partition_script_example_ubuntu -The following is an example of the partition script on Ubuntu, the partitioning script is /install/custom/my-partitions.sh: :: +The following is an example of the partition script on Ubuntu, the partitioning script is ``/install/custom/my-partitions.sh``: :: if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitionfile - echo " 512 512 1024 fat16" >> /tmp/partitionfile + echo " 512 512 1024 fat32" >> /tmp/partitionfile echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile else echo "ubuntu-boot ::" > /tmp/partitionfile - echo "100 50 100 ext3" >> /tmp/partitionfile - echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /boot }' >> /tmp/partitionfile + echo "100 50 100 ext4" >> /tmp/partitionfile + echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile fi - echo "500 10000 1000000000 ext3" >> /tmp/partitionfile - echo " method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / }" >> /tmp/partitionfile + echo "500 10000 1000000000 ext4" >> /tmp/partitionfile + echo " method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / }" >> /tmp/partitionfile echo " ." >> /tmp/partitionfile echo "2048 512 300% linux-swap" >> /tmp/partitionfile echo " method{ swap } format{ }" >> /tmp/partitionfile @@ -458,9 +458,9 @@ Run below commands to associate partition script with osimage: :: chdef -t osimage partitionfile='s:/install/custom/my-partitions.sh' nodeset 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. +- 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. .. END_Partition_Definition_Script_Associate_partition_script_with_osimage_common @@ -477,14 +477,14 @@ If not specified, the default value will be used. chdef -t osimage -p partitionfile='d:/install/custom/partitiondisk' nodeset osimage= -- the 'd:' preceding the filename tells nodeset that this is a partition disk file. -- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, it will generate a script to write the content of the partition disk file to /tmp/install_disk, this context to run the script will replace the #XCA_PARTMAN_DISK_SCRIPT# directive in /install/autoinst/.pre. +- the ``d:`` preceding the filename tells nodeset that this is a partition disk file. +- For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, it will generate a script to write the content of the partition disk file to ``/tmp/install_disk``, this context to run the script will replace the ``#XCA_PARTMAN_DISK_SCRIPT#`` directive in ``/install/autoinst/.pre``. .. END_Partition_Disk_File_ubuntu_only .. BEGIN_Partition_Disk_Script_ubuntu_only -The disk script contains a script to generate a partitioning disk file named "/tmp/install_disk". for example: :: +The disk script contains a script to generate a partitioning disk file named ``/tmp/install_disk``. for example: :: rm /tmp/devs-with-boot 2>/dev/null || true; for d in $(list-devices partition); do @@ -512,8 +512,8 @@ If not specified, the default value will be used. chdef -t osimage -p partitionfile='s:d:/install/custom/partitiondiskscript' nodeset osimage= -- the 's:' prefix tells nodeset that is a script, the 's:d:' preceding the filename tells nodeset that this is a script to generate the partition disk file. -- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, this context to run the script will replace the #XCA_PARTMAN_DISK_SCRIPT# directive in /install/autoinst/.pre. +- the ``s:`` prefix tells ``nodeset`` that is a script, the ``s:d:`` preceding the filename tells ``nodeset`` that this is a script to generate the partition disk file. +- For Ubuntu, when nodeset runs and generates the ``/install/autoinst`` file for a node, this context to run the script will replace the ``#XCA_PARTMAN_DISK_SCRIPT#`` directive in ``/install/autoinst/.pre``. .. END_Partition_Disk_Script_ubuntu_only @@ -522,7 +522,7 @@ If not specified, the default value will be used. To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed configuration entries should be specified. -If using file way, 'c:', the additional preseed config file contains the additional preseed entries in "d-i ..." syntax. When "nodeset", the #XCA_PARTMAN_ADDITIONAL_CFG# directive in /install/autoinst/ will be replaced with content of the config file. For example: :: +If using file way, ``c:``, the additional preseed config file contains the additional preseed entries in ``d-i ...`` syntax. When ``nodeset``, the ``#XCA_PARTMAN_ADDITIONAL_CFG#`` directive in ``/install/autoinst/`` will be replaced with content of the config file. For example: :: d-i partman-auto/method string raid d-i partman-md/confirm boolean true diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst index 73d966f58..7d848eb9b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst @@ -40,7 +40,7 @@ An example ``localdisk`` configuration file: :: [localspace] dev=/dev/sda1 - fstype=ext3 + fstype=ext4 [swapspace] dev=/dev/sda2 @@ -55,7 +55,7 @@ The ``[disk]`` section is used to configure how to partition a hard disk: * dev: The path of the device file. * clear: If set to ``yes`` it will clear all the existing partitions on this disk. * ptype: The partition table type of the disk. For example, ``msdos`` or ``gpt``, and ``msdos`` is the default. - * fstype: The file system type for the new created partitions. ``ext3`` is the default. + * fstype: The file system type for the new created partitions. ``ext4`` is the default. * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If set to ``50``, 50% of the disk space will be assigned to that partition. The ``[localspace]`` section is used to specify which partition will be used as local storage for the node. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst index 42fe6863e..40ac98a28 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/install_new_kernel.rst @@ -86,4 +86,4 @@ The default driver list: :: Note: With this approach, xCAT will search for the drivers in the rootimage. You need to make sure the drivers have been included in the rootimage before generating the initrd. You can install the drivers manually in an existing rootimage (using chroot) and run genimage again, or you can use a postinstall script to install drivers to the rootimage during your initial genimage run. -Use the driver rpm package to add new drivers from rpm packages to the diskless initrd. Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter` for details. +Use the driver rpm package to add new drivers from rpm packages to the diskless initrd. Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter` for details. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst index cea71e849..28e141bcd 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_ethernet_nic.rst @@ -5,9 +5,9 @@ The following example sets the xCAT properties for compute node ``cn1`` to creat * Compute node ``cn1`` with two physical NICs: ``eth0`` and ``eth1`` * Management network is ``11.1.89.0``, application network is ``13.1.89.0`` - * The install NIC is eth0, and application NIC is eth1 - * Assign static ip ``11.1.89.7/24`` to eth0 - * Assign static ip ``13.1.89.7/24`` to eth1 + * The install NIC is ``eth0``, and application NIC is ``eth1`` + * Assign static ip ``11.1.89.7/24`` to ``eth0`` + * Assign static ip ``13.1.89.7/24`` to ``eth1`` Add/update networks into the xCAT DB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -22,11 +22,11 @@ Add/update additional networks ``net11`` and ``net13`` into ``networks`` table:: Define Adapters in the nics table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#. Provision ip is coming from DHCP, there is no need to configure install nic into ``nics`` table. Provision ip can be configured in node definition, but it is not required. :: +#. The install NIC ``eth0`` on the management network will get an IP via DHCP, which will be the value of the ``ip`` attribute in the node definition. There is no need to configure install NIC into ``nics`` table. :: chdef cn1 ip=11.1.89.7 -#. Data NIC ``eth1`` is not install NIC, configure ``eth1`` into ``nics`` table :: +#. Application NIC ``eth1`` on the application network is different from install NIC ``eth0``, and will get its IP assigned from the ``eth1`` definition in the ``nics`` table :: chdef cn1 nicips.eth1="13.1.89.7" nicnetworks.eth1="net13" nictypes.eth1="Ethernet" nichostnamesuffixes.eth1=-eth1 @@ -56,7 +56,7 @@ Configure adapters with static IPs updatenode cn1 -P "confignetwork -s" -#. If install NIC is not configured in ``nics`` table, and only configure all other NIC's data defined in ``nics`` table, execute ``confignetwork`` without ``-s`` +#. If install NIC is not configured in ``nics`` table, execute ``confignetwork`` without ``-s`` to only configure NICs defined in ``nics`` table a. Add ``confignetwork`` into postscript list to execute on reboot :: @@ -66,7 +66,7 @@ Configure adapters with static IPs updatenode cn1 -P "confignetwork" -.. note:: Option ``-s`` writes the install NIC's information into configuration file for persistence. All other NIC's data defined in ``nics`` table will be written also. Without option ``-s``, ``confignetwork`` only configures all NIC's data defined in ``nics`` table. +.. note:: Option ``-s`` writes the install NIC's information into configuration file for persistence. All other NIC's data defined in ``nics`` table will be written also. Without option ``-s``, ``confignetwork`` only configures NIC's data defined in ``nics`` table. Check result ~~~~~~~~~~~~ diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst index 6934cbec2..1e5adbcec 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_extra_param.rst @@ -9,7 +9,7 @@ Use ``nicextraparams`` to customize attributes in NIC configuration file. For ex chdef cn1 nicextraparams.eth1="MTU=1456 ONBOOT=no" - #. After ``confignetwork`` is executed in ``cn1``, ``nicexraparams`` will overwrite the original value in ``/etc/sysconfig/network-scripts/ifcfg-eth1`` as :: + #. After ``confignetwork`` is executed in ``cn1``, ``nicextraparams`` will overwrite the original value in ``/etc/sysconfig/network-scripts/ifcfg-eth1`` as :: DEVICE=eth1 IPADDR=13.1.89.7 diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst deleted file mode 100644 index ce6f9b801..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst +++ /dev/null @@ -1,133 +0,0 @@ -Configure Additional Network Interfaces old version - confignics - (deprecated) -=============================================================================== - -**"confignics" is deprecated, recommend using new version "confignetwork" instead.** - -The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. - -The way the confignics postscript decides what IP address to give the secondary adapter is by checking the nics table, in which the nic configuration information is stored. - -To use the nics table and confignics postscript to define a secondary adapter on one or more nodes, follow these steps: - - -Define configuration information for the Secondary Adapters in the nics table ------------------------------------------------------------------------------ - -There are 3 ways to complete this operation. - -1. Using the ``mkdef`` and ``chdef`` commands :: - - # mkdef cn1 groups=all nicips.eth1="11.1.89.7|12.1.89.7" nicnetworks.eth1="net11|net12" nictypes.eth1="Ethernet" - 1 object definitions have been created or modified. - - # chdef cn1 nicips.eth2="13.1.89.7|14.1.89.7" nicnetworks.eth2="net13|net14" nictypes.eth2="Ethernet" - 1 object definitions have been created or modified. - -2. Using an xCAT stanza file - - - Prepare a stanza file ``.stanza`` with content similiar to the following: :: - - # - cn1: - objtype=node - arch=x86_64 - groups=kvm,vm,all - nichostnamesuffixes.eth1=-eth1-1|-eth1-2 - nichostnamesuffixes.eth2=-eth2-1|-eth2-2 - nicips.eth1=11.1.89.7|12.1.89.7 - nicips.eth2=13.1.89.7|14.1.89.7 - nicnetworks.eth1=net11|net12 - nicnetworks.eth2=net13|net14 - nictypes.eth1=Ethernet - nictypes.eth2=Ethernet - - - Using the ``mkdef -z`` option, define the stanza file to xCAT: :: - - # cat .stanza | mkdef -z - -3. Using ``tabedit`` to edit the ``nics`` database table directly - - The ``tabedit`` command opens the specified xCAT database table in a vi like editor and allows the user to edit any text and write the changes back to the database table. - - *WARNING:* Using the ``tabedit`` command is not the recommended method because it is tedious and error prone. - - After changing the content of the ``nics`` table, here is the result from ``tabdump nics`` :: - - # tabdump nics - #node,nicips,nichostnamesuffixes,nictypes,niccustomscripts,nicnetworks,nicaliases,comments,disable - "cn1","eth1!11.1.89.7|12.1.89.7,eth2!13.1.89.7|14.1.89.7","eth1!-eth1-1|-eth1-2,eth2!-eth2-1|-eth2-2,"eth1!Ethernet,eth2!Ethernet",,"eth1!net11|net12,eth2!net13|net14",,, - - -After you have defined the configuration information in any of the ways above, run the ``makehosts`` command to add the new configuration to the ``/etc/hosts`` file. :: - - # makehosts cn1 - - # cat /etc/hosts - 11.1.89.7 cn1-eth1-1 cn1-eth1-1.ppd.pok.ibm.com - 12.1.89.7 cn1-eth1-2 cn1-eth1-2.ppd.pok.ibm.com - 13.1.89.7 cn1-eth2-1 cn1-eth2-1.ppd.pok.ibm.com - 14.1.89.7 cn1-eth2-2 cn1-eth2-2.ppd.pok.ibm.com - - -Add confignics into the node's postscripts list ------------------------------------------------ - -Use command below to add confignics into the node's postscripts list :: - - chdef cn1 -p postscripts=confignics - -**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts=confignetwork`` instead above ``chdef`` command. - -By default, confignics does not configure the install nic. if need, using flag "-s" to allow the install nic to be configured. :: - - chdef cn1 -p prostscripts="confignics -s" - -Option "-s" writes the install nic's information into configuration file for persistence. All install nic's data defined in nics table will be written also. - -**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts="confignetwork -s"`` instead above ``chdef`` command. - -Add network object into the networks table ------------------------------------------- - -The ``nicnetworks`` attribute only defines the nic that uses the IP address. -Other information about the network should be defined in the ``networks`` table. - -Use the ``tabedit`` command to add/modify the networks in the``networks`` table :: - - tabdump networks - #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable - ... - "net11", "11.1.89.0", "255.255.255.0", "eth1",,,,,,,,,,,,,,,, - "net12", "12.1.89.0", "255.255.255.0", "eth1",,,,,,,,,,,,,,,, - "net13", "13.1.89.0", "255.255.255.0", "eth2",,,,,,,,,,,,,,,, - "net14", "14.1.89.0", "255.255.255.0", "eth2",,,,,,,,,,,,,,,, - -Option -r to remove the undefined NICS --------------------------------------- - -If the compute node's nics were configured by ``confignics`` and the nics configuration changed in the nics table, user the ``confignics -r`` to remove the undefined nic. - -For example, if on a compute node the ``eth0``, ``eth1``, and ``eth2`` nics were configured: :: - - # ifconfig - eth0 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e6 - ... - eth1 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e7 - ... - eth2 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e8 - ... - -Delete the eth2 definition in nics table using the ``chdef`` command. -Then run the following to remove the undefined ``eth2`` nic on the compute node: :: - - updatenode -P "confignics -r" - -The result should have ``eth2`` disabled: :: - - # ifconfig - eth0 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e6 - ... - eth1 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e7 - ... - -Deleting the ``installnic`` will result in strange problems, so ``confignics -r`` will not delete the nic set as the ``installnic``. 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 277c96346..2fa03bed8 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 @@ -632,7 +632,7 @@ This is an example of the generated postscript for a servicenode install. It is export NETMASK GATEWAY=10.2.0.100 export GATEWAY - # NIC related attributes for the node for confignics postscript + # NIC related attributes for the node for confignetwork postscript NICIPS="" export NICIPS NICHOSTNAMESUFFIXES="" diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst index 0efa6b9ff..fee02f246 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst @@ -90,7 +90,7 @@ Deploy Diskful Nodes with RAID1 Setup on SLES xCAT provides one sample autoyast template files with the RAID1 settings ``/opt/xcat/share/xcat/install/sles/service.raid1.sles11.tmpl``. You can customize the template file and put it under ``/install/custom/install//`` if the default one does not match your requirements. -Here is the RAID1 partitioning section in service.raid1.sles11.tmpl: :: +Here is the RAID1 partitioning section in ``service.raid1.sles11.tmpl``: :: @@ -188,13 +188,13 @@ The samples above created one 24MB PReP partition on each disk, one 2GB mirrored Since the PReP partition can not be mirrored between the two disks, some additional postinstall commands should be run to make the second disk bootable, here the commands needed to make the second disk bootable: :: # Set the second disk to be bootable for RAID1 setup - parted -s /dev/sdb mkfs 1 fat16 + parted -s /dev/sdb mkfs 1 fat32 parted /dev/sdb set 1 type 6 parted /dev/sdb set 1 boot on dd if=/dev/sda1 of=/dev/sdb1 bootlist -m normal sda sdb -The procedure listed above has been added to the file ``/opt/xcat/share/xcat/install/scripts/post.sles11.raid1`` to make it be automated. The autoyast template file service.raid1.sles11.tmpl will include the content of post.sles11.raid1, so no manual steps are needed here. +The procedure listed above has been added to the file ``/opt/xcat/share/xcat/install/scripts/post.sles11.raid1`` to make it be automated. The autoyast template file ``service.raid1.sles11.tmpl`` will include the content of ``post.sles11.raid1``, so no manual steps are needed here. After the diskful nodes are up and running, you can check the RAID1 settings with the following commands: @@ -230,9 +230,9 @@ The command mdadm can query the detailed configuration for the RAID partitions: Disk Replacement Procedure -------------------------- -If any one disk fails in the RAID1 array, do not panic. Follow the procedure listed below to replace the failed disk and you will be fine. +If any one disk fails in the RAID1 array, do not panic. Follow the procedure listed below to replace the failed disk. -Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: :: +Faulty disks should appear marked with an ``(F)`` if you look at ``/proc/mdstat``: :: # cat /proc/mdstat Personalities : [raid1] @@ -248,7 +248,7 @@ Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: : unused devices: -We can see that the first disk is broken because all the RAID partitions on this disk are marked as (F). +We can see that the first disk is broken because all the RAID partitions on this disk are marked as ``(F)``. Remove the failed disk from RAID array --------------------------------------- @@ -271,7 +271,7 @@ Here is the example of removing failed disk from the RAID1 array in the multipat mdadm --manage /dev/md1 --remove /dev/dm-8 mdadm --manage /dev/md2 --remove /dev/dm-11 -After the failed disk is removed from the RAID1 array, the partitions on the failed disk will be removed from ``/proc/mdstat`` and the "mdadm --detail" output also. :: +After the failed disk is removed from the RAID1 array, the partitions on the failed disk will be removed from ``/proc/mdstat`` and the ``mdadm --detail`` output also. :: # cat /proc/mdstat Personalities : [raid1] @@ -332,7 +332,7 @@ For the multipath configuration, here is an example: :: sfdisk -d /dev/dm-1 | sfdisk /dev/dm-0 -If you got error message "sfdisk: I don't like these partitions - nothing changed.", you can add "--force" option to the sfdisk command: :: +If you got error message "sfdisk: I don't like these partitions - nothing changed.", you can add ``--force`` option to the ``sfdisk`` command: :: sfdisk -d /dev/sdb | sfdisk /dev/sda --force @@ -412,7 +412,7 @@ If the new disk does not have a PReP partition or the PReP partition has some pr * **[SLES]**:: - parted -s /dev/sda mkfs 1 fat16 + parted -s /dev/sda mkfs 1 fat32 parted /dev/sda set 1 type 6 parted /dev/sda set 1 boot on dd if=/dev/sdb1 of=/dev/sda1 diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst index 57d206514..1e4f71ff2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_network_adapter.rst @@ -13,10 +13,9 @@ If configuring VLAN, BOND, or BRIDGES, ``nicdevices`` in ``nics`` table must be The following scenarios are examples to configure Ethernet adapters/BOND/VLAN/Bridge. - #. Configure Ethernet adapters: + #. Configure static install or application Ethernet adapters: * Scenario 1: :doc:`Configure Ethernet Network Interface <../../../../common/deployment/network/cfg_network_ethernet_nic>` - To configure Ethernet install NIC or other Ethernet network adapters as static #. Configure BOND **[RHEL]**: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst deleted file mode 100644 index f5cfbee00..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/cfg_second_adapter.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../../../../common/deployment/network/cfg_second_adapter.rst - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst index 08945ef1c..0d86145ea 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskful/customize_image/network/index.rst @@ -7,5 +7,4 @@ This section describes how to configure network adapters with persistent configu :maxdepth: 1 cfg_network_adapter.rst - cfg_second_adapter.rst cfg_routes.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst index 57d206514..1e4f71ff2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_network_adapter.rst @@ -13,10 +13,9 @@ If configuring VLAN, BOND, or BRIDGES, ``nicdevices`` in ``nics`` table must be The following scenarios are examples to configure Ethernet adapters/BOND/VLAN/Bridge. - #. Configure Ethernet adapters: + #. Configure static install or application Ethernet adapters: * Scenario 1: :doc:`Configure Ethernet Network Interface <../../../../common/deployment/network/cfg_network_ethernet_nic>` - To configure Ethernet install NIC or other Ethernet network adapters as static #. Configure BOND **[RHEL]**: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst deleted file mode 100644 index f5cfbee00..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/cfg_second_adapter.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../../../../common/deployment/network/cfg_second_adapter.rst - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst index 08945ef1c..0d86145ea 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/network/index.rst @@ -7,5 +7,4 @@ This section describes how to configure network adapters with persistent configu :maxdepth: 1 cfg_network_adapter.rst - cfg_second_adapter.rst cfg_routes.rst diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index dd303e369..7b6c748b1 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -23,7 +23,7 @@ SYNOPSIS \ **bmcdiscover**\ [\ **-v | -**\ **-version**\ ] -\ **bmcdiscover**\ \ **-**\ **-range**\ \ *ip_ranges*\ [\ **-**\ **-sn**\ \ *SN_nodename*\ ] [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] +\ **bmcdiscover**\ \ **-**\ **-range**\ \ *ip_ranges*\ [\ **-**\ **-sn**\ \ *SN_nodename*\ ] [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-n**\ \ *new_bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] *********** @@ -37,7 +37,7 @@ The command uses \ **nmap**\ to scan active nodes over a specified IP range. T \ **Note:**\ The scan method currently supported is \ **nmap**\ . -\ **Note:**\ Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. \ **bmcdiscover**\ will not be able to discover such systems. Run \ */opt/xcat/share/xcat/scripts/BMC_change_password.sh*\ script to change the default password for BMCs in specified range, then rerun \ **bmcdiscover**\ with \ **-p "new bmc password"**\ flag to discover systems with the changed password. +\ **Note:**\ Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. Use \ **bmcdiscover**\ with \ **-n**\ option to specify new BMC password. ******* @@ -88,6 +88,12 @@ OPTIONS +\ **-n|-**\ **-newbmcpw**\ + + New BMC user password. + + + \ **-h|-**\ **-help**\ Display usage message @@ -165,6 +171,14 @@ Output is similar to: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z +5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanza format: + + +.. code-block:: perl + + bmcdiscover --range "10.4.22-23.100" -u root -p 0penBmc -n 0penBmc123 -z + + ******** SEE ALSO diff --git a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst index 066084735..79f305bb7 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -This command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The force option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created. +The \ **mkdef**\ command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The \ **-**\ **-force**\ option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created. ******* @@ -40,15 +40,15 @@ OPTIONS \ *attr=val [attr=val ...]*\ - Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. Use the help option to get a list of valid attributes for each object type. + Specifies one or more "attribute equals value" pairs, separated by spaces. \ *attr=val*\ pairs must be specified last on the command line. Use the \ **-**\ **-help**\ option to get a list of valid attributes for each object type. - Note: when creating node object definitions, the 'groups' attribute is required. + Note: when creating node object definitions, the \ **groups**\ attribute is required. \ **-d|-**\ **-dynamic**\ - Use the dynamic option to create dynamic node groups. This option must be used with -w option. + Use the dynamic option to create dynamic node groups. This option must be used with \ **-w**\ option. @@ -66,7 +66,7 @@ OPTIONS \ *noderange*\ - A set of comma delimited node names and/or group names. (must be the first parameter) See the "noderange" man page for details on supported formats. + A set of comma delimited node names and/or group names. (must be the first parameter) See the man page for details on supported formats. @@ -78,7 +78,7 @@ OPTIONS \ **-t**\ \ *object-types*\ - A set of comma delimited object types. Use the help option to get a list of valid object types. + A set of comma delimited object types. Use the \ **-**\ **-help**\ option to get a list of valid object types. @@ -96,30 +96,43 @@ OPTIONS \ **-w**\ \ *attr==val*\ \ **-w**\ \ *attr=~val*\ ... - Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. + Use one or multiple \ **-w**\ flags to specify the selection string that can be used to select objects. The operators \ **==**\ , \ **!=**\ , \ **=~**\ and \ **!~**\ are available. For \ **mkdef**\ command, the \ **-w**\ flag only makes sense for creating dynamic node group. Use the \ **-**\ **-help**\ option to get a list of valid attributes for each object type. Operator descriptions: - == Select nodes where the attribute value is exactly this value. - != Select nodes where the attribute value is not this specific value. - =~ Select nodes where the attribute value matches this regular expression. - !~ Select nodes where the attribute value does not match this regular expression. - Note: if the "val" fields includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is "!~", the "attrval" needs to be quoted using single quote. + + \ **==**\ Select nodes where the attribute value is exactly this value. + + + + \ **!=**\ Select nodes where the attribute value is not this specific value. + + + + \ **=~**\ Select nodes where the attribute value matches this regular expression. + + + + \ **!~**\ Select nodes where the attribute value does not match this regular expression. + + + + Note: if the "val" field includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is \ **!~**\ , the "attrval" needs to be quoted using single quote. \ **-z|-**\ **-stanza**\ - Indicates that the file being piped to the command is in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files. + Indicates that the file being piped to the command is in stanza format. See the \ **xcatstanzafile**\ man page for details on using xCAT stanza files. \ **-u**\ - Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search "/install/custom/" directory first, and then "/opt/xcat/share/". + Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search \ **/install/custom/**\ directory first, and then \ **/opt/xcat/share/**\ . The \ *provmethod*\ and \ *profile*\ must be specified. If \ *osvers*\ or \ *osarch*\ is not specified, the corresponding value of the management node will be used. - Note: this option only works for objtype \ **osimage**\ . + Note: this option only works for object type \ **osimage**\ . @@ -310,6 +323,18 @@ EXAMPLES +15. + + To create a dynamic group definition based on nodename, which will include all nodes named "fs2vm\*" + + + .. code-block:: perl + + mkdef -t group mg_vms -d -w node=~"/fs2vm.*" + + + + ***** FILES diff --git a/docs/source/guides/admin-guides/references/man1/packimage.1.rst b/docs/source/guides/admin-guides/references/man1/packimage.1.rst index 6af0c9223..4c8568b15 100644 --- a/docs/source/guides/admin-guides/references/man1/packimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/packimage.1.rst @@ -23,7 +23,7 @@ SYNOPSIS \ **packimage [-v| -**\ **-version]**\ -\ **packimage**\ [\ **-m | -**\ **-method**\ \ *cpio|tar*\ ] [\ **-c | -**\ **-compress**\ \ *gzip|pigz|xz*\ ] [\ **-**\ **-nosyncfiles**\ ] \ *imagename*\ +\ **packimage**\ [\ **-m | -**\ **-method**\ \ **cpio|tar|squashfs**\ ] [\ **-c | -**\ **-compress**\ \ **gzip|pigz|xz**\ ] [\ **-**\ **-nosyncfiles**\ ] \ *imagename*\ *********** @@ -33,7 +33,7 @@ DESCRIPTION Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot. -Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running. +Note: For an osimage that is deployed on a cluster, running \ **packimage**\ will overwrite the existing rootimage file and be unavailable to the compute nodes while \ **packimage**\ is running. ********** @@ -49,15 +49,36 @@ OPTIONS ******* -\ **-h**\ Display usage message. -\ **-v**\ Command Version. +\ **-h**\ + + Display usage message. + -\ **-m| -**\ **-method**\ Archive Method (cpio,tar,squashfs, default is cpio) -\ **-c| -**\ **-compress**\ Compress Method (pigz,gzip,xz, default is pigz/gzip) +\ **-v**\ + + Command Version. + + + +\ **-m| -**\ **-method**\ + + Archive Method (cpio, tar, squashfs (requires overlayFS or aufs modules during provisioning), default is cpio) + + + +\ **-c| -**\ **-compress**\ + + Compress Method (pigz, gzip, xz, default is pigz/gzip) + + + +\ **-**\ **-nosyncfiles**\ + + Bypass of syncfiles requested, will not sync files to root image directory + -\ **-**\ **-nosyncfiles**\ Bypass of syncfiles requested, will not sync files to root image directory ************ diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index a8920d5e5..538e4399c 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -173,6 +173,11 @@ site Attributes: the IP maps to your hostname of xCAT MN is not blocked since xCAT needs to use this IP to communicate with the local NDS server on MN. + namedincludes: A comma-separated list of file paths that will be included in + named.conf, using named 'include' statement. This can allow users + to include local configuration options that will not be overwritten + by 'makedns -n' + ------------------------- HARDWARE CONTROL ATTRIBUTES ------------------------- diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv new file mode 100644 index 000000000..004364bfb --- /dev/null +++ b/docs/source/overview/_files/2.16.x.csv @@ -0,0 +1,4 @@ +Version,Release Date,New OS Supported,Release Notes + +2.16.0,2020-06-17,,`2.16.0 Release Notes `_ + diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 5857e17ce..d7cdb0c21 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -6,6 +6,15 @@ The following tables documents the xCAT release versions and release dates. For .. tabularcolumns:: |p{1cm}|p{4cm}|p{7cm}|p{7cm} +xCAT 2.16.x +----------- + +.. csv-table:: 2.16.x Release Information + :file: _files/2.16.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 + xCAT 2.15.x ----------- diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index bbf811e93..d4a59edda 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -4996,6 +4996,11 @@ sub rsync_to_image next; } + if ($line =~ /.+ -> \(.+\) .+/) # skip syncfile entries containing noderange + { + next; + } + $line=xCAT::Utils->varsubinline($line,\%osimgenv); # process no more lines, do not exec diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index dcbbc08f8..d4b2d2470 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1089,6 +1089,10 @@ passed as argument rather than by table value', " NOTE: If using this attribute to block certain interfaces, make sure\n" . " the IP maps to your hostname of xCAT MN is not blocked since xCAT needs\n" . " to use this IP to communicate with the local NDS server on MN.\n\n" . +" namedincludes: A comma-separated list of file paths that will be included in\n" . +" named.conf, using named 'include' statement. This can allow users\n" . +" to include local configuration options that will not be overwritten\n" . +" by 'makedns -n'\n\n" . " -------------------------\n" . "HARDWARE CONTROL ATTRIBUTES\n" . " -------------------------\n" . diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm index 7cf372ac9..429285cbd 100644 --- a/perl-xCAT/xCAT/data/switchinfo.pm +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -46,7 +46,9 @@ our %global_switch_type = ( Edgecore => "onie", sLEN => "irpdu", sIBM => "irpdu", - coral => "crpdu" + coral => "crpdu", + Dell => "Dell", + dell => "Dell" ); diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index a04f39dac..44727fed0 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -36,11 +36,17 @@ for parameter in $@; do if [ $param_n -eq 2 ]; then if [ "$parameter" != "-f" ] && [ "$parameter" != "-s" ]; then CONSERVER=$parameter + # verify the specified CONSERVER can be resolved + host $CONSERVER > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Error: cannot recognize parameter or conserver host \"$parameter\". Run \"rcons -h\" for usage." + exit 1 + fi fi fi if [ $param_n -ge 2 ]; then - if [ "$parameter" = "-f" ] || [ "$parameter" = "-s" ]; then + if [ "$parameter" == "-f" ] || [ "$parameter" == "-s" ]; then if [ -z "$FORCE" ]; then FORCE=$parameter elif [ "$FORCE" != "$parameter" ]; then @@ -52,7 +58,7 @@ for parameter in $@; do if [ $param_n -ge 3 ]; then if [ "$parameter" != "-f" ] && [ "$parameter" != "-s" ]; then - echo "Error: cannot recognize parameter \"$parameter\"." + echo "Error: cannot recognize parameter \"$parameter\". Run \"rcons -h\" for usage." exit 1 fi fi diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 6523a77ab..b28e98a8f 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -8,7 +8,7 @@ B [B<-?>|B<-h>|B<--help>] B [B<-v>|B<--version>] -B B<--range> I [B<--sn> I] [B<-s> I] [B<-u> I] [B<-p> I] [B<-z>] [B<-w>] +B B<--range> I [B<--sn> I] [B<-s> I] [B<-u> I] [B<-p> I] [B<-n> I] [B<-z>] [B<-w>] =head1 DESCRIPTION @@ -20,7 +20,7 @@ The command uses B to scan active nodes over a specified IP range. The IP B The scan method currently supported is B. -B Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. B will not be able to discover such systems. Run I script to change the default password for BMCs in specified range, then rerun B with B<-p "new bmc password"> flag to discover systems with the changed password. +B Starting on January 1, 2020, some newly shipped systems will require the default BMC password to be changed before they can be managed by xCAT. Use B with B<-n> option to specify new BMC password. =head1 OPTIONS @@ -54,6 +54,10 @@ BMC user name. BMC user password. +=item B<-n|--newbmcpw> + +New BMC user password. + =item B<-h|--help> Display usage message @@ -102,6 +106,10 @@ Output is similar to: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z +5. Discover the BMC with the specified IP address, change its default BMC password and display in xCAT stanza format: + + bmcdiscover --range "10.4.22-23.100" -u root -p 0penBmc -n 0penBmc123 -z + =head1 SEE ALSO L diff --git a/xCAT-client/pods/man1/mkdef.1.pod b/xCAT-client/pods/man1/mkdef.1.pod index e712674f1..8fa91996f 100644 --- a/xCAT-client/pods/man1/mkdef.1.pod +++ b/xCAT-client/pods/man1/mkdef.1.pod @@ -11,7 +11,7 @@ B [B<-V>|B<--verbose>] [B<-t> I] [B<--template> I command is used to create xCAT object definitions which are stored in the xCAT database. If the definition already exists it will return an error message. The B<--force> option may be used to re-create a definition. In this case the old definition will be remove and the new definition will be created. =head1 OPTIONS @@ -20,13 +20,13 @@ This command is used to create xCAT object definitions which are stored in the x =item I -Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. Use the help option to get a list of valid attributes for each object type. +Specifies one or more "attribute equals value" pairs, separated by spaces. I pairs must be specified last on the command line. Use the B<--help> option to get a list of valid attributes for each object type. -Note: when creating node object definitions, the 'groups' attribute is required. +Note: when creating node object definitions, the B attribute is required. =item B<-d|--dynamic> -Use the dynamic option to create dynamic node groups. This option must be used with -w option. +Use the dynamic option to create dynamic node groups. This option must be used with B<-w> option. =item B<-f|--force> @@ -38,7 +38,7 @@ Display usage message. =item I -A set of comma delimited node names and/or group names. (must be the first parameter) See the "noderange" man page for details on supported formats. +A set of comma delimited node names and/or group names. (must be the first parameter) See the man page for details on supported formats. =item B<-o> I @@ -46,7 +46,7 @@ A set of comma delimited object names. =item B<-t> I -A set of comma delimited object types. Use the help option to get a list of valid object types. +A set of comma delimited object types. Use the B<--help> option to get a list of valid object types. =item B<--template> I @@ -58,26 +58,34 @@ Verbose mode. =item B<-w> I B<-w> I ... -Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. +Use one or multiple B<-w> flags to specify the selection string that can be used to select objects. The operators B<==>, B, B<=~> and B are available. For B command, the B<-w> flag only makes sense for creating dynamic node group. Use the B<--help> option to get a list of valid attributes for each object type. Operator descriptions: - == Select nodes where the attribute value is exactly this value. - != Select nodes where the attribute value is not this specific value. - =~ Select nodes where the attribute value matches this regular expression. - !~ Select nodes where the attribute value does not match this regular expression. -Note: if the "val" fields includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is "!~", the "attrval" needs to be quoted using single quote. +=over 3 + +=item B<==> Select nodes where the attribute value is exactly this value. + +=item B Select nodes where the attribute value is not this specific value. + +=item B<=~> Select nodes where the attribute value matches this regular expression. + +=item B Select nodes where the attribute value does not match this regular expression. + +=back + +Note: if the "val" field includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is B, the "attrval" needs to be quoted using single quote. =item B<-z|--stanza> -Indicates that the file being piped to the command is in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files. +Indicates that the file being piped to the command is in stanza format. See the B man page for details on using xCAT stanza files. =item B<-u> -Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search "/install/custom/" directory first, and then "/opt/xcat/share/". +Fill in the attributes such as template file, pkglist file and otherpkglist file of osimage object based on the specified parameters. It will search B directory first, and then B. The I and I must be specified. If I or I is not specified, the corresponding value of the management node will be used. -Note: this option only works for objtype B. +Note: this option only works for object type B. =back @@ -179,6 +187,12 @@ To create a node definition from an existing node definition "cn1" mkdef -t node cn2 --template cn1 ip=1.1.1.2 mac=42:3d:0a:05:27:0c +=item 15. + +To create a dynamic group definition based on nodename, which will include all nodes named "fs2vm*" + + mkdef -t group mg_vms -d -w node=~"/fs2vm.*" + =back diff --git a/xCAT-client/pods/man1/packimage.1.pod b/xCAT-client/pods/man1/packimage.1.pod index dbca7c266..32e91d9f7 100644 --- a/xCAT-client/pods/man1/packimage.1.pod +++ b/xCAT-client/pods/man1/packimage.1.pod @@ -8,13 +8,13 @@ B B -B [B<-m>|B<--method> I] [B<-c>|B<--compress> I] [B<--nosyncfiles>] I +B [B<-m>|B<--method> B] [B<-c>|B<--compress> B] [B<--nosyncfiles>] I =head1 DESCRIPTION Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot. -Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running. +Note: For an osimage that is deployed on a cluster, running B will overwrite the existing rootimage file and be unavailable to the compute nodes while B is running. =head1 PARAMETERS @@ -22,17 +22,29 @@ I specifies the name of a OS image definition to be used. The specifi =head1 OPTIONS +=over 10 -B<-h> Display usage message. +=item B<-h> -B<-v> Command Version. +Display usage message. -B<-m| --method> Archive Method (cpio,tar,squashfs, default is cpio) +=item B<-v> -B<-c| --compress> Compress Method (pigz,gzip,xz, default is pigz/gzip) +Command Version. -B<--nosyncfiles> Bypass of syncfiles requested, will not sync files to root image directory +=item B<-m| --method> +Archive Method (cpio, tar, squashfs (requires overlayFS or aufs modules during provisioning), default is cpio) + +=item B<-c| --compress> + +Compress Method (pigz, gzip, xz, default is pigz/gzip) + +=item B<--nosyncfiles> + +Bypass of syncfiles requested, will not sync files to root image directory + +=back =head1 RETURN VALUE diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index 150cbeea8..75ed347ae 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -512,6 +512,15 @@ for user in $BMCUS; do done ipmitool raw 6 0x43 $(($LANCHAN|176)) $USERSLOT 4 + TRIES=0 + if [ "$CURRENTUSER" != "$user" ]; then + # Change the user name, if necessary + while ! ipmitool -d $idev user set name $USERSLOT "$user"; do + sleep 1 + let TRIES=TRIES+1 + if [ $TRIES -gt $TIMEOUT ]; then break; fi + done + fi TRIES=0 # Last param in ipmitool user priv is the channel to set it on. @@ -543,15 +552,6 @@ for user in $BMCUS; do if [ $TRIES -gt $TIMEOUT ]; then break; fi done - TRIES=0 - if [ "$CURRENTUSER" != "$user" ]; then - # Change the user name, if necessary - while ! ipmitool -d $idev user set name $USERSLOT "$user"; do - sleep 1 - let TRIES=TRIES+1 - if [ $TRIES -gt $TIMEOUT ]; then break; fi - done - fi let idev=idev-1 done diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index e69b42ad1..090e287c8 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -49,14 +49,14 @@ my $bmc_pass; my $openbmc_user; my $openbmc_pass; my $done_num = 0; -$::P9_WITHERSPOON_MFG_ID = "42817"; -$::P9_WITHERSPOON_PRODUCT_ID = "16975"; -$::P9_MIHAWK_MFG_ID = "42817"; -$::P9_MIHAWK_PRODUCT_ID = "1"; +$::P9_AC922_MFG_ID = "42817"; #Witherspoon +$::P9_AC922_PRODUCT_ID = "16975"; +$::P9_IC922_MFG_ID = "42817"; #Mihawk +$::P9_IC922_PRODUCT_ID = "1"; $::CHANGE_PW_REQUIRED="The password provided for this account must be changed before access is granted"; $::NO_SESSION="Unable to establish IPMI v2 / RMCP"; -$::CHANGE_PW_INSTRUCTIONS_1="Run script '/opt/xcat/share/xcat/scripts/BMC_change_password.sh' to change default password"; -$::CHANGE_PW_INSTRUCTIONS_2="Rerun 'bmcdiscover' command with '-p new_bmc_password' flag"; +$::CHANGE_PW_INSTRUCTIONS_1="Rerun 'bmcdiscover' command with '-p default_bmc_password -n new_bmc_password' flag"; +$::PW_PAM_VALIDATION="password value failed PAM validation checks"; $::NO_MFG_OR_PRODUCT_ID="Zeros returned for Manufacturer id and Product id"; %::VPDHASH = (); my %node_in_list = (); @@ -203,7 +203,7 @@ sub bmcdiscovery_usage { push @{ $rsp->{data} }, "Usage:"; push @{ $rsp->{data} }, "\tbmcdiscover [-?|-h|--help]"; push @{ $rsp->{data} }, "\tbmcdiscover [-v|--version]"; - push @{ $rsp->{data} }, "\tbmcdiscover --range ip_range [--sn ] [-s ] [-u ] [-p ] [-z] [-w]\n"; + push @{ $rsp->{data} }, "\tbmcdiscover --range ip_range [--sn ] [-s ] [-u ] [-p ] [-n ] [-z] [-w]\n"; xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); return 0; @@ -248,6 +248,7 @@ sub bmcdiscovery_processargs { 'check' => \$::opt_C, 'bmcuser|u=s' => \$::opt_U, 'bmcpasswd|p=s' => \$::opt_P, + 'newbmcpw|n=s' => \$::opt_N, 'ipsource' => \$::opt_S, 'version|v' => \$::opt_v, 't' => \$::opt_T, @@ -749,6 +750,7 @@ sub scan_process { # Set child process default, if not the function runcmd may return error $SIG{CHLD} = 'DEFAULT'; +TRY_TO_DISCOVER: my $bmcusername; my $bmcpassword; $bmcusername = "-U $bmc_user" if ($bmc_user); @@ -767,8 +769,8 @@ sub scan_process { } if ($mc_info =~ /Manufacturer ID\s*:\s*(\d+)\s*Manufacturer Name.+\s*Product ID\s*:\s*(\d+)/) { xCAT::MsgUtils->trace(0, "D", "$log_label Found ${$live_ip}[$i] Manufacturer ID: $1 Product ID: $2"); - if (($1 eq $::P9_WITHERSPOON_MFG_ID and $2 eq $::P9_WITHERSPOON_PRODUCT_ID) or - ($1 eq $::P9_MIHAWK_MFG_ID and $2 eq $::P9_MIHAWK_PRODUCT_ID)) { + if (($1 eq $::P9_AC922_MFG_ID and $2 eq $::P9_AC922_PRODUCT_ID) or + ($1 eq $::P9_IC922_MFG_ID and $2 eq $::P9_IC922_PRODUCT_ID)) { bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command,$parent_fd,$2); $is_openbmc = 1; $is_ipmi = 0; @@ -781,8 +783,8 @@ sub scan_process { } else { # System replied to mc info but not with either - # $::P9_WITHERSPOON_MFG_ID and $::P9_WITHERSPOON_PRODUCT_ID, or - # $::P9_MIHAWK_MFG_ID and $::P9_MIHAWK_PRODUCT_ID, + # $::P9_AC922_MFG_ID and $::P9_AC922_PRODUCT_ID, or + # $::P9_IC922_MFG_ID and $::P9_IC922_PRODUCT_ID, # assume IPMI $is_openbmc = 0; $is_ipmi = 1; @@ -804,10 +806,32 @@ sub scan_process { my $redfish_session_cmd = "curl -sD - --data '{\"UserName\":\"$openbmc_user\",\"Password\":\"$openbmc_pass\"}' -k -X POST https://${$live_ip}[$i]/redfish/v1/SessionService/Sessions"; my $redfish_session_info = xCAT::Utils->runcmd($redfish_session_cmd, -1); if ($redfish_session_info =~ /$::CHANGE_PW_REQUIRED/) { - # RedFish session replied that password change is needed. Print instructions and exit + # RedFish session replied that password change is needed. xCAT::MsgUtils->message("I", { data => ["${$live_ip}[$i]: $::CHANGE_PW_REQUIRED"] }, $::CALLBACK); - xCAT::MsgUtils->message("I", { data => ["$::CHANGE_PW_INSTRUCTIONS_1"] }, $::CALLBACK); - xCAT::MsgUtils->message("I", { data => ["$::CHANGE_PW_INSTRUCTIONS_2"] }, $::CALLBACK); + if ($::opt_N) { + # New password was passed in, use it to change the default (AC922 or IC922) + my $password_change_cmd = "curl -s -u $openbmc_user:$openbmc_pass --data '{\"Password\":\"$::opt_N\"}' -k -X PATCH https://${$live_ip}[$i]/redfish/v1/AccountService/Accounts/$openbmc_user"; + my $password_changed = xCAT::Utils->runcmd($password_change_cmd, -1); + if (! $password_changed) { + # No output from change password command, assume success + xCAT::MsgUtils->message("I", { data => ["${$live_ip}[$i]: Password changed."] }, $::CALLBACK); + $openbmc_pass = $::opt_N; # Set new password + $bmc_pass = $::opt_N; # Set new password + goto TRY_TO_DISCOVER; # Attempt discover with changed password + } + elsif ($password_changed =~ /$::PW_PAM_VALIDATION/) { + # Output from change password command indicates pw validation error + xCAT::MsgUtils->message("I", { data => ["Can not change password - $::PW_PAM_VALIDATION"] }, $::CALLBACK); + } + else { + # Some unexpected output changing the password - report error and show output + xCAT::MsgUtils->message("I", { data => ["Unable to change password - $password_changed"] }, $::CALLBACK); + } + } + else { + # New password was not passed in, print instruction message and exit + xCAT::MsgUtils->message("I", { data => ["$::CHANGE_PW_INSTRUCTIONS_1"] }, $::CALLBACK); + } } } } @@ -1357,7 +1381,11 @@ sub bmcdiscovery_openbmc{ $node_data .= ",$serial"; if ($::opt_P) { if ($::opt_U) { - $node_data .= ",$::opt_U,$::opt_P"; + if ($::opt_N) { + $node_data .= ",$::opt_U,$::opt_N"; # Display the new changed password + } else { + $node_data .= ",$::opt_U,$::opt_P"; + } } else { $node_data .= ",,$::opt_P"; } diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 1eb234ab6..d84b5d155 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -790,6 +790,11 @@ sub donics next; } + # for example: nicaliases.ib0=|maestro-(\d+)$|m($1)-ib0| + if ($aliases =~ /^\|\S*\|$/) { + $aliases = xCAT::Table::transRegexAttrs($node, $aliases); + } + if ($aliases =~ /\|/) { my @names = split(/\|/, $aliases); my $index = 0; diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 8cd96ac09..b53e81aba 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -578,19 +578,27 @@ sub process_request { chmod 0644, "$destdir/rootimg.$suffix"; umask $oldmask; } elsif ($method =~ /squashfs/) { - my $flags; - - if ($osver =~ /rhels/ && $osver !~ /rhels5/) { - $flags = ""; + my $flags = ""; + if ($osver =~ /rhels5/) { + if ($arch =~ /x86/) { + $flags = "-le"; + } elsif ($arch =~ /ppc/) { + $flags = "-be"; + } } if (!-x "/sbin/mksquashfs" && !-x "/usr/bin/mksquashfs") { - $callback->({ error => ["mksquashfs not found, squashfs-tools rpm should be installed on the management node"], errorcode => [1] }); + if ($osver =~ /sle/) { + $callback->({ error => ["mksquashfs not found, squashfs rpm should be installed on the management node"], errorcode => [1] }); + } else { + $callback->({ error => ["mksquashfs not found, squashfs-tools rpm should be installed on the management node"], errorcode => [1] }); + } return 1; } - my $rc = system("mksquashfs $temppath ../rootimg.sfs $flags"); + my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; + my $rc = system("$mksquashfs_command"); if ($rc) { - $callback->({ error => ["mksquashfs could not be run successfully"], errorcode => [1] }); + $callback->({ error => ["Command \"$mksquashfs_command\" failed"], errorcode => [1] }); return 1; } $rc = system("rm -rf $temppath"); diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 04aee5670..342c55ff0 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -981,14 +981,9 @@ sub get_snmpvendorinfo { push @comm_list, 'public'; foreach $comms(@comm_list) { - #for pdu: get vendor info from sysDescr - #for switches: get vendor info from entPhysicalDescr + # get vendor info from sysDescr my $ccmd; - if (exists($globalopt{pdu})) { - $ccmd = "snmpwalk -Os -v1 -c $comms $ip 1.3.6.1.2.1.1.1"; - } else { - $ccmd = "snmpwalk -Os -v1 -c $comms $ip 1.3.6.1.2.1.47.1.1.1.1.2.1"; - } + $ccmd = "snmpwalk -Os -v1 -c $comms $ip 1.3.6.1.2.1.1.1"; if (exists($globalopt{verbose})) { send_msg($request, 0, "Process command: $ccmd\n"); } diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 5513d33ab..7a765cf7f 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -119,7 +119,7 @@ use IO::Handle; use IO::Select; use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use XML::LibXML::Simple; +use XML::LibXML; use xCAT::Table; my $dbmaster; use xCAT::ExtTab; diff --git a/xCAT-server/share/xcat/install/SL/compute.tmpl b/xCAT-server/share/xcat/install/SL/compute.tmpl index e21976494..669c02793 100644 --- a/xCAT-server/share/xcat/install/SL/compute.tmpl +++ b/xCAT-server/share/xcat/install/SL/compute.tmpl @@ -36,7 +36,7 @@ key --skip #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/all.tmpl b/xCAT-server/share/xcat/install/centos/all.tmpl index 68453ddfa..6e1957872 100644 --- a/xCAT-server/share/xcat/install/centos/all.tmpl +++ b/xCAT-server/share/xcat/install/centos/all.tmpl @@ -34,9 +34,9 @@ clearpart --all --initlabel #XCAT_PARTITION_START# #No RAID -part /boot --size 50 --ondisk sda --fstype ext3 +part /boot --size 50 --ondisk sda --fstype ext4 part swap --size 1024 --ondisk sda -part / --size 6000 --grow --ondisk sda --fstype ext3 +part / --size 6000 --grow --ondisk sda --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/iscsi.tmpl b/xCAT-server/share/xcat/install/centos/iscsi.tmpl index 0fdae7dcb..5d0e3f3a1 100644 --- a/xCAT-server/share/xcat/install/centos/iscsi.tmpl +++ b/xCAT-server/share/xcat/install/centos/iscsi.tmpl @@ -39,7 +39,7 @@ iscsi --ipaddr #TABLE:iscsi:$NODE:server# --user "#TABLEBLANKOKAY:iscsi:$NODE:us #No RAID #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/storage.tmpl b/xCAT-server/share/xcat/install/centos/storage.tmpl index eb16fa341..79624cf56 100644 --- a/xCAT-server/share/xcat/install/centos/storage.tmpl +++ b/xCAT-server/share/xcat/install/centos/storage.tmpl @@ -36,9 +36,9 @@ clearpart --all --initlabel #XCAT_PARTITION_START# #No RAID -part /boot --size 100 --ondisk sda --fstype ext3 +part /boot --size 100 --ondisk sda --fstype ext4 part swap --size 2048 --ondisk sda -part / --size 6000 --grow --ondisk sda --fstype ext3 +part / --size 6000 --grow --ondisk sda --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/centos/xen.tmpl b/xCAT-server/share/xcat/install/centos/xen.tmpl index f2042c88f..b75924668 100644 --- a/xCAT-server/share/xcat/install/centos/xen.tmpl +++ b/xCAT-server/share/xcat/install/centos/xen.tmpl @@ -36,7 +36,7 @@ clearpart --all --initlabel #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/debian/compute.tmpl b/xCAT-server/share/xcat/install/debian/compute.tmpl index 38c26403d..266436a4e 100644 --- a/xCAT-server/share/xcat/install/debian/compute.tmpl +++ b/xCAT-server/share/xcat/install/debian/compute.tmpl @@ -44,15 +44,15 @@ d-i partman-md/device_remove_md boolean true d-i partman-auto/expert_recipe string \ boot-root :: \ - 40 50 100 ext3 \ + 40 50 100 ext4 \ $primary{ } $bootable{ } \ method{ format } format{ } \ - use_filesystem{ } filesystem{ ext3 } \ + use_filesystem{ } filesystem{ ext4 } \ mountpoint{ /boot } \ . \ - 500 10000 1000000000 ext3 \ + 500 10000 1000000000 ext4 \ method{ format } format{ } \ - use_filesystem{ } filesystem{ ext3 } \ + use_filesystem{ } filesystem{ ext4 } \ mountpoint{ / } \ . \ 64 512 300% linux-swap \ diff --git a/xCAT-server/share/xcat/install/esx/esx.tmpl b/xCAT-server/share/xcat/install/esx/esx.tmpl index 3003bd7fd..2acb242ae 100644 --- a/xCAT-server/share/xcat/install/esx/esx.tmpl +++ b/xCAT-server/share/xcat/install/esx/esx.tmpl @@ -15,8 +15,8 @@ reboot url --url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch# zerombr yes clearpart --all --initlabel --drives=sda -part /boot --fstype ext3 --size=100 --ondisk=sda -part / --fstype ext3 --size=2048 --ondisk=sda +part /boot --fstype ext4 --size=100 --ondisk=sda +part / --fstype ext4 --size=2048 --ondisk=sda part swap --size=2048 --ondisk=sda part None --fstype vmfs3 --size=900 --ondisk=sda --grow part None --fstype vmkcore --size=100 --ondisk=sda diff --git a/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl b/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl index b652d29c9..4287dd921 100644 --- a/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl +++ b/xCAT-server/share/xcat/install/fedora/compute.ppc64.tmpl @@ -36,9 +36,9 @@ clearpart --all --initlabel #No RAID #/boot really significant for this sort of setup nowadays? part None --fstype "PPC PReP Boot" --size 8 -part /boot --size 50 --fstype ext3 +part /boot --size 50 --fstype ext4 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/fedora/compute.tmpl b/xCAT-server/share/xcat/install/fedora/compute.tmpl index 9d777c923..1dae337d2 100644 --- a/xCAT-server/share/xcat/install/fedora/compute.tmpl +++ b/xCAT-server/share/xcat/install/fedora/compute.tmpl @@ -37,7 +37,7 @@ clearpart --all --initlabel #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/fedora/iscsi.tmpl b/xCAT-server/share/xcat/install/fedora/iscsi.tmpl index 2a6604cc8..2fbfe89b5 100644 --- a/xCAT-server/share/xcat/install/fedora/iscsi.tmpl +++ b/xCAT-server/share/xcat/install/fedora/iscsi.tmpl @@ -39,7 +39,7 @@ iscsi --ipaddr #TABLE:iscsi:$NODE:server# --user "#TABLEBLANKOKAY:iscsi:$NODE:us #No RAID #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/fedora/service.tmpl b/xCAT-server/share/xcat/install/fedora/service.tmpl index 9d777c923..1dae337d2 100644 --- a/xCAT-server/share/xcat/install/fedora/service.tmpl +++ b/xCAT-server/share/xcat/install/fedora/service.tmpl @@ -37,7 +37,7 @@ clearpart --all --initlabel #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl b/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl index ea3996a68..a6d020d60 100644 --- a/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.ppc64.tmpl @@ -40,7 +40,7 @@ key --skip part None --fstype "PPC PReP Boot" --size 8 #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/compute.tmpl b/xCAT-server/share/xcat/install/rh/compute.tmpl index 5ec90dd22..6a027a9d2 100644 --- a/xCAT-server/share/xcat/install/rh/compute.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.tmpl @@ -39,7 +39,7 @@ key --skip #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/iscsi.tmpl b/xCAT-server/share/xcat/install/rh/iscsi.tmpl index 0fdae7dcb..5d0e3f3a1 100644 --- a/xCAT-server/share/xcat/install/rh/iscsi.tmpl +++ b/xCAT-server/share/xcat/install/rh/iscsi.tmpl @@ -39,7 +39,7 @@ iscsi --ipaddr #TABLE:iscsi:$NODE:server# --user "#TABLEBLANKOKAY:iscsi:$NODE:us #No RAID #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/kvm.tmpl b/xCAT-server/share/xcat/install/rh/kvm.tmpl index f18d88c54..a62a1b7af 100644 --- a/xCAT-server/share/xcat/install/rh/kvm.tmpl +++ b/xCAT-server/share/xcat/install/rh/kvm.tmpl @@ -42,9 +42,9 @@ key --skip #XCAT_PARTITION_START# #No RAID #/boot really significant for this sort of setup nowadays? -#part /boot --size 50 --fstype ext3 +#part /boot --size 50 --fstype ext4 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl b/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl index 19f5bc545..c49f938bc 100644 --- a/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl +++ b/xCAT-server/share/xcat/install/rh/service.ppc64.tmpl @@ -39,7 +39,7 @@ part None --fstype "PPC PReP Boot" --size 8 #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/service.tmpl b/xCAT-server/share/xcat/install/rh/service.tmpl index 87757ab8e..e066f9f67 100644 --- a/xCAT-server/share/xcat/install/rh/service.tmpl +++ b/xCAT-server/share/xcat/install/rh/service.tmpl @@ -37,7 +37,7 @@ key --skip #/boot really significant for this sort of setup nowadays? #part /boot --size 50 --fstype ext3 part swap --size 1024 -part / --size 1 --grow --fstype ext3 +part / --size 1 --grow --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/rh/storage.tmpl b/xCAT-server/share/xcat/install/rh/storage.tmpl index eb16fa341..79624cf56 100644 --- a/xCAT-server/share/xcat/install/rh/storage.tmpl +++ b/xCAT-server/share/xcat/install/rh/storage.tmpl @@ -36,9 +36,9 @@ clearpart --all --initlabel #XCAT_PARTITION_START# #No RAID -part /boot --size 100 --ondisk sda --fstype ext3 +part /boot --size 100 --ondisk sda --fstype ext4 part swap --size 2048 --ondisk sda -part / --size 6000 --grow --ondisk sda --fstype ext3 +part / --size 6000 --grow --ondisk sda --fstype ext4 #XCAT_PARTITION_END# #RAID 0 /scr for performance diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat.ng b/xCAT-server/share/xcat/install/scripts/post.xcat.ng index 53a2fe878..255298db8 100644 --- a/xCAT-server/share/xcat/install/scripts/post.xcat.ng +++ b/xCAT-server/share/xcat/install/scripts/post.xcat.ng @@ -145,7 +145,10 @@ then /tmp/updateflag "$MASTER" "$XCATIPORT" "installstatus failed" sleep infinity fi -find /xcatpost -type f -maxdepth 1 -exec chmod 0755 {} + + +# Add execute permision to all files recursively under /xcatpost. +chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` + msgutil_r "$MASTER_IP" "info" "postscripts downloaded successfully" "/var/log/xcat/xcat.log" "$log_label" # Get the precreated mypostscript file diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index 99eeaacee..064aa89a8 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -260,7 +260,7 @@ elif grep ext4 /proc/filesystems > /dev/null; then else FSTYPE=ext3 fi -BOOTFSTYPE=ext3 +BOOTFSTYPE=ext4 EFIFSTYPE=vfat msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label" if [ `uname -m` = "ppc64" ]; then diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 index 3f9aca9b6..aaf7b4fad 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 @@ -226,7 +226,7 @@ elif grep ext4 /proc/filesystems > /dev/null; then else FSTYPE=ext3 fi -BOOTFSTYPE=ext3 +BOOTFSTYPE=ext4 EFIFSTYPE=vfat if uname -r|grep -q '^3.*el7'; then diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index eb8a4506a..26d8f6ae4 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -273,11 +273,11 @@ DISKSIZE="$(getdisksize "${instdisk}")" # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=1024" >>/tmp/partitionfile -echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile +echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=1024" >>/tmp/partitionfile echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile -echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size 1" >>/tmp/partitionfile +echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --size=1024 --grow " >>/tmp/partitionfile # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader" diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu b/xCAT-server/share/xcat/install/scripts/pre.ubuntu index f528eec91..30db880a5 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu @@ -190,17 +190,17 @@ base64decode() logger -t $log_label -p "info" "Generate partition file..." if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitionfile - echo " 512 512 1024 fat16" >> /tmp/partitionfile + echo " 512 512 1024 fat32" >> /tmp/partitionfile echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile else echo "ubuntu-boot ::" > /tmp/partitionfile - echo "256 256 512 ext3" >> /tmp/partitionfile - echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ /boot }' >> /tmp/partitionfile + echo "256 256 512 ext4" >> /tmp/partitionfile + echo ' $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile fi -echo "500 10000 1000000000 ext3" >> /tmp/partitionfile -echo " method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / }" >> /tmp/partitionfile +echo "500 10000 1000000000 ext4" >> /tmp/partitionfile +echo " method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / }" >> /tmp/partitionfile echo " ." >> /tmp/partitionfile echo "2048 512 300% linux-swap" >> /tmp/partitionfile echo " method{ swap } format{ }" >> /tmp/partitionfile diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 index 84141c10b..5892a0fbd 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu.ppc64 @@ -203,7 +203,7 @@ base64decode() logger -t $log_label -p "info" "Generate partition file..." if [ -d /sys/firmware/efi ]; then echo "ubuntu-efi ::" > /tmp/partitionfile - echo " 512 512 1024 fat16" >> /tmp/partitionfile + echo " 512 512 1024 fat32" >> /tmp/partitionfile echo ' $iflabel{ gpt } $reusemethod{ } method{ efi } format{ }' >> /tmp/partitionfile echo " ." >> /tmp/partitionfile else diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk index 7676e73ce..73a1f7e83 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk @@ -212,18 +212,18 @@ doconfigure () { # create the filesystem if [ x$fstype = x ]; then - fstype=ext3 + fstype=ext4 fi partnum=`expr $partnum + 1` partdev=$dev$partnum echo "Create filesystem $fstype on $partdev" >>$LOG - echo "mke2fs -q $partdev -t $fstype" >>$LOG - `mke2fs -q $partdev -t $fstype > /dev/null` + echo "mkfs.$fstype -f -q $partdev" >>$LOG + `mkfs.$fstype -f -q $partdev > /dev/null` sleep 1 done elif [ $localspace -eq 1 ]; then if [ x$fstype = x ]; then - fstype=ext3 + fstype=ext4 fi echo "Mount $dev to $LOCAL with $fstype" >>$LOG echo "mount -t $fstype $dev $MNTDIR$LOCAL" >>$LOG diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot index 470d27ab7..7811cf0fb 100755 --- a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot @@ -52,11 +52,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.gz ]; then echo Setting up RAM-root tmpfs. if [ -z $rootlimit ];then diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index 3777e6445..a3ac65d01 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -12,3 +12,21 @@ python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils +gzip +grub2 +grub2-tools +lsvpd diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 3777e6445..cbeb2b5ab 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -12,3 +12,18 @@ python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils + diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot index dd6fb9a6b..9b5da98ff 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot @@ -4,7 +4,7 @@ dracut_install wget tar cpio gzip dash modprobe touch echo cut wc xz dracut_install -o ctorrent dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite index b8bf69a46..df2bf5bc4 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut/install.statelite @@ -3,7 +3,7 @@ echo $drivers dracut_install wget tar cpio gzip dash modprobe wc touch echo cut dracut_install -o ctorrent dracut_install grep ifconfig hostname awk egrep grep dirname expr -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index d70a64323..423ab6d36 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -62,11 +62,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg downloaded,setting up RAM-root tmpfs...." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot index 2a62a66c6..b6be1168b 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot @@ -3,7 +3,7 @@ echo $drivers dracut_install wget tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite index 07e24fee4..8ded72c3c 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.statelite @@ -2,7 +2,7 @@ echo $drivers dracut_install wget cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig hostname awk egrep grep dirname expr -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index 1531756fd..b52b49035 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -69,11 +69,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot index 5ac651c5f..422138e65 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.netboot @@ -3,7 +3,7 @@ echo $drivers dracut_install curl tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite index 36929bf89..8d7413778 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/install.statelite @@ -2,7 +2,7 @@ echo $drivers dracut_install curl cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig hostname awk egrep grep dirname expr -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db dracut_install ethtool inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot index 9f2b4182b..b851865b5 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_047/xcatroot @@ -69,11 +69,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index 4544f99e2..cf9df1421 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -8,9 +8,28 @@ rsync tar util-linux wget -perl-DBD-MySQL -perl-DBD-Pg python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils +gzip +grub2 +grub2-tools +lsvpd +perl-DBD-MySQL +perl-DBD-Pg + diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index 4544f99e2..4bb432301 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -14,3 +14,18 @@ python3 tar bzip2 bc +dracut +dracut-network +rsyslog +hostname +e2fsprogs +ethtool +parted +openssl +dhclient +openssh-clients +bash +vim-minimal +rpm +iputils + diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot index d98aa6c54..7fad93458 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot @@ -3,7 +3,7 @@ echo $drivers dracut_install wget tar cpio gzip modprobe touch echo cut wc xz dracut_install grep ifconfig ip hostname awk egrep grep dirname expr dracut_install mount.nfs -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst "$moddir/xcatroot" "/sbin/xcatroot" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite index ccbdc49cf..f63f58b18 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.statelite @@ -2,7 +2,7 @@ echo $drivers dracut_install wget cpio gzip modprobe wc touch echo cut dracut_install grep ifconfig ip hostname awk egrep grep dirname expr logger -dracut_install parted mke2fs bc mkswap swapon chmod +dracut_install parted mke2fs bc mkswap swapon chmod mkfs mkfs.ext4 mkfs.xfs xfs_db inst "$moddir/xcat-updateflag" "/tmp/updateflag" inst_hook pre-mount 5 "$moddir/xcat-premount.sh" inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh" diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh index f52312e38..c004d623c 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcat-prepivot.sh @@ -160,7 +160,7 @@ STARTMODE='auto' EOF if [ -f $NEWROOT/etc/hostname ]; then - echo `hostname -s` > $NEWROOT/etc/hostname + echo "$ME" > $NEWROOT/etc/hostname fi if [ ! -z "$ifname" ]; then diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index 4b6c9aeaf..c05a3e793 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -65,11 +65,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..." echo Setting up RAM-root tmpfs. diff --git a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot index 0dec68081..46575db55 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot @@ -34,11 +34,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo "Mounting $NEWROOT with type overlay" + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot $NEWROOT + else + echo "Mounting $NEWROOT with type aufs" + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw + fi elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then echo Setting up RAM-root tmpfs. mount -t tmpfs -o mode=755 rootfs $NEWROOT diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index c2108a204..32163e784 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -199,9 +199,9 @@ if ($netdriver) { } } else { if ($arch eq 'x86' or $arch eq 'x86_64') { - @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx4_en virtio_net/; + @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx_en virtio_net overlay/; } elsif ($arch eq 'ppc64el') { - @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net/; + @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net overlay/; } elsif ($arch eq 'ppc64') { @ndrivers = qw/e1000 e1000e igb ibmveth ehea/; } elsif ($arch eq 's390x') { @@ -336,6 +336,11 @@ unless ($onlyinitrd) { print "Run cmd [$aptcmd1 $aptcmd2] to create rootimage bootstraps\n"; my $rc = system("$aptcmd1 $aptcmd2"); if ($rc) { + my $os=xCAT::Utils->osver("os"); + if ($os ne 'ubuntu') { + print "Error: Can not run genimage for Ubunty OS on a non-Ubunty system ($os)"; + exit 1; + } print "Error: Can not create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; exit 1; } @@ -889,6 +894,11 @@ sub getlibs { my @libs = split /\n/, $liblist; my @return; foreach (@libs) { + # vdso is a shared library that's embedded in the kernel + # automatically loaded whenever a new process is exec-ed + if ( $_ =~ /linux-vdso64/ ) { + next; + } if (/statically linked/ or /not a dynamic executable/) { return; } @@ -1152,7 +1162,6 @@ PATH="\$PATH:/usr/sbin:/sbin" export PATH echo "Creating device nodes with udev" -/sbin/udevd --daemon if [ -f "/sbin/udevadm" ] then /sbin/udevadm trigger @@ -1461,11 +1470,20 @@ if [ -r /rootimg.sfs ]; then mkdir -p /rw mount -t squashfs /rootimg.sfs /ro mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot \$NEWROOT - mkdir -p \$NEWROOT/ro - mkdir -p \$NEWROOT/rw - mount --move /ro \$NEWROOT/ro - mount --move /rw \$NEWROOT/rw + modprobe overlay + if [ $? -eq 0 ]; then + echo Mounting \$NEWROOT with type overlay + mkdir -p /rw/upper + mkdir -p /rw/work + mount -t overlay -o lowerdir=/ro,upperdir=/rw/upper,workdir=/rw/work mergedroot \$NEWROOT + else + echo Mounting \$NEWROOT with type aufs + mount -t aufs -o dirs=/rw:/ro mergedroot \$NEWROOT + mkdir -p \$NEWROOT/ro + mkdir -p \$NEWROOT/rw + mount --move /ro \$NEWROOT/ro + mount --move /rw \$NEWROOT/rw + fi EOMS print $inifile "elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then\n"; print $inifile " logger -t \$log_label -p info \"Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]...\"\n"; @@ -1648,7 +1666,7 @@ EOMS } # add extra commands for initrd - foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevd", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/xz", "bin/gzip", "bin/tar") { + foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/xz", "bin/gzip", "bin/tar") { getlibs($_); push @filestoadd, $_; } diff --git a/xCAT-server/share/xcat/scripts/BMC_change_password.sh b/xCAT-server/share/xcat/scripts/BMC_change_password.sh index 54f01c855..ed9c18cd5 100755 --- a/xCAT-server/share/xcat/scripts/BMC_change_password.sh +++ b/xCAT-server/share/xcat/scripts/BMC_change_password.sh @@ -22,6 +22,9 @@ if [ $# -le 3 ]; then Change the default root or ADMIN password of the BMC to the one specified by '-n' flag. Use the same password when discovering new BMCs, by passing it with '[-p|--bmcpasswd]' option to 'bmcdiscover' command. + +Note: Starting with xCAT 2.16, the changing of default BMC passwords +can also be done with '-n' option for 'bmcdiscover' command. " echo "Usage:" echo " $0 -r -n " @@ -63,8 +66,8 @@ UNAUTHORIZED="Unauthorized" for name in `cat /tmp/$$.ip.list` do - ## Look for Witherspoon first - SYSTEM_TYPE="Witherspoon" + ## Look for OpenBMC (Witherspoon or Mihawk) first + SYSTEM_TYPE="OpenBMC" PasswordChangeNeeded=`curl -sD - --data '{"UserName":"'"$WITHERSPOON_DEFAULT_USER"'","Password":"'"$WITHERSPOON_DEFAULT_PW"'"}' -k -X POST https://$name/redfish/v1/SessionService/Sessions` if [[ "$PasswordChangeNeeded" =~ "$CHANGE_PW_REQUIRED" ]]; then @@ -74,7 +77,7 @@ do echo "$name: Can not change password for $SYSTEM_TYPE system - $PW_PAM_VALIDATION" elif [[ -z "$PasswordChanged" ]]; then # If no output, password change was successful - echo "$name: Password for $SYSTEM_TYPE system changed. It might take up to 5 minutes for the BMC to update." + echo "$name: Password for $SYSTEM_TYPE system changed." else # Some unexpected output changing the password - report error and show output echo "$name: Unable to change password for $SYSTEM_TYPE system - $PasswordChanged" @@ -83,8 +86,8 @@ do continue fi - ## Look for Boston next - SYSTEM_TYPE="Boston" + ## Look for IPMI managed (Boston) next + SYSTEM_TYPE="IPMI" PasswordChangeNeeded=`curl -sD - --data '{"UserName":"'"$BOSTON_DEFAULT_USER"'","Password":"'"$BOSTON_DEFAULT_PW"'"}' -k -X POST https://$name/redfish/v1/SessionService/Sessions` if [[ "$PasswordChangeNeeded" =~ "$CHANGE_PW_REQUIRED" ]]; then echo "$name: Password change needed for $SYSTEM_TYPE system" diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 948f0863a..9d8e76abd 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.45 +# Version 1.0.46 # # Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -29,8 +29,12 @@ # - Display a list of packages that could not be uninstalled # 2019-11-05 Mark Gurevich # - Display a list of packages that will be installed before "Continue?" +# 2020-5-7 Nic Mays +# - Handles 'stable' as a flag to install latest version via the command: +# go-xcat --xcat-version=stable install # + function usage() { local script="${0##*/}" @@ -72,6 +76,7 @@ function usage() ${script} --yes install ${script} -x 2.12 -y install ${script} --xcat-version=devel install + ${script} --xcat-version=stable install ${script} --xcat-core=/path/to/xcat-core.tar.bz2 \\ --xcat-dep=/path/to/xcat-dep.tar.bz2 install ${script} --xcat-core=http://xcat.org/path/to/xcat-core.tar.bz2 \\ @@ -1285,7 +1290,7 @@ function remove_repo_zypper() { type zypper >/dev/null 2>&1 || return 255 local repo_id="$1" - zypper removerepo "${repo_id}" + zypper removerepo "${repo_id}" 2> /dev/null case "${repo_id}" in "xcat-core") mv /etc/zypp/repos.d/xCAT-core.repo{,.nouse} 2>/dev/null @@ -1322,6 +1327,7 @@ function add_xcat_core_repo_yum_or_zypper() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" + if [[ -z "${url}" ]] then case "${ver}" in @@ -1348,6 +1354,7 @@ function add_xcat_core_repo_apt() local ver="$2" local tmp="" [[ -z "${ver}" ]] && ver="latest" + if [[ -z "${url}" ]] then # get the apt.key @@ -1355,7 +1362,7 @@ function add_xcat_core_repo_apt() local tmp="${TMP_DIR}/tmp_xcat.key" download_file "${url}" "${tmp}" warn_if_bad "$?" "download xcat apt key failed" || return 1 - apt-key add "${tmp}" >/dev/null 2>&1 + apt-key add "${tmp}" warn_if_bad "$?" "import xcat apt key failed" || return 1 case "${ver}" in "devel") @@ -1382,6 +1389,7 @@ function add_xcat_dep_repo_yum_or_zypper() local url="$1" local ver="$2" [[ -z "${ver}" ]] && ver="latest" + local tmp="" local install_path="${GO_XCAT_DEFAULT_INSTALL_PATH}" local distro="${GO_XCAT_LINUX_DISTRO}${GO_XCAT_LINUX_VERSION%%.*}" @@ -1450,6 +1458,7 @@ function add_xcat_dep_repo_apt() local url="$1" local ver="$2" [[ -z "${ver}" ]] && ver="latest" + [[ -z "${url}" ]] && url="${GO_XCAT_DEFAULT_BASE_URL}/apt/${ver}/xcat-dep" add_repo_by_url_apt "${url}" "xcat-dep" @@ -1992,6 +2001,10 @@ do ;; "--xcat-version="*) GO_XCAT_VERSION="${1##--xcat-version=}" + if [ "${GO_XCAT_VERSION}" = "stable" ]; + then + GO_XCAT_VERSION="latest" + fi ;; "-y"|"--yes") GO_XCAT_YES=("-y") diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 3446db8c8..c6dca6c64 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -41,7 +41,7 @@ BuildArch: noarch %if %s390x Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser %else -Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) perl-XML-LibXML-Simple +Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) perl-XML-LibXML %endif Obsoletes: atftp-xcat %endif diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index 9254f0613..9c45ac82c 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index f6c619655..e8b5b87d9 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -24,6 +24,7 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat rmimage_diskless rpower_reset diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index 2bd2749c6..51c605833 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy updatenode_P_script1 updatenode_P_script1_script2 diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index b33107385..267fabddb 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -24,6 +24,7 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat rmimage_diskless rpower_reset diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index 4e15bb1ca..4579ab45b 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle index 557c79214..388887cd4 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -16,4 +16,5 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index a7ec89506..ac69cd322 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -1,5 +1,6 @@ SN_setup_case reg_linux_diskless_installation_hierarchy +reg_linux_diskless_installation_hierarchy_squashfs reg_linux_diskfull_installation_hierarchy assign_certain_command_permission bmcdiscover_help diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle index 8792401aa..76767fa1f 100644 --- a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -16,4 +16,5 @@ nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 5da3ac5fe..2ac01f264 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -1,4 +1,5 @@ reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat assign_certain_command_permission bmcdiscover_help @@ -228,3 +229,5 @@ xdsh_permission_denied xdsh_q xdsh_regular_command xdsh_t +go_xcat_devel_from_repo +go_xcat_stable_from_repo diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index 46ff09f19..5e4ffac31 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -1,4 +1,5 @@ reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs reg_linux_diskfull_installation_flat assign_certain_command_permission bmcdiscover_help @@ -228,3 +229,5 @@ xdsh_permission_denied xdsh_q xdsh_regular_command xdsh_t +go_xcat_devel_from_repo +go_xcat_stable_from_repo diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh index 770033781..f49f69f92 100755 --- a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -6,25 +6,23 @@ declare -i tryreinstall=1 node=$1 osimage=$2 vmhost=`lsdef $node -i vmhost -c | cut -d '=' -f 2` +times=3 if [ $# -eq 3 ]; then - times=$3+1 - echo "Try to rinstall for $3 times ......" -else - times=6 - echo "Try to rinstall for 5 times ......" + times=$3 fi +echo "Try to rinstall for $times times ......" -for (( tryreinstall = 1 ; tryreinstall < $times ; ++tryreinstall )) +for (( tryreinstall = 1 ; tryreinstall <= $times ; ++tryreinstall )) do echo "[$tryreinstall] Trying to install $node with $osimage ..." if [[ ! -z $vmhost ]];then # Display memory and active VMs on VM host, when installing on VM echo "Memory on vmhost $vmhost" - ssh $vmhost free -g + ssh $vmhost free -m echo "Active VMs on vmhost $vmhost" ssh $vmhost virsh list fi diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 3efbdc71a..ed886e3fc 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -250,6 +250,7 @@ sub testxdsh { print "The input parameter is $value \n"; my $checkstring; my $checkfile; + my $nodestatus; if ($value == 1) { #mean runcmd test using test scripts genesistest.pl writes $checkstring = "testcmd"; @@ -261,13 +262,16 @@ sub testxdsh { $checkstring = "destiny=shell"; $checkfile = "/proc/cmdline"; } + my $xdsh_command="xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring"; if (($value == 1) || ($value == 2) || ($value == 3)) { - `xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring `; + `$xdsh_command`; if ($?) { - foreach (1 .. 10) { + my @i = (1..10); + for (@i) { sleep 300; - send_msg(1,"try to run xdsh $noderange to check the results again"); - `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; + $nodestatus=`lsdef $noderange -i status -c 2>&1 | awk -F'=' '{print \$2}'`; + send_msg(1,"[$_] Running \"$xdsh_command\" to check results. Node status: $nodestatus"); + `$xdsh_command`; last if ($? == 0); } } diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 42edb9024..48b97ff28 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -2,13 +2,13 @@ start:go_xcat_devel_from_repo description:test go-xcat devel on a newly provisioned node label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -21,6 +21,19 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Pull down core and deps repomd.xml on SLES to prevent caching of the wrong file +cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then xdsh $$CN "wget --no-cache http://xcat.org/files/xcat/repos/yum/devel/core-snap/repodata/repomd.xml"; fi +cmd:if xdsh $$CN "grep \"SUSE\" /etc/*release >/dev/null"; then os=`echo __GETNODEATTR($$CN,os)__ | cut -d "." -f1 | sed s/sle1/sles1/` && xdsh $$CN "wget --no-cache http://xcat.org/files/xcat/repos/yum/devel/xcat-dep/$os/__GETNODEATTR($$CN,arch)__/repodata/repomd.xml"; fi + +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install devel version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" check:rc==0 @@ -37,13 +50,13 @@ start:go_xcat_stable_from_repo description:test go-xcat GA on a newly provisioned node label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -56,6 +69,15 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -72,13 +94,13 @@ start:go_xcat_stable_from_repo_upgrade description:test go-xcat GA on a newly provisioned node upgrade to devel label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -91,6 +113,15 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 @@ -117,13 +148,13 @@ start:go_xcat_stable_from_repo_reinstall_devel description:test go-xcat GA on a newly provisioned node, remove, install devel label:go_xcat os:Linux -#Make sure service node is not off, if it is, power it on -cmd:if rpower $$SN stat | grep "off"; then rpower $$SN on; sleep 300; fi -cmd:lsdef $$SN -i status -check:output=~booted + +#Remove compute node reference to service node +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 #Provision compute node -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute 2 check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:lsdef -l $$CN | grep status @@ -136,6 +167,15 @@ check:rc==0 #Install additional packages on Red Hat cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils dnf-utils bzip2"; fi +#Install additional packages on Ubuntu +cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg"; fi + +#Replace sources.list file on Ubuntu +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi + +#Set flag to accept install dependent packages by default on Ubuntu +cmd:if grep Ubuntu /etc/*release;then arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi; fi + #Install GA version of xCAT cmd:xdsh $$CN "cd /; ./go-xcat -y install" check:rc==0 diff --git a/xCAT-test/autotest/testcase/imgexport/cases0 b/xCAT-test/autotest/testcase/imgexport/cases0 index 246647447..c9aeca9e1 100644 --- a/xCAT-test/autotest/testcase/imgexport/cases0 +++ b/xCAT-test/autotest/testcase/imgexport/cases0 @@ -62,13 +62,3 @@ check:output=~Usage|usage cmd:imgexport --help check:output=~Usage|usage end - - -start:imgexport_v -os:Linux -label:others -cmd:imgexport -v -check:output=~version|Version -cmd:imgexport --version -check:output=~version|Version -edn diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index f78bf840a..cfcd0832a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -18,6 +18,15 @@ check:rc==0 cmd:chtab key=nameservers site.value="" check:rc==0 +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 +check:rc==0 +cmd:echo -e '#!/bin/bash\n\necho \"Execute permission is set.\"\nexit 0'> /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" +check:rc==0 + cmd:makedns -n check:rc==0 cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN;fi @@ -75,4 +84,20 @@ check:rc==0 cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi 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)__-install-compute synclists= + +cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" +check:rc==0 +cmd:xdsh $$CN "grep \"Execute permission is set\" /var/log/xcat/xcat.log" +check:rc==0 +check:output=~ Execute permission is set +cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" +check:rc==0 +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 end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index b048d547a..b07c66ed2 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -84,3 +84,100 @@ cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 end + +start:reg_linux_diskless_installation_flat_squashfs +os:Linux +label:flat_cn_diskless,provision +cmd:fdisk -l +cmd:df -T +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi +check:rc==0 +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 + +cmd:makedns -n +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +check:rc==0 +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi +check:rc==0 +cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; +cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist +check:rc==0 +cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi +cmd:mount |sort > /tmp/mountoutput/file.org +cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ ppc64(el|le) ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:mount |sort > /tmp/mountoutput/file.new +cmd:cat /tmp/mountoutput/file.new +cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-lines="fusectl" +check:rc==0 +cmd:rm -rf /tmp/mountoutput + +#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 Ubuntu +cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi + +#Make sure squashfs rpm is installed on SLES +cmd:if [[ "$$OS" =~ "sle" ]]; then zypper install -y squashfs; fi + +cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~archive method:squashfs + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~Provision node\(s\)\: $$CN + +cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi + +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +check:output=~on / type overlay +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi +check:rc==0 +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd:xdsh $$CN "cat /test.synclist" +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi +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 +end 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 bd8fe4876..5586630d4 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -14,6 +14,15 @@ cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpser cmd:chdef -t node $$SN groups=service,all check:rc==0 +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 +check:rc==0 +cmd:echo -e '#!/bin/bash\n\necho \"Execute permission is set.\"\nexit 0'> /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chmod 755 /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:chdef -p -t node -o $$CN postscripts="dir1/dir2/dir3/foo.bar" +check:rc==0 + cmd:makedns -n check:rc==0 cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi @@ -82,4 +91,118 @@ 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 + +cmd:xdsh $$CN "find /xcatpost/dir1/dir2/dir3/foo.bar -type f -perm -111 | egrep 'foo'" +check:rc==0 +cmd:xdsh $$CN "grep \"Execute permission is set\" /var/log/xcat/xcat.log" +check:rc==0 +check:output=~ Execute permission is set +cmd:rm -f /install/postscripts/dir1/dir2/dir3/foo.bar +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/foo.bar" +check:rc==0 +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 +end + +start:reg_linux_diskless_installation_hierarchy_squashfs +os:Linux +#stop:yes +label:hierarchy_cn_diskless,provision +cmd:xdsh $$SN fdisk -l +cmd:xdsh $$SN df -T +cmd:xdsh $$SN "echo "test"> /test.hierarchy" +check:rc==0 +cmd:xdsh $$SN cat /test.hierarchy +check:rc==0 +check:output=~test +cmd:output=$(xdsh $$SN ls -al / |grep test.hierarchy);if [[ $? -eq 0 ]];then xdsh $$SN rm -rf /test.hierarchy;fi +cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN +cmd:chdef -t node $$SN groups=service,all +check:rc==0 + +cmd:makedns -n +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +check:rc==0 +cmd:sleep 20 +cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:service dhcpd restart +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 + +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +check:rc==0 +cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; +cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist +check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +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 Ubuntu +cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi + +#Make sure squashfs rpm is installed on SLES +cmd:if [[ "$$OS" =~ "sle" ]]; then zypper install -y squashfs; fi + +cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~archive method:squashfs + +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 + +cmd:updatenode $$CN -f +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~Provision node\(s\)\: $$CN + +cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" + +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +check:output=~on / type overlay +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +check:output=~SERVICEGROUP=$$SN +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi +check:rc==0 +cmd:xdsh $$CN "cat /test.synclist" +check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi +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 + end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index a7f5223bc..3b9075dc9 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -48,7 +48,7 @@ check:rc==0 cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow check:rc==0 -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir.regbak; mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=nfs 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 187d837b7..64e3fca66 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 @@ -59,7 +59,7 @@ check:rc==0 cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow check:rc==0 -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir.regbak; mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute 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 bc49996a9..6337a694f 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 @@ -57,7 +57,7 @@ check:rc==0 cmd:chtab priority=4.8 policy.commands=litetree policy.rule=allow check:rc==0 -cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi +cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir.regbak; mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=ramdisk check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index a9613d522..312e12854 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -1,7 +1,7 @@ start:setup_vm description:reset up vm environment if need label:others -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ];then echo "CN node $$CN is a vm which mgt is __GETNODEATTR($$CN,mgt)__, start to recreate the vm now"; echo "rpower $$CN off"; rpower $$CN off; sleep 3; echo "rpower $$CN stat"; rpower $$CN stat; var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`; echo "The disk create way of $$CN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$CN"; mkvm $$CN; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN"; mkvm $$CN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$CN -s 20G -f"; mkvm $$CN -s 20G -f; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN -s 20G -f"; mkvm $$CN -s 20G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me"; exit 2; else echo "unsupported disk creation way"; exit 3;fi;else echo "CN node $$CN is a non-VM; do not need to recreate it";fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ];then echo "CN node $$CN is a VM, mgt is __GETNODEATTR($$CN,mgt)__, starting to recreate the vm"; echo "rpower $$CN off"; rpower $$CN off; sleep 3; echo "rpower $$CN stat"; rpower $$CN stat; var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`; echo "The disk type of $$CN is $var"; if [ "$var" = "phy" ]; then echo "mkvm $$CN"; mkvm $$CN; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN"; mkvm $$CN; exit $?; elif [ "$var" = "dir" ]; then echo "mkvm $$CN -s 30G -f"; mkvm $$CN -s 30G -f; echo "rmvm $$CN -f -p"; rmvm $$CN -f -p; echo "mkvm $$CN -s 30G -f"; mkvm $$CN -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 "CN node $$CN is not a VM; do not need to recreate it";fi check:rc==0 cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then echo "CN node is a vm, need to repower it on"; echo "rpower $$CN on"; rpower $$CN on; else echo "CN node $$CN is a non-VM; do not need to repower on it"; fi @@ -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 which mgt is __GETNODEATTR($$SN,mgt)__, start to recreate the vm now"; 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 create way 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 20G -f"; mkvm $$SN -s 20G -f; echo "rmvm $$SN -f -p"; rmvm $$SN -f -p; echo "mkvm $$SN -s 20G -f"; mkvm $$SN -s 20G -f; exit $?; elif ["$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me"; exit 2; else echo "unsupported disk creation way"; exit 3;fi;else echo "SN node $$SN is a non-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 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 check:rc==0 diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 6cb63db13..3b55e4a68 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -16,7 +16,7 @@ cmd:makedhcp -a check:rc==0 cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi @@ -57,12 +57,15 @@ check:rc==0 cmd:lsdef -t node $$CN -i postscripts,postbootscripts cmd:lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -i crashkernelsize,dump -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:rpower $$CN off +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -V check:rc==0 check:output=~Provision node\(s\)\: $$CN -# Verify kdump related attributes showup in tftpboot file +# Verify kdump related attributes showup in tftpboot file and file was changed +cmd:ls -l /tftpboot/boot/grub2/$$CN cmd:cat /tftpboot/boot/grub2/$$CN +check:output=dump cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done @@ -86,14 +89,17 @@ cmd:a=`xdsh $$CN rpm -q at`;if [[ $a =~ "package at is not installed" ]]; then x cmd:xdsh $$CN "service atd start" check:rc==0 -# Verify that kdump directory from management node is still mounted on the compute node -cmd:xdsh $$CN df -H +# Verify that kdump has been configured after enablekdump postscript was ran +cmd:xdsh $$CN cat /etc/kdump.conf +check:output=~/opt/xcat/share/xcat/tools/autotest/kdumpdir # Verify kdump parameters are in /proc/cmdline file cmd:xdsh $$CN cat /proc/cmdline -# Verify enablekdump postscript was executed on the compute node -cmd:xdsh $$CN cat /var/log/xcat/xcat.log | grep "kdump" +# Verify no error configuring kdump server +cmd:xdsh $$CN cat /var/log/xcat/xcat.log | grep "The kdump server is not configured" +check:output!="The kdump server is not configured" +check:rc!=0 cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" cmd:sleep 300 @@ -101,9 +107,6 @@ cmd:sleep 300 cmd:vmcorefile=`find /opt/xcat/share/xcat/tools/autotest/kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "vmcore file is not empty";else echo "vmcore file is empty"; fi check:output=~not empty -# Check for errors in messages log file -cmd:xdsh $$CN grep "kdump" /var/log/messages - cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;mv -f $exlistfile.bak $exlistfile cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile diff --git a/xCAT-test/autotest/testcase/lskitcomp/case0 b/xCAT-test/autotest/testcase/lskitcomp/case0 index bfd0d394c..fedca5036 100644 --- a/xCAT-test/autotest/testcase/lskitcomp/case0 +++ b/xCAT-test/autotest/testcase/lskitcomp/case0 @@ -55,38 +55,6 @@ cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1 cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits end -start:lskitcomp_C -label:others,KIT -os:Linux -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp;buildkit create mykits -check:rc==0 -check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits directory -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildrepo all -check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildtar -check:rc==0 -cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 -check:rc==0 -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C basename $compname -check:rc==0 -check:output=~basename -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitcompname $compname -check:output=~kitcompname -check:rc==0 -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitreponame $compname -check:rc==0 -check:output=~kitreponame -cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C serverroles $compname -check:rc==0 -check:output=~serverroles -cmd:rmkit mykits-1.0-1 -check:rc==0 -cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits -end - - start:lskitcomp_S label:others,KIT os:Linux diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index acdc1a4b6..6740d6bb9 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -20,18 +20,30 @@ label:mn_only,ci_test,dns cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest cmd:chtab node=nouse_compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|" check:rc==0 +cmd:chtab node=nouse_compute nics.nicaliases='ib0!|node(\d+)|m($1)-ib0|' nics.nicips='ib0!|node(\d+)|10.0.0.($1+20)|' +check:rc==0 cmd:mkdef -t node -o node01,node02 groups="nouse_compute" check:rc==0 -cmd:sleep 30 cmd:XCATBYPASS=1 makehosts check:rc==0 -cmd:sleep 30 +cmd:sleep 10 cmd:cat /etc/hosts -check:output=~1.2.3.2 check:output=~1.2.3.1 +check:rc==0 +check:output=~1.2.3.2 +check:rc==0 check:output=~node01 +check:rc==0 +check:output=~m01-ib0 +check:rc==0 check:output=~node02 +check:rc==0 +check:output=~m02-ib0 +check:rc==0 +check:output=~10.0.0.22 +check:rc==0 cmd:chtab -d node=nouse_compute hosts +cmd:chtab -d node=nouse_compute nics cmd:rmdef node01 cmd:rmdef node02 cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 80561503f..a0afec2a5 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -27,7 +27,7 @@ cmd:service dhcpd restart check:rc==0 cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi check:output=~$$CN -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 @@ -146,7 +146,7 @@ cmd:service dhcpd restart check:rc==0 cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi check:output=~$$CN -cmd:copycds $$ISO +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 @@ -188,10 +188,11 @@ cmd:xdsh $$CN "zypper sl -U;zypper --gpg-auto-import-keys search --match-exact - check:rc==0 cmd:xdsh $$CN "zypper -n install xCAT" check:rc==0 -cmd:xdsh $$CN "zypper -n install createrepo" +# 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 check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh" -eck:rc==0 +check:rc==0 cmd:xdsh $$CN "lsxcatd -v" check:rc==0 check:output=~$$MIGRATION2_VERSION diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 2e807673c..d68b4d3e0 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -171,7 +171,7 @@ label:others cmd:mkdef -t node -o testnode1 arch=ppc64el cons=ipmi groups=pbmc mgt=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 check:rc==0 cmd:chdef testnode1 os=rhels7.5 netboot=petitboot -eck:rc==0 +check:rc==0 cmd: mkdef "rhels7.5-ppc64el-install-compute" -u profile=compute provmethod=install osvers=rhels7.5 check:rc==0 cmd:nodeset testnode1 osimage="rhels7.5-ppc64el-install-compute" diff --git a/xCAT-test/autotest/testcase/restapi/service/cases0 b/xCAT-test/autotest/testcase/restapi/service/cases0 index 88c491b28..bd515386e 100644 --- a/xCAT-test/autotest/testcase/restapi/service/cases0 +++ b/xCAT-test/autotest/testcase/restapi/service/cases0 @@ -19,13 +19,6 @@ cmd:restapitest -m POST -r /services/host check:rc==201 end -start:post_host -description: post_host -label:others,restapi -cmd:restapitest -m POST -r /services/host -check:rc==201 -end - start:get_slpnodes description: get_slpnodes label:others,restapi diff --git a/xCAT-test/autotest/testcase/rmimage/case0 b/xCAT-test/autotest/testcase/rmimage/case0 index 7e3795f01..602ff5df7 100644 --- a/xCAT-test/autotest/testcase/rmimage/case0 +++ b/xCAT-test/autotest/testcase/rmimage/case0 @@ -1,13 +1,14 @@ start:rmimage_diskless description:This case is to test rmimage could work correctly to remove all image files. -cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi label:others,packaging -cmd:copycds $$ISO +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute.bak;fi +cmd:copycds $$ISO | grep -v "%" check:rc==0 cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +cmd:df -H cmd:cp -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.gz check:rc==0 cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 1d413dd2d..37837a98e 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -16,7 +16,10 @@ start:rpower_stat description:This case is to test stat option could show the power status of nodes Attribute: $$CN-The operation object of rpower command label:cn_bmc_ready,hctrl_general -cmd:rpower $$CN on + +#If rpower fails on the first try, try again with smaller memory +cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi + cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 5 ];then break;fi done cmd:rpower $$CN stat check:rc==0 @@ -43,7 +46,7 @@ cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do slee cmd:rpower $$CN stat check:output=~Not Activated|off # Display active VMs and memory on VM host -cmd:vmhost=`lsdef $$CN -i vmhost -c | cut -d '=' -f 2`; if [[ ! -z $vmhost ]]; then echo "Memory on vmhost $vmhost"; ssh $vmhost free -g; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi +cmd:vmhost=`lsdef $$CN -i vmhost -c | cut -d '=' -f 2`; if [[ ! -z $vmhost ]]; then echo "Memory on vmhost $vmhost"; ssh $vmhost free -m; echo "Active VMs on vmhost $vmhost"; ssh $vmhost virsh list; fi cmd:rpower $$CN boot check:rc==0 cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done @@ -89,8 +92,11 @@ cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat check:output=~Not Activated|off -cmd:rpower $$CN on + +#If rpower fails on the first try, try again with smaller memory +cmd:out=`rpower $$CN on 2>&1`;if [ $? -eq 1 ];then memory=`lsdef $$CN -i vmmemory -c | cut -d '=' -f 2`; chvm $$CN --mem $((memory-2048)); echo "'rpower on' failed with ${out}. Trying with smaller memory."; rpower $$CN on; fi check:rc==0 + cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN stat check:output=~Running|on diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index 59281087e..fbce9a6cc 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -303,15 +303,15 @@ end start:updatenode_P_script1 label:others,updatenode -cmd:echo "echo hello > /tmp/updatenode_P_script" > /tmp/script1 +cmd:mkdir -p /install/postscripts/dir1/dir2/dir3 check:rc==0 -cmd:chmod a+x /tmp/script1 +cmd:echo "echo hello > /tmp/updatenode_P_script" > /install/postscripts/dir1/dir2/dir3/script1 check:rc==0 -cmd:cp /tmp/script1 /install/postscripts +cmd:chmod a+x /install/postscripts/dir1/dir2/dir3/script1 check:rc==0 -cmd:chdef $$CN postscripts=script1 +cmd:chdef $$CN postscripts=dir1/dir2/dir3/script1 check:rc==0 -cmd:updatenode $$CN -P script1 +cmd:updatenode $$CN -P dir1/dir2/dir3/script1 check:rc==0 check:output=~script1 cmd:xdsh $$CN "ls -l /tmp/updatenode_P_script" @@ -321,7 +321,15 @@ check:rc==0 check:output=~hello cmd:chdef $$CN postscripts= check:rc==0 -cmd:rm -f /install/script1 +cmd:rm -f /install/postscripts/dir1/dir2/dir3/script1 +check:rc==0 +cmd:cd /install/postscripts; rmdir -p dir1/dir2/dir3 +check:rc==0 +cmd:xdsh $$CN "rm /tmp/updatenode_P_script" +check:rc==0 +cmd:xdsh $$CN "rm -f /xcatpost/dir1/dir2/dir3/script1" +check:rc==0 +cmd:xdsh $$CN "cd /xcatpost; rmdir -p dir1/dir2/dir3" check:rc==0 end @@ -664,8 +672,3 @@ check:rc==0 cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist check:rc==0 end - - - - - diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.common b/xCAT-test/autotest/testcase/xcat_inventory/cases.common index 4badc8873..8572f59d5 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.common +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.common @@ -88,7 +88,7 @@ check:output ~=usage check:output ~= error: argument -f/--path: expected one argument cmd:xcat-inventory export -t node -o bogusnode --path check:rc!=0 -eck:output ~=usage +check:output ~=usage check:output ~= error: argument -f/--path: expected one argument cmd:mkdir /tmp/xcat_inventory_export_option_f/testdir check:rc==0 diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 7cc2a4641..f95a839b9 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1761,7 +1761,7 @@ sub get_files_recursive next if ($direntry eq '..'); my $target = "$dir/$direntry"; if (-d $target) { - unless ($target =~ /xcat-inventory\/templates/){ + unless ($target =~ /xcat_inventory\/templates/){ get_files_recursive($target, $files_path_ref); } } else { diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 426270944..76f1ce2a2 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -68,16 +68,21 @@ function configipv4(){ if [ "$str_nic_mtu" != "$str_default_token" ]; then echo "MTU=${str_nic_mtu}" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done else echo "IPADDR_${num_v4num}=${str_v4ip}" >> $str_conf_file echo "NETMASK_${num_v4num}=${str_v4mask}" >> $str_conf_file @@ -86,16 +91,21 @@ function configipv4(){ if [ "$str_nic_mtu" != "$str_default_token" ]; then echo "MTU_${num_v4num}=${str_nic_mtu}" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done fi if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then @@ -117,16 +127,21 @@ function configipv4(){ if [ "$str_nic_mtu" != "$str_default_token" ]; then echo " mtu ${str_nic_mtu}" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo " ${name} ${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" $str_conf_file + else + echo "${name} ${value}" >> $str_conf_file + fi + i=$((i+1)) + done if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then parent_device=`echo ${str_if_name} | sed -e 's/\([a-zA-Z0-9]*\)\.[0-9]*/\1/g'` echo " vlan-raw-device ${parent_device}" >> $str_conf_file @@ -198,7 +213,12 @@ function configipv4(){ do name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" - echo "${name}=${value}" >> $str_conf_file + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi i=$((i+1)) done fi @@ -244,15 +264,20 @@ configipv6(){ fi #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done elif [ "$str_os_type" = "debian" ];then #debian or ubuntu str_conf_file="/etc/network/interfaces.d/${str_if_name}" @@ -269,15 +294,20 @@ configipv6(){ fi #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" - echo " $i: name=$name value=$value" - echo " ${name} ${value}" >> $str_conf_file - i=$((i+1)) - done + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + echo " $i: name=$name value=$value" + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" $str_conf_file + else + echo "${name} ${value}" >> $str_conf_file + fi + i=$((i+1)) + done else echo " post-up /sbin/ifconfig ${str_if_name} inet6 add ${str_v6ip}/${str_v6prefix}" >> $str_conf_file echo " pre-down /sbin/ifconfig ${str_if_name} inet6 del ${str_v6ip}/${str_v6prefix}" >> $str_conf_file @@ -302,15 +332,20 @@ configipv6(){ fi #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done fi } @@ -610,17 +645,21 @@ elif [ "$1" = "-s" ];then if [ -n "$str_inst_gateway" ];then echo " gateway $str_inst_gateway" >> $str_conf_file fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo " ${name} ${value}" >> $str_conf_file - i=$((i+1)) - done - + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" $str_conf_file + else + echo "${name} ${value}" >> $str_conf_file + fi + i=$((i+1)) + done hostname $NODE echo $NODE > /etc/hostname elif [ "$str_os_type" = "sles" ];then @@ -643,18 +682,21 @@ elif [ "$1" = "-s" ];then fi fi - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done - - + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi + i=$((i+1)) + done hostname $NODE echo $NODE > /etc/HOSTNAME else @@ -672,11 +714,12 @@ elif [ "$1" = "-s" ];then nmcli con modify $con_name connection.id $tmp_con_name fi nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 - str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_inst_nic}-1" if [ -f $str_conf_file_1 ]; then grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null if [ $? -eq 0 ]; then $str_conf_file=$str_conf_file_1 + #mv -f $str_conf_file_1 $str_conf_file fi fi else @@ -713,7 +756,12 @@ elif [ "$1" = "-s" ];then name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo "$i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file + grep -i "${name}" $str_conf_file + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" $str_conf_file + else + echo "${name}=${value}" >> $str_conf_file + fi i=$((i+1)) done diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 41271ccf8..9f06b4769 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -192,38 +192,38 @@ then rm -f $dir/ifcfg-$nic 2>&1 1>/dev/null done - else - interfaces="/etc/network/interfaces" + else + interfaces="/etc/network/interfaces" - for tmp in `sed -n "/auto ib/=" ${interfaces}` + for tmp in `sed -n "/auto ib/=" ${interfaces}` + do + startline=`sed -n "/auto ib/=" ${interfaces}| head -n 1` + endline=`sed -n "$startline,/^auto/p" ${interfaces} |wc -l` + + if sed -n "$startline,/^auto/p" ${interfaces} |sed '$!d' |grep "auto" >/dev/null;then + endline=`expr $startline + $endline - 2` + else + endline=`expr $startline + $endline - 1` + fi + + ((startline--)) + temp=`sed -n ${startline}p ${interfaces}` + while [[ $temp =~ ^# ]] do - startline=`sed -n "/auto ib/=" ${interfaces}| head -n 1` - endline=`sed -n "$startline,/^auto/p" ${interfaces} |wc -l` - - if sed -n "$startline,/^auto/p" ${interfaces} |sed '$!d' |grep "auto" >/dev/null;then - endline=`expr $startline + $endline - 2` - else - endline=`expr $startline + $endline - 1` - fi - ((startline--)) temp=`sed -n ${startline}p ${interfaces}` - while [[ $temp =~ ^# ]] - do - ((startline--)) - temp=`sed -n ${startline}p ${interfaces}` - done - ((startline++)) - - temp=`sed -n ${endline}p ${interfaces}` - while [[ $temp =~ ^# ]] - do - ((endline--)) - temp=`sed -n ${endline}p ${interfaces}` - done - - sed -i ${startline},${endline}d ${interfaces} done + ((startline++)) + + temp=`sed -n ${endline}p ${interfaces}` + while [[ $temp =~ ^# ]] + do + ((endline--)) + temp=`sed -n ${endline}p ${interfaces}` + done + + sed -i ${startline},${endline}d ${interfaces} + done fi else loop_number=`lsdev | grep "IP over Infiniband Network Interface" | wc -l` @@ -439,7 +439,12 @@ IPADDR=$nicip" > $dir/ifcfg-$nic name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic + grep -i "${name}" $dir/ifcfg-$nic + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic + else + echo "${name}=${value}" >> $dir/ifcfg-$nic + fi i=$((i+1)) done else # not the first ip address @@ -466,7 +471,12 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic + grep -i "${name}" $dir/ifcfg-$nic + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic + else + echo "${name}=${value}" >> $dir/ifcfg-$nic + fi i=$((i+1)) done fi # end if [ $ipindex -eq 1 ] @@ -488,6 +498,7 @@ $nmcontrol $devtype BOOTPROTO=none ONBOOT=yes +DEFROUTE=no NAME=$nic IPADDR=$nicip" > $dir/ifcfg-$nic # ipv6 @@ -517,7 +528,12 @@ IPADDR=$nicip" > $dir/ifcfg-$nic name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic + grep -i "${name}" $dir/ifcfg-$nic + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $dir/ifcfg-$nic + else + echo "${name}=${value}" >> $dir/ifcfg-$nic + fi i=$((i+1)) done else # not the first ip address @@ -577,7 +593,12 @@ IPADDR$ipindex=$nicip" name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $cfgfile + grep -i "${name}" $cfgfile + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name}=${value}/i" >> $cfgfile + else + echo "${name}=${value}" >> $cfgfile + fi i=$((i+1)) done @@ -644,7 +665,12 @@ netmask $netmask" >> /etc/network/interfaces name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name} ${value}" >> /etc/network/interfaces + grep -i "${name}" /etc/network/interfaces + if [ $? -eq 0 ];then + sed -i "s/.*${name}.*/${name} ${value}/i" >> /etc/network/interfaces + else + echo "${name} ${value}" >> /etc/network/interfaces + fi i=$((i+1)) done diff --git a/xCAT/postscripts/confignics b/xCAT/postscripts/confignics index 4718fbee9..6d67c53ae 100755 --- a/xCAT/postscripts/confignics +++ b/xCAT/postscripts/confignics @@ -4,6 +4,7 @@ #------------------------------------------------------------------------------- #=head1 confignics #=head2 Used on Linux only. Config the Ethernet or InfiniBand adapters on the nodes +#=head3 confignics is deprecated, please use confignetwork instead # # You can run the following commands on MN: # updatenode noderange confignics @@ -13,6 +14,9 @@ #=cut #------------------------------------------------------------------------------- +logger -t $log_label -p local4.err "**NOTE**:confignics is deprecated, please use confignetwork instead" +echo "**NOTE**:confignics is deprecated, please use confignetwork instead" +exit 1 if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then str_dir_name=`dirname $0` diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp index 38f5ddad9..789389260 100755 --- a/xCAT/postscripts/cumulusztp +++ b/xCAT/postscripts/cumulusztp @@ -161,7 +161,7 @@ echo './enablesnmp' >> ./mypostscript #config base interface echo './configinterface' >> ./mypostscript #config static ip address for mgt interface -echo './confignics -s' >> ./mypostscript +echo './confignetwork -s' >> ./mypostscript chmod 700 ./mypostscript ./mypostscript rc=$? diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index b4c6a6b6d..780b1da7b 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -289,6 +289,10 @@ function load_kmod { # ################################################################# function query_extra_params { + # reset global variables + unset array_nic_params + unset array_extra_param_names + unset array_extra_param_values nic=$1 if [ -z "$nic" ]; then @@ -479,9 +483,6 @@ function create_persistent_ifcfg { local _netmask="" local _mtu="" local inattrs="" - unset array_nic_params - unset array_extra_param_names - unset array_extra_param_values # parser input arguments while [ -n "$1" ]; @@ -2134,7 +2135,7 @@ function create_bond_interface_nmcli { else _bonding_opts="mode=active-backup" fi - if [ -z "$next_nic" ]; then + if [ -n "$_ipaddr" ]; then # query "nicnetworks" table about its target "xcatnet" xcatnet=$(query_nicnetworks_net $bondname) log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$bondname\"." @@ -2197,7 +2198,7 @@ function create_bond_interface_nmcli { # create raw bond device log_info "create bond connection $xcat_con_name" cmd="" - if [ -n "$next_nic" ]; then + if [ -z "$_ipaddr" ]; then cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts ipv4.method disabled ipv6.method ignore autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" else cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" @@ -2245,6 +2246,10 @@ function create_bond_interface_nmcli { $ip link set dev $ifslave down wait_for_ifstate $ifslave DOWN 20 2 fi + # InfiniBand slaves should have no MTU defined, only the bond interface + if [ "$slave_type" = "Infiniband" ]; then + _mtu="" + fi cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu ifname $ifslave master $xcat_con_name slave-type bond autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-retries 0" log_info $cmd $cmd @@ -2285,7 +2290,7 @@ function create_bond_interface_nmcli { # bring up interface formally log_info "$nmcli con up $xcat_con_name" $nmcli con up $xcat_con_name - if [ -z "$next_nic" ]; then + if [ -n "$_ipaddr" ]; then is_connection_activate_intime $xcat_con_name is_active=$? if [ "$is_active" -eq 0 ]; then diff --git a/xCAT/postscripts/setupscratch b/xCAT/postscripts/setupscratch index 244e65847..3c5e7427d 100755 --- a/xCAT/postscripts/setupscratch +++ b/xCAT/postscripts/setupscratch @@ -45,7 +45,7 @@ fi echo Creating Partition logger -t $log_label -p local4.info $ME Creating Partition parted -s /dev/sda mklabel gpt -parted -s -- /dev/sda mkpart primary ext3 0 -0 +parted -s -- /dev/sda mkpart primary ext4 0 -0 if grep sda1 /proc/partitions >/dev/null 2>&1 then sleep 5 @@ -58,8 +58,8 @@ else exit 1 fi -echo Creating new ext3 filesystem: /dev/sda1 -logger -t $log_label -p local4.info $ME Creating new ext3 filesystem: /dev/sda1 +echo Creating new ext4 filesystem: /dev/sda1 +logger -t $log_label -p local4.info $ME Creating new ext4 filesystem: /dev/sda1 mke2fs -j /dev/sda1 mkdir -p $mydir echo mounting new /dev/sda1 to $mydir diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3440250cd..98abeff80 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -429,8 +429,8 @@ if [ "$MODE" = "4" ]; then # for statelite mode done if [ -f /opt/xcat/xcatinfo ]; then - SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2` - HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2` + SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` + HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` if [ -n "$SIP" ]; then download_postscripts $SIP:${HTTPPORT} if [ $? -eq 0 ]; then @@ -498,8 +498,8 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) # if not updatenode, then look in xcatinfo for the xcatmaster if [ -f /opt/xcat/xcatinfo ]; then - SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2` - HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2` + SIP=`grep 'XCATSERVER' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` + HTTPPORT=`grep 'HTTPPORT' /opt/xcat/xcatinfo |cut -d= -f2 | sed "s/'//g"` [ -z "$HTTPPORT" ] && HTTPPORT="80" if [ -n "$SIP" ]; then download_postscripts ${SIP}:${HTTPPORT}