diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..cc6d51051 --- /dev/null +++ b/.mailmap @@ -0,0 +1,69 @@ +BAI Yuan +Bruce Potter +CAO Li +CAO Meng Meng +CAO Meng Meng +CAO Meng Meng +Casandra Qiu +Casandra Qiu +CHENG Long +CHU De Gao +CHU De Gao +CHU De Gao +GAO Feng +GAO Ling +GAO Ling +GONG Jie +GONG Jie +GONG Jie +HU Wei Hua +Jarrod Johnson +Jarrod Johnson +Jarrod Johnson +Jarrod Johnson +JIN Jie Hua +JIN Jie Hua +LI Guang Cheng +LI Guang Cheng +LI Guang Cheng +LI Ting Ting +Linda O. Mellor +Linda O. Mellor +Lissa Valletta +Lissa Valletta +Mark Gurevich +Mark Gurevich +Norm Nott +Norm Nott +Patrick Lundgren +Patrick Lundgren +Patrick Lundgren +SUN Jing +SUN Jing +Victor Hu +Victor Hu +Victor Hu +WANG Hua Zhong +WANG Hua Zhong +WANG Jun Xia +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WU Xian +XU Bin +XU Bin +XU Qing +XU Qing +XU Wei +YANG Peng +YANG Song +YANG Song +YANG Song +YANG Song +YIN Le +YIN Le +ZHAO Er Tao +ZHAO Er Tao +ZHAO Er Tao diff --git a/README.rst b/README.rst index 2cb961dfd..1d9a9e0ca 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211| +|docs_latest| |docs_2134| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| Open Source License ------------------- @@ -22,6 +22,11 @@ Developers Developers and prospective contributors are encouraged to read the `Developers Guide `_ In particular the `GitHub `_ related subsection. +.. |docs_2134| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.4 + :alt: 2.13.4 documentation status + :scale: 100% + :target: http://xcat-docs.readthedocs.io/en/2.13.4/ + .. |docs_2133| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.3 :alt: 2.13.3 documentation status :scale: 100% diff --git a/Version b/Version index 965a689ec..8bbab5627 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.13.4 +2.13.5 diff --git a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst index 544f577cd..10b7a69c1 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst @@ -25,7 +25,7 @@ Remove Old Provision Environment Change Definition ----------------- -#. Change netwoks table definitions :: +#. Change networks table definitions :: lsdef -t network -l diff --git a/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst b/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst index 6e17f9947..018de0672 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst @@ -1,10 +1,10 @@ -OpenPower Nodes +OpenPOWER Nodes =============== When compute nodes are physically replaced in the frame, leverage xCAT to re-discover the compute nodes. The following guide can be used for: - * IBM OpenPower S822LC for HPC + * IBM OpenPOWER S822LC for HPC #. Identify the machine(s) to be replaced: ``frame10cn02``. 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 984bf79fe..7311f53ae 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -480,6 +480,6 @@ Sample table contents: :: Limited support for user application networks --------------------------------------------- -In some cases you may have additional user application networks in your site that are not specifically used for cluster management.If desired you can create xCAT network definitions for these networks.This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes.When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. +In some cases you may have additional user application networks in your site that are not specifically used for cluster management. If desired you can create xCAT network definitions for these networks. This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes. When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. For example, when you run ``makedhcp -n`` it will list all domains defined in the xCAT **"site"** definition and xCAT **"network"** definitions in the **"option domain-search"** entry of the shared-network stanza in the dhcp configuration file. This will cause dhcp to put these domains in the compute nodes' **/etc/resolv.conf** file every time it gets a dhcp lease. diff --git a/docs/source/advanced/gpu/nvidia/osimage/index.rst b/docs/source/advanced/gpu/nvidia/osimage/index.rst index 04d4af107..70a2aff30 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/index.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/index.rst @@ -1,7 +1,7 @@ Create osimage definitions ========================== -Generate ``osimage`` definitions to provison the compute nodes with the NVIDIA CUDA toolkit installed. +Generate ``osimage`` definitions to provision the compute nodes with the NVIDIA CUDA toolkit installed. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/hamn/high_available_management_node.rst b/docs/source/advanced/hamn/high_available_management_node.rst index da94390ae..ebd78cf57 100644 --- a/docs/source/advanced/hamn/high_available_management_node.rst +++ b/docs/source/advanced/hamn/high_available_management_node.rst @@ -13,7 +13,7 @@ The data synchronization is important for any high availability configuration. W * The configuration files for the services that are required by xCAT, like named, DHCP, apache, nfs, ssh, etc. * The operating systems images repository and users customization data repository, the ``/install`` directory contains these repositories in most cases. -There are a lot of ways for data synchronization, but considering the specific xCAT HAMN requirements, only several of the data synchronziation options are practical for xCAT HAMN. +There are a lot of ways for data synchronization, but considering the specific xCAT HAMN requirements, only several of the data synchronization options are practical for xCAT HAMN. **1\. Move physical disks between the two management nodes**: if we could physically move the hard disks from the failed management node to the backup management node, and bring up the backup management node, then both the operating system and xCAT data will be identical between the new management node and the failed management node. RAID1 or disk mirroring could be used to avoid the disk be a single point of failure. @@ -40,7 +40,7 @@ The configuration for the high availability applications is usually complex, it **3\. Maintenance effort** -The automatic failover brings in several high availability applications, after the initial configuration is done, additional maintenance effort will be needed. For example, taking care of the high availability applications during cluster update, the updates for the high availability applications themselves, trouble shooting any problems with the high availability applications. A simple question may be able to help you to decide: could you get technical support if some of the high availability applications run into problems? All software has bugs. +The automatic failover brings in several high availability applications, after the initial configuration is done, additional maintenance effort will be needed. For example, taking care of the high availability applications during cluster update, the updates for the high availability applications themselves, troubleshooting any problems with the high availability applications. A simple question may be able to help you to decide: could you get technical support if some of the high availability applications run into problems? All software has bugs. Configuration Options ===================== diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst index 766580dad..91f9c6cd9 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst @@ -31,7 +31,7 @@ Configuration Requirements #. Since the management node needs to provide IP services through broadcast such as DHCP to the compute nodes, the primary management node and standby management node should be in the same subnet to ensure the network services will work correctly after failover. -#. Network connections between the two management nodes: there are several networks defined in the general cluster configuration strucutre, like cluster network, management network and service network; the two management nodes should be in all of these networks(if exist at all). Besides that, it is recommended, though not strictly required, to use a direct, back-to-back, Gigabit Ethernet or higher bandwidth connection for the DRBD, Pacemaker and Corosync communication between the two management nodes. If the connection is run over switches, use of redundant components and the bonding driver (in active-backup mode) is recommended. +#. Network connections between the two management nodes: there are several networks defined in the general cluster configuration structure, like cluster network, management network and service network; the two management nodes should be in all of these networks(if exist at all). Besides that, it is recommended, though not strictly required, to use a direct, back-to-back, Gigabit Ethernet or higher bandwidth connection for the DRBD, Pacemaker and Corosync communication between the two management nodes. If the connection is run over switches, use of redundant components and the bonding driver (in active-backup mode) is recommended. ``Note``: A crossover Ethernet cable is required to setup the direct, back-to-back, Ethernet connection between the two management nodes, but with most of the current hardware, a normal Ethernet cable can also work, the Ethernet adapters will internally handle the crossover bit. Hard disk for DRBD: DRBD device can be setup on a partition of the disk that the operating system runs on, but it is recommended to use a separate standalone disk or RAID/Multipath disk for DRBD configuration. @@ -63,7 +63,7 @@ You have several options to get the RPM packages for ``DRBD``, ``drbdlinks``, `` #. Compile from source code: if none of the options work for some specific applications, you will have to compile RPMs from the source code. You can compile these packages on one of the management node or on a separate build machine with the same arch and operating system with the management nodes. Here are the instructions for compiling the RPM packages from source code: -Before compiling the RPM packages, you need to install some compling tools like gcc, make, glibc, rpm-build. :: +Before compiling the RPM packages, you need to install some compiling tools like gcc, make, glibc, rpm-build. :: yum groupinstall "Development tools" yum install libxslt libxslt-devel @@ -402,13 +402,13 @@ Configure DRBD [>....................] sync'ed: 0.5% (101932/102400)M finish: 2:29:06 speed: 11,644 (11,444) K/sec - If a direct, back-to-back Gigabyte Ethernet connection is setup between the two management nodes and you are unhappy with the syncronization speed, it is possible to speed up the initial synchronization through some tunable parameters in DRBD. This setting is not permanent, and will not be retained after boot. For details, see http://www.drbd.org/users-guide-emb/s-configure-sync-rate.html. :: + If a direct, back-to-back Gigabyte Ethernet connection is setup between the two management nodes and you are unhappy with the synchronization speed, it is possible to speed up the initial synchronization through some tunable parameters in DRBD. This setting is not permanent, and will not be retained after boot. For details, see http://www.drbd.org/users-guide-emb/s-configure-sync-rate.html. :: drbdadm disk-options --resync-rate=110M xCAT #. Create file system on DRBD device and mount the file system - Even while the DRBD sync is taking place, you can go ahead and create a filesystem on the DRBD device, but it is recommended to wait for the inital full synchronization is finished before creating the file system. + Even while the DRBD sync is taking place, you can go ahead and create a filesystem on the DRBD device, but it is recommended to wait for the initial full synchronization is finished before creating the file system. After the initial full synchronization is finished, you can take the DRBD device as a normal disk partition to create file system and mount it to some directory. The DRDB device name is set in the ``/etc/drbd.d/xcat.res`` created in the previous step. In this doc, the DRBD device name is ``/dev/drbd1``. :: @@ -964,7 +964,7 @@ At this point, the HA MN Setup is complete, and customer workloads and system ad Failover ======== -There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintainance activities; the unplanned failover covers the unexpected hardware or software failures. +There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintenance activities; the unplanned failover covers the unexpected hardware or software failures. In a planned failover, you can do necessary cleanup work on the previous primary management node before failover to the previous standby management node. In a unplanned failover, the previous management node probably is not functioning at all, you can simply shutdown the system. @@ -1009,7 +1009,7 @@ To avoid this, run the following command to set the autostart for the corosync s Backup working Pacemaker configuration (Optional) ================================================= -It is a good practice to backup the working ``pacemaker`` configuration, the backup could be in both plain text format or XML format, the plain text is more easily editable and can be modified and used chunk by chunk, the xml can be used to do a full replacement restore. It will be very useful to make such a backup everytime before you make a change. +It is a good practice to backup the working ``pacemaker`` configuration, the backup could be in both plain text format or XML format, the plain text is more easily editable and can be modified and used chunk by chunk, the xml can be used to do a full replacement restore. It will be very useful to make such a backup every time before you make a change. To backup in the plain text format, run the following command: :: @@ -1182,7 +1182,7 @@ Trouble shooting and debug tips Disable HA MN ============= -For whatever reason, the user might want to disable HA MN, here is the procedur of disabling HA MN: +For whatever reason, the user might want to disable HA MN, here is the procedure of disabling HA MN: * Shut down standby management node @@ -1245,7 +1245,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster push cib xcat_cfg -We then need to make sure that the ``/xCATdrbd/etc/drbdlinks.xCAT.conf`` file has the systemimager portion uncommented, and re-do the initialisation of drbdlinks as they have been done earlier in the documentation +We then need to make sure that the ``/xCATdrbd/etc/drbdlinks.xCAT.conf`` file has the systemimager portion uncommented, and re-do the initialization of drbdlinks as they have been done earlier in the documentation Appendix A ========== @@ -1428,7 +1428,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster cib-push xcat_cfg -Once the changes have been commited, we can view the config, by running the command below: :: +Once the changes have been committed, we can view the config, by running the command below: :: pcs config @@ -1640,7 +1640,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster cib-push xcat_cfg -Once the changes have been commited, we can view the config, by running the command below: :: +Once the changes have been committed, we can view the config, by running the command below: :: pcs config 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 6a3e1b98a..3eff968e6 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 @@ -18,9 +18,9 @@ The nfs service on the primary management node or the primary management node it What is Shared Data ==================== -The term ``Shared Data`` means that the two management nodes use a single copy of xCAT data, no matter which management node is the primary MN, the cluster management capability is running on top of the single data copy. The acess to the data could be done through various ways like shared storage, NAS, NFS, samba etc. Based on the protocol being used, the data might be accessable only on one management node at a time or be accessable on both management nodes in parellel. If the data could only be accessed from one management node, the failover process need to take care of the data access transition; if the data could be accessed on both management nodes, the failover does not need to consider the data access transition, it usually means the failover process could be faster. +The term ``Shared Data`` means that the two management nodes use a single copy of xCAT data, no matter which management node is the primary MN, the cluster management capability is running on top of the single data copy. The access to the data could be done through various ways like shared storage, NAS, NFS, samba etc. Based on the protocol being used, the data might be accessible only on one management node at a time or be accessible on both management nodes in parallel. If the data could only be accessed from one management node, the failover process need to take care of the data access transition; if the data could be accessed on both management nodes, the failover does not need to consider the data access transition, it usually means the failover process could be faster. -``Warning``: Running database through network file system has a lot of potential problems and is not practical, however, most of the database system provides database replication feature that can be used to synronize the database between the two management nodes +``Warning``: Running database through network file system has a lot of potential problems and is not practical, however, most of the database system provides database replication feature that can be used to synchronize the database between the two management nodes Configuration Requirements ========================== @@ -248,7 +248,7 @@ Besides the files mentioned above, there may be some additional customization fi ``Note``: If the IBM HPC software stack is configured in your environment, execute additional steps required to copy additional data or configuration files for HAMN setup. -The dhcpsd.cnf should be syncronized between the primary management node and standby management node only when the DHCP configuration on the two management nodes are exactly the same. +The dhcpsd.cnf should be synchronized between the primary management node and standby management node only when the DHCP configuration on the two management nodes are exactly the same. Cluster Maintenance Considerations ================================== @@ -268,7 +268,7 @@ At this point, the HA MN Setup is complete, and customer workloads and system ad Failover ======== -There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintainance activities; the unplanned failover covers the unexpected hardware or software failures. +There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintenance activities; the unplanned failover covers the unexpected hardware or software failures. In a planned failover, you can do necessary cleanup work on the previous primary management node before failover to the previous standby management node. In a unplanned failover, the previous management node probably is not functioning at all, you can simply shutdown the system. @@ -367,7 +367,7 @@ On the new primary management node: **DNS**: run ``makedns``. Verify dns services working for node resolution. Make sure the line ``nameserver=`` is in ``/etc/resolv.conf``. - **DHCP**: if the dhcpd.leases is not syncronized between the primary management node and standby management node, run ``makedhcp -a`` to setup the DHCP leases. Verify dhcp is operational. + **DHCP**: if the dhcpd.leases is not synchronized between the primary management node and standby management node, run ``makedhcp -a`` to setup the DHCP leases. Verify dhcp is operational. **conserver**: run makeconservercf. This will recreate the ``/etc/conserver.cf`` config files for all the nodes. diff --git a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst index d30fc59db..768395548 100644 --- a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst +++ b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst @@ -15,4 +15,4 @@ Appendix B: Diagnostics * **Errors running hierarchical commands such as xdsh** -- xCAT has a number of commands that run hierarchically. That is, the commands are sent from xcatd on the management node to the correct service node xcatd, which in turn processes the command and sends the results back to xcatd on the management node. If a hierarchical command such as xcatd fails with something like "Error: Permission denied for request", check ``/var/log/messages`` on the management node for errors. One error might be "Request matched no policy rule". This may mean you will need to add policy table entries for your xCAT management node and service node. -* **/install is not mounted on service node from managemen mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` +* **/install is not mounted on service node from management mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` diff --git a/docs/source/advanced/hierarchy/databases/postgres_configure.rst b/docs/source/advanced/hierarchy/databases/postgres_configure.rst index 52db88e00..039b6c001 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_configure.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_configure.rst @@ -33,4 +33,4 @@ Restart PostgreSQL after editing the file: :: For more information about changing the ``pg_hab.conf`` file and ``postgresql.conf`` files, see the following documentation: -`Setup the PostgreSQL Configuraion Files `_ +`Setup the PostgreSQL Configuration Files `_ diff --git a/docs/source/advanced/hierarchy/define_service_node.rst b/docs/source/advanced/hierarchy/define_service_node.rst index dba32462c..6c5b5b3ef 100644 --- a/docs/source/advanced/hierarchy/define_service_node.rst +++ b/docs/source/advanced/hierarchy/define_service_node.rst @@ -179,7 +179,7 @@ compute node is rebooted or the compute node is explicitly moved to another SN using the `snmove `_ command. To use Service Node pools, you need to architect your network such that all of -the compute nodes and service nodes in a partcular pool are on the same flat +the compute nodes and service nodes in a particular pool are on the same flat network. If you don't want the management node to respond to manage some of the compute nodes, it shouldn't be on that same flat network. The site, dhcpinterfaces attribute should be set such that the SNs' DHCP daemon diff --git a/docs/source/advanced/kit/custom/build/createkit.rst b/docs/source/advanced/kit/custom/build/createkit.rst index 4061fbef4..fbb0e6118 100644 --- a/docs/source/advanced/kit/custom/build/createkit.rst +++ b/docs/source/advanced/kit/custom/build/createkit.rst @@ -112,7 +112,7 @@ minor version can be support following format: :: **kitpackage** --- This stanza defines Kit Package (ie. RPM). There can be zero or more kitpackage stanzas. For multiple package supports, need to #. Define one kitpackage section per supported OS. or - #. Define one kitpacakge stanza which contains multiple kitrepoid lines. For the RPM packages, users need to responsible for createing an RPM spec file that can run on multiple OSes. + #. Define one kitpacakge stanza which contains multiple kitrepoid lines. For the RPM packages, users need to responsible for creating an RPM spec file that can run on multiple OSes. :: diff --git a/docs/source/advanced/kit/custom/introduction.rst b/docs/source/advanced/kit/custom/introduction.rst index 4c847687e..febb1dbde 100644 --- a/docs/source/advanced/kit/custom/introduction.rst +++ b/docs/source/advanced/kit/custom/introduction.rst @@ -49,7 +49,7 @@ Kit Framework With time, the implementation of the xCAT Software Kit support may change. -In order to process a kit successfully, the kit must be conpatiable with the level of xCAT code that was used to build the kit. The xCAT kit commands and software kits contain the framework version and compatiable supported versions. +In order to process a kit successfully, the kit must be compatible with the level of xCAT code that was used to build the kit. The xCAT kit commands and software kits contain the framework version and compatible supported versions. To view the framework version, use the ``-v | --version`` option on :doc:`addkit ` :: @@ -59,7 +59,7 @@ To view the framework version, use the ``-v | --version`` option on :doc:`addkit compatible_frameworks = 0,1,2 -If the commands in the xCAT installation is not compatiable with the Software Kit obtained, update xCAT to a more recent release. +If the commands in the xCAT installation is not compatible with the Software Kit obtained, update xCAT to a more recent release. .. [#] PCM is IBM Platform Cluster Manager diff --git a/docs/source/advanced/kit/custom/using/addkitcomp.rst b/docs/source/advanced/kit/custom/using/addkitcomp.rst index f716770b8..0c396cf4b 100644 --- a/docs/source/advanced/kit/custom/using/addkitcomp.rst +++ b/docs/source/advanced/kit/custom/using/addkitcomp.rst @@ -14,7 +14,7 @@ To check if a kitcomponent is valid for an existing OS image definition run the chkkitcomp -i -If the kit component is compatible then add the kitcomponent to the OS image defintion using the addkitcomp command. :: +If the kit component is compatible then add the kitcomponent to the OS image definition using the addkitcomp command. :: addkitcomp -a -i @@ -34,7 +34,7 @@ The contents of the kit component may be listed by using the lskitcomponent comm Adding Multiple Versions of the Same Kit Component to an OS Image Definition ````````````````````````````````````````````````````````````````````````````` -xCAT allows to have multiple versions/releases of a product software kit available in the cluster. Typically, different OS image definitions corresponding to the different versions/releases of a product software stack. However, in some instances, may need mulitple versions/releases of the same product available within a single OS image. This is only feasible if the software product supports the install of multiple versions or releases of its product within an OS image. +xCAT allows to have multiple versions/releases of a product software kit available in the cluster. Typically, different OS image definitions corresponding to the different versions/releases of a product software stack. However, in some instances, may need multiple versions/releases of the same product available within a single OS image. This is only feasible if the software product supports the install of multiple versions or releases of its product within an OS image. Currently, it is not possible to install multiple versions of a product into an OS image using xCAT commands. xCAT uses yum on RedHat and zypper on SLES to install product rpms. These package managers do not provide an interface to install different versions of the same package, and will always force an upgrade of the package. We are investigating different ways to accomplish this function for future xCAT releases. diff --git a/docs/source/advanced/kit/hpc/quickstart.rst b/docs/source/advanced/kit/hpc/quickstart.rst index d76814907..74b8d83e4 100644 --- a/docs/source/advanced/kit/hpc/quickstart.rst +++ b/docs/source/advanced/kit/hpc/quickstart.rst @@ -77,7 +77,7 @@ The following software kits will be used to install the IBM HPC software stack o The ESSL software kit has an *external dependency* to the ``libxlf`` which is provided in the XLF software kit. Since it's already added in the above step, there is no action needed here. - If CUDA toolkit is being used, ESSL has a runtime dependency on the CUDA rpms. The adminstrator needs to create the repository for the CUDA 7.5 toolkit or a runtime error will occur when provisioning the node. See the :doc:`/advanced/gpu/nvidia/repo/index` section for more details about setting up the CUDA repository on the xCAT management node. :: + If CUDA toolkit is being used, ESSL has a runtime dependency on the CUDA rpms. The administrator needs to create the repository for the CUDA 7.5 toolkit or a runtime error will occur when provisioning the node. See the :doc:`/advanced/gpu/nvidia/repo/index` section for more details about setting up the CUDA repository on the xCAT management node. :: # # Assuming that the cuda repo has been configured at: @@ -101,7 +101,7 @@ The following software kits will be used to install the IBM HPC software stack o addkitcomp -a -i rhels7.2-ppc64le-install-compute \ essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le - If the system doesn't have GPU and the CUDA toolkit is not needed, the adminstrator should not add the following kit components that requires the CUDA packages: ``essl-loginnode-5.4.0-0-rhels-7.2-ppc64le``, ``essl-computenode-3264rte-5.4.0-0-rhels-7.2-ppc64le`` and ``essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le``. Check the ESSL installation guide: http://www.ibm.com/support/knowledgecenter/SSFHY8_5.4.0/com.ibm.cluster.essl.v5r4.essl300.doc/am5il_xcatinstall.htm + If the system doesn't have GPU and the CUDA toolkit is not needed, the administrator should not add the following kit components that requires the CUDA packages: ``essl-loginnode-5.4.0-0-rhels-7.2-ppc64le``, ``essl-computenode-3264rte-5.4.0-0-rhels-7.2-ppc64le`` and ``essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le``. Check the ESSL installation guide: http://www.ibm.com/support/knowledgecenter/SSFHY8_5.4.0/com.ibm.cluster.essl.v5r4.essl300.doc/am5il_xcatinstall.htm #. Add the **Parallel ESSL** kitcomponents to osimage. diff --git a/docs/source/advanced/mixed_cluster/building_stateless_images.rst b/docs/source/advanced/mixed_cluster/building_stateless_images.rst index 7d1145095..4c9f9a344 100644 --- a/docs/source/advanced/mixed_cluster/building_stateless_images.rst +++ b/docs/source/advanced/mixed_cluster/building_stateless_images.rst @@ -1,7 +1,7 @@ Building Stateless/Diskless Images ================================== -A **stateless**, or **diskless**, provisioned nodes is one where the operating system image is deployed and loaded into memory. The Operating System (OS) does not store its files directly onto persistent storage (i.e hard disk drive, shared drive, usb, etc) and so subsequent rebooting of the machine results in loss of any state changes that happened while the machine was running. +A **stateless**, or **diskless**, provisioned nodes is one where the operating system image is deployed and loaded into memory. The Operating System (OS) does not store its files directly onto persistent storage (i.e. hard disk drive, shared drive, usb, etc) and so subsequent rebooting of the machine results in loss of any state changes that happened while the machine was running. To deploy stateless compute nodes, you must first create a stateless image. The "netboot" osimages created from ``copycds`` in the **osimage** table are sample osimage definitions that can be used for deploying stateless nodes. diff --git a/docs/source/advanced/networks/infiniband/firmware_updates.rst b/docs/source/advanced/networks/infiniband/firmware_updates.rst index a963c3356..e3d5f6c59 100644 --- a/docs/source/advanced/networks/infiniband/firmware_updates.rst +++ b/docs/source/advanced/networks/infiniband/firmware_updates.rst @@ -21,7 +21,7 @@ Burn new firmware on each ibaX: :: mstflint -d 0002:01:00.0 -i b -Note: if this is a PureFlex MezzanineP adapater then you must select the correct image for each ibaX device. Note the difference in the firmware image at end of filename: _0.bin (iba0/iba2) & _1.bin (iba1/iba3) +Note: if this is a PureFlex MezzanineP adapter then you must select the correct image for each ibaX device. Note the difference in the firmware image at end of filename: _0.bin (iba0/iba2) & _1.bin (iba1/iba3) Verify download successful: :: diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst index 5658f2d1b..8a3a5a75c 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst @@ -1,7 +1,7 @@ Mellanox OFED Installation Script ================================= -Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provids a sample postscript: ``mlnxofed_ib_install.v2``. +Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install.v2``. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst index 610dd6384..96f263e4a 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst @@ -18,7 +18,7 @@ Diskful Installation chdef -t node -o \ -p postscripts="mlnxofed_ib_install -p /install//" - **[kernel mismatch issue]** The Mellanox OFED ISO is built againt a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: chdef -t node -o \ -p postscripts="mlnxofed_ib_install -p /install// \ @@ -42,4 +42,4 @@ Diskful Installation * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. + * Use the ``ibv_devinfo`` command to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst index 36af543e7..3af2cb177 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst @@ -28,7 +28,7 @@ Diskless Installation *Note: The $1 is a argument that is passed to the the postinstall script at runtime.* - **[kernel mismatch issue]** The Mellanox OFED ISO is built againt a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: /install/postscripts/mlnxofed_ib_install \ -p /install// -m --add-kernel-support -end- \ @@ -62,4 +62,4 @@ Diskless Installation * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. + * Use the ``ibv_devinfo`` command to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst index 929bdf674..48e40f8a2 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst @@ -22,7 +22,7 @@ The ``mlnxofed_ib_install.v2`` is a sample script intended to assist with the in # ensure the script has execute permission chmod +x /install/postscripts/mlnxofed_ib_install -#. Familarize the options available for the xCAT ``mlnxofed_ib_install`` script. +#. Familiarize the options available for the xCAT ``mlnxofed_ib_install`` script. +---------+------------------+----------------------------------------------------------+ | Option | Required | Description | diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst index fd9bfded6..9849d2091 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst @@ -1,7 +1,7 @@ MLNX_OFED Support Matrix ======================== -The following ISO images and attributs have been verified by the xCAT Team. +The following ISO images and attributes have been verified by the xCAT Team. **RedHat Enterprise Linux** diff --git a/docs/source/advanced/networks/infiniband/switch_configuration.rst b/docs/source/advanced/networks/infiniband/switch_configuration.rst index 58e50e0ad..ab6bdf5ae 100644 --- a/docs/source/advanced/networks/infiniband/switch_configuration.rst +++ b/docs/source/advanced/networks/infiniband/switch_configuration.rst @@ -66,7 +66,7 @@ Then run the following: :: Setup syslog on the Switch -------------------------- -Use the following command to consolidate the syslog to the Management Node or Service Nodes, where ip is the addess of the MN or SN as known by the switch. :: +Use the following command to consolidate the syslog to the Management Node or Service Nodes, where ip is the address of the MN or SN as known by the switch. :: rspconfig mswitch logdest= diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst index 8fa31ee71..e0d132dfb 100644 --- a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst @@ -12,7 +12,7 @@ xCAT provides support for detecting and installing the Cumulus Linux OS into ONI The mac address of the switch management port is required for xCAT to configure the DHCP information and send over the OS to install on the switch. - **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch defintion providing the mac address. :: + **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch definition providing the mac address. :: mkdef frame01sw1 --template onieswitch arch=armv71 \ ip=192.168.1.1 mac="aa:bb:cc:dd:ee:ff" @@ -32,7 +32,7 @@ xCAT provides support for detecting and installing the Cumulus Linux OS into ONI ip=192.168.4.1 switch=coresw1 switchport=4 ... - #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined swtiches above. :: + #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined switches above. :: switchdiscover --range diff --git a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst index d2b9df8b7..356132d7f 100644 --- a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst +++ b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst @@ -155,7 +155,7 @@ These two config files are located in the **/opt/xcat/share/xcat/scripts** direc Switch Status ~~~~~~~~~~~~~ -During the switch-based switch discovery process, there are four states displayed. User may only see **switch_configed** status on node definition if discovery process succefully finished. +During the switch-based switch discovery process, there are four states displayed. User may only see **switch_configed** status on node definition if discovery process successfully finished. **Matched** --- Discovered switch is matched to predefine switch, **otherinterfaces** attribute is updated to dhcp IP address, and mac address, **switch type** and **usercomment** also updated with vendor information for the predefined switch. diff --git a/docs/source/advanced/networks/vlan/vlan.rst b/docs/source/advanced/networks/vlan/vlan.rst index 0e3e3840c..813f2fc60 100644 --- a/docs/source/advanced/networks/vlan/vlan.rst +++ b/docs/source/advanced/networks/vlan/vlan.rst @@ -206,7 +206,7 @@ There is no need to specify -i flag for removing nodes from a vlan. Remove a VLAN ------------- -The **rmvlan** command removes the given vlan ID from the cluster. It removes the vlan id from all the swithces involved, deconfigures the nodes so that vlan adaptor (tag) will be remved, cleans up /etc/hosts, DNS and database tables for the given vlan. +The **rmvlan** command removes the given vlan ID from the cluster. It removes the vlan id from all the switches involved, deconfigures the nodes so that vlan adaptor (tag) will be removed, cleans up /etc/hosts, DNS and database tables for the given vlan. For example: :: @@ -215,7 +215,7 @@ For example: :: VLAN Security ------------- -To make the vlan more secure, the root guard and the bpdu guard are enabled for each ports within the vlan by **mkvlan** and **chvlan** commands. This way it guards the topology changes on the switch by the hackers who hack the STP. However, when the vlan is removed by the **rmvlan** and the **chvlan (-d)** commands, the root guard and the bpdu guard are not disabled because the code cannot tell if the guards were enabled by the admin or not. If you want to remove the gurads after the vlan is removed, you need to use the switch command line interface to do so. Refer to the documents for the switch command line interfaces for details. +To make the vlan more secure, the root guard and the bpdu guard are enabled for each ports within the vlan by **mkvlan** and **chvlan** commands. This way it guards the topology changes on the switch by the hackers who hack the STP. However, when the vlan is removed by the **rmvlan** and the **chvlan (-d)** commands, the root guard and the bpdu guard are not disabled because the code cannot tell if the guards were enabled by the admin or not. If you want to remove the guards after the vlan is removed, you need to use the switch command line interface to do so. Refer to the documents for the switch command line interfaces for details. Limitation ---------- diff --git a/docs/source/advanced/probe/osdeploy.rst b/docs/source/advanced/probe/osdeploy.rst index 546d33198..c9a36f2f1 100644 --- a/docs/source/advanced/probe/osdeploy.rst +++ b/docs/source/advanced/probe/osdeploy.rst @@ -76,7 +76,7 @@ When all the nodes complete provisioning, the probe will exit and display output All nodes provisioned successfully [ OK ] -If there is something wrong when provisioning, this probe will exit when timeout is reachedd or ``Ctrl+C`` is pressed by user. The maximum time can be set by using ``-t`` as below(default 30 minutes) :: +If there is something wrong when provisioning, this probe will exit when timeout is reached or ``Ctrl+C`` is pressed by user. The maximum time can be set by using ``-t`` as below(default 30 minutes) :: xcatprobe osdeploy -n cn1 -t 30 diff --git a/docs/source/advanced/raid/hardware_raid.rst b/docs/source/advanced/raid/hardware_raid.rst index d6e0f3c8e..915f2b241 100644 --- a/docs/source/advanced/raid/hardware_raid.rst +++ b/docs/source/advanced/raid/hardware_raid.rst @@ -18,7 +18,7 @@ Following sections show how to use ``diskdiscover`` and ``configraid``, we assum Discovering disk devices ------------------------ -Command ``diskdiscover`` scans disk devices, it can get the overview of disks and RAID arrays information from compute node; The outputs contain useful information for ``configraid`` to configure RAID arrays, user can get ``pci_id``, ``pci_slot_name``, ``disk names``, ``RAID arrays`` and other informations from the outputs. It should be ran in xcat genesis system. It can be executed without input parameter or with pci_id, pci_id includes PCI vendor and device ID. For example, power8 SAS adapter pci_id is ``1014:034a``, ``1014`` is vendor info, ``034a`` is PCI-E IPR SAS Adapter, more info about pci_id refer to ``http://pci-ids.ucw.cz/read/PC/1014/``. +Command ``diskdiscover`` scans disk devices, it can get the overview of disks and RAID arrays information from compute node; The outputs contain useful information for ``configraid`` to configure RAID arrays, user can get ``pci_id``, ``pci_slot_name``, ``disk names``, ``RAID arrays`` and other information from the outputs. It should be ran in xcat genesis system. It can be executed without input parameter or with pci_id, pci_id includes PCI vendor and device ID. For example, power8 SAS adapter pci_id is ``1014:034a``, ``1014`` is vendor info, ``034a`` is PCI-E IPR SAS Adapter, more info about pci_id refer to ``http://pci-ids.ucw.cz/read/PC/1014/``. Here are steps to use ``diskdiscover``: diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index 1953a18ba..d2cf1f937 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -15,7 +15,7 @@ POST - Create a token. **Example:** -Aquire a token for user 'root'. :: +Acquire a token for user 'root'. :: #curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}' @@ -62,8 +62,8 @@ Get all the node names from xCAT database. :: [URI:/nodes/{noderange}] - The node resource -------------------------------------------- -GET - Get all the attibutes for the node {noderange}. -````````````````````````````````````````````````````` +GET - Get all the attributes for the node {noderange}. +`````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes. @@ -75,7 +75,7 @@ Refer to the man page: :doc:`lsdef ` @@ -101,7 +101,7 @@ Refer to the man page: :doc:`chdef ` @@ -597,8 +597,8 @@ Get all the vitails attributes for the node1. :: [URI:/nodes/{noderange}/vitals/{temp|voltage|wattage|fanspeed|power|leds...}] - The specific vital attributes for the node {noderange} -------------------------------------------------------------------------------------------------------------------------------------- -GET - Get the specific vitals attibutes. -```````````````````````````````````````` +GET - Get the specific vitals attributes. +````````````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -628,8 +628,8 @@ Get the 'fanspeed' vitals attribute. :: [URI:/nodes/{noderange}/inventory] - The inventory attributes for the node {noderange} -------------------------------------------------------------------------------------- -GET - Get all the inventory attibutes. -`````````````````````````````````````` +GET - Get all the inventory attributes. +``````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -659,8 +659,8 @@ Get all the inventory attributes for node1. :: [URI:/nodes/{noderange}/inventory/{pci|model...}] - The specific inventory attributes for the node {noderange} -------------------------------------------------------------------------------------------------------------- -GET - Get the specific inventory attibutes. -``````````````````````````````````````````` +GET - Get the specific inventory attributes. +```````````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -714,7 +714,7 @@ Refer to the man page: :doc:`reventlog ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -947,7 +947,7 @@ Refer to the man page: :doc:`chvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example1:** @@ -982,7 +982,7 @@ Refer to the man page: :doc:`mkvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -1003,7 +1003,7 @@ Refer to the man page: :doc:`rmvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -1112,7 +1112,7 @@ Refer to the man page: :doc:`copycds ` @@ -1173,7 +1173,7 @@ Refer to the man page: :doc:`chdef ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example1:** @@ -1284,7 +1284,7 @@ Refer to the man page: :doc:`rmimage ` @@ -1385,7 +1385,7 @@ Refer to the man page: :doc:`chdef ` @@ -1648,7 +1648,7 @@ Refer to the man page: :doc:`lsdef ` @@ -1668,7 +1668,7 @@ Refer to the man page: :doc:`chdef /xcat-core.git (fetch) diff --git a/docs/source/developers/github/pull_request.rst b/docs/source/developers/github/pull_request.rst index b5273cb26..80593db5e 100644 --- a/docs/source/developers/github/pull_request.rst +++ b/docs/source/developers/github/pull_request.rst @@ -65,7 +65,7 @@ During the reviewing of your pull request, another pull request may be merged wh $ git push origin -f -If all the conflicts are resolved, the pull request should automaically turn green again and is able to be merged automatically. +If all the conflicts are resolved, the pull request should automatically turn green again and is able to be merged automatically. Reviewing Pull Requests as a Maintainer --------------------------------------- diff --git a/docs/source/developers/guides/code/builds.rst b/docs/source/developers/guides/code/builds.rst index 7afb55b1b..28aba3d02 100644 --- a/docs/source/developers/guides/code/builds.rst +++ b/docs/source/developers/guides/code/builds.rst @@ -37,7 +37,7 @@ The following steps will help configure ``pod2rst`` and be able to generate the make make install - * **[as non-root]** Extrat and build the Perl module using PREFIX to specify a directory that you have write permission :: + * **[as non-root]** Extract and build the Perl module using PREFIX to specify a directory that you have write permission :: mkdir ~/perllib perl Makefile.PL PREFIX=~/perllib diff --git a/docs/source/developers/guides/docs/doc_guidelines.rst b/docs/source/developers/guides/docs/doc_guidelines.rst index 0a245fe01..4e13e7b1c 100644 --- a/docs/source/developers/guides/docs/doc_guidelines.rst +++ b/docs/source/developers/guides/docs/doc_guidelines.rst @@ -65,7 +65,7 @@ Enumerated List Include another file -------------------- -To add contents of a document file inside another file, use ``.. include::``. This is usefull when a common information needs to be displayed in multiple files, whithout the use of a hyperlink. +To add contents of a document file inside another file, use ``.. include::``. This is useful when a common information needs to be displayed in multiple files, without the use of a hyperlink. :: .. include:: config_common.rst @@ -76,14 +76,14 @@ To add contents of a document file inside another file, use ``.. include::``. Th Index file ---------- -Index.rst files contain the ``.. toctree::`` tag. Files listed under that tag will have links to them displayed in the left side navigation area. If a documentation file does not wish to be accessbile from the navigation area, do not list it under the ``.. toctree::``. +Index.rst files contain the ``.. toctree::`` tag. Files listed under that tag will have links to them displayed in the left side navigation area. If a documentation file does not wish to be accessible from the navigation area, do not list it under the ``.. toctree::``. ``Note:`` If a file is not listed under the ``.. toctree::`` it might generate a warning during the documentation build ``WARNING: document isn't included in any toctree``. To eliminate such warning, add the file to the ``exclude_patterns`` list in the ``docs/source/conf.py`` file. However, do not add a file to the ``exclude_patterns`` list if it contains a customized link target, such as ``.. _my_link_taget:``. This link target will not be visible to other files and a ``WARNING: undefined label:`` will be displayed during the documentation build. Hyperlinks -> Internal Links -> External Links ---------------------------------------------- -Add links to refer other web page is a very common way in writting document, it's very helpful to reduce the doc duplication and make docs easy to understand. Following are several ways to add a link in the xCAT documentation. +Add links to refer other web page is a very common way in writing document, it's very helpful to reduce the doc duplication and make docs easy to understand. Following are several ways to add a link in the xCAT documentation. * **Add an Internal Link to ``Customized Link Target``** diff --git a/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst b/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst index b8928ff7e..c94c576a2 100644 --- a/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst +++ b/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst @@ -6,7 +6,7 @@ Description The definition of physical units in the cluster, such as lpar, virtual machine, frame, cec, hmc, switch. -Key Attrubutes +Key Attributes -------------- * os: @@ -16,7 +16,7 @@ Key Attrubutes The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64. * groups: - Usually, there are a set of nodes with some attributes in common, xCAT admin can define a node group containing these nodes, so that the management task can be issued against the group instead of individual nodes. A node can be a memeber of different groups, so the value of this attributes is a comma-delimited list of groups. At least one group is required to create a node. The new created group names should not be prefixed with "__" as this token has been preserverd as the internal group name. + Usually, there are a set of nodes with some attributes in common, xCAT admin can define a node group containing these nodes, so that the management task can be issued against the group instead of individual nodes. A node can be a member of different groups, so the value of this attributes is a comma-delimited list of groups. At least one group is required to create a node. The new created group names should not be prefixed with "__" as this token has been preserved as the internal group name. * mgt: The method to do general hardware management of the node. This attribute can be determined by the machine type of the node. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst index 273c6c13c..9cc18ec36 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst @@ -1,14 +1,14 @@ Accelerating the diskless initrd and rootimg generating ======================================================== -Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-comsuming process, it can be accelerated by enabling paralell compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix ` for an example on ``packimage`` performance optimized with ``pigz`` enabled. +Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-consuming process, it can be accelerated by enabling parallel compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix ` for an example on ``packimage`` performance optimized with ``pigz`` enabled. Enabling the ``pigz`` for diskless initrd and rootimg generating ---------------------------------------------------------------- -The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. +The parallel compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. * **[RHEL]** @@ -24,7 +24,7 @@ The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` pac ``pigz`` should be installed in the diskless rootimg. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then customize the diskless osimage to install ``pigz`` as the additional packages, see :doc:`Install Additional Other Packages` for more details. - 2) Enabeling the ``pigz`` in ``packimage`` + 2) Enabling the ``pigz`` in ``packimage`` ``pigz`` should be installed on the management server. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then install the ``pigz`` with ``yum`` or ``rpm``. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst index e6cc403e6..99d57a980 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst @@ -70,7 +70,7 @@ These are described in more details in the following sections. RPM Names ''''''''' -A simple otherpkgs.pkglist file just contains the the name of the rpm file without the version numbers. +A simple otherpkgs.pkglist file just contains the name of the rpm file without the version numbers. For example, if you put the following three rpms under **/install/post/otherpkgs///** directory, :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst index 77651f270..dcf8c350b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst @@ -51,7 +51,7 @@ These are described in more details in the following sections. RPM Names '''''''''' -A simple .pkglist file just contains the the name of the rpm file without the version numbers. +A simple .pkglist file just contains the name of the rpm file without the version numbers. For example :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst index 492361fc5..ca1da9738 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst @@ -1,7 +1,7 @@ Configure Additional Network Interfaces - confignics ==================================================== -The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (mutltiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. +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. @@ -78,7 +78,7 @@ By default, confignics does not configure the install nic. if need, using flag " chdef cn1 -p prostscripts="confignics -s" -Option "-s" writes the install nic's information into configuration file for persistance. All install nic's data defined in nics table will be written also. +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. Add network object into the networks table diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst index bd7567600..4a358b41e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst @@ -11,7 +11,7 @@ There are more attributes of nodeset used for some specific purpose or specific * **runcmd**: This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. * **shell**: This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. -Choose such additional attribute of nodeset according to your requirement, if want to get more informantion about nodeset, refer to nodeset's man page. +Choose such additional attribute of nodeset according to your requirement, if want to get more information about nodeset, refer to nodeset's man page. Start the OS Deployment ======================= diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst index 85973cc1c..a6c0765d2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst @@ -38,7 +38,7 @@ In above example, pkglist file is /opt/xcat/share/xcat/netboot/rh/compute.rhels7 Setup pkglist ------------- -Before setting up kdump,the approprite rpms should be added to the pkglist file.Here is the rpm packages list which needs to be added to pkglist file for kdump for different OS. +Before setting up kdump, the appropriate rpms should be added to the pkglist file.Here is the rpm packages list which needs to be added to pkglist file for kdump for different OS. * **[RHEL]** :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst index a5dcf5382..e5886603d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst @@ -1,7 +1,7 @@ Generate Diskless Image ======================= -The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are serveral ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: +The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are several ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: tabdump osimage @@ -18,7 +18,7 @@ The ``netboot-compute`` is the default **diskless** osimage created rhels7.1 ppc Before packing the diskless image, you have the opportunity to change any files in the image by changing to the ``rootimgdir`` and making modifications. (e.g. ``/install/netboot/rhels7.1/ppc64le/compute/rootimg``). -However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable.Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. +However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable. Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. Pack Diskless Image @@ -102,7 +102,7 @@ Skip this section if you want to use the image as is. 1, The use can modify the image to fit his/her own need. The following can be modified. -* Modify .pkglist file to add or remove packges that are from the os distro +* Modify .pkglist file to add or remove packages that are from the os distro * Modify .otherpkgs.pkglist to add or remove packages from other sources. Refer to ``Using_Updatenode`` for details diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst index f212c8691..d3066b65c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst @@ -40,7 +40,7 @@ The ``postinstall`` scripts are executed in step b). Do ``postinstall`` scripts execute in chroot mode under ``rootimgdir`` directory? ````````````````````````````````````````````````````````````````````````````````` -No. Unlike postscripts and postbootscripts, the ``postinstall`` scripts are run in non-chroot environment, directly on the management node. In the postinstall scripts, all the paths of the directories and files are based on ``/`` of the managememnt node. To reference inside the ``rootimgdir``, use the ``$IMG_ROOTIMGDIR`` environment variable, exported by ``genimage``. +No. Unlike postscripts and postbootscripts, the ``postinstall`` scripts are run in non-chroot environment, directly on the management node. In the postinstall scripts, all the paths of the directories and files are based on ``/`` of the management node. To reference inside the ``rootimgdir``, use the ``$IMG_ROOTIMGDIR`` environment variable, exported by ``genimage``. What are some of the environment variables available to my customized ``postinstall`` scripts? `````````````````````````````````````````````````````````````````````````````````````````````` 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 0acea9a4e..752f38412 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 @@ -185,7 +185,7 @@ Here is the RAID1 partitioning section in service.raid1.sles11.tmpl: :: The samples above created one 24MB PReP partition on each disk, one 2GB mirrored swap partition and one mirrored ``/`` partition uses all the disk space. If you want to use different partitioning scheme in your cluster, modify this RAID1 section in the autoyast template file accordingly. -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 the commands needed to make the second disk bootable: :: +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 @@ -230,7 +230,7 @@ The command mdadm can query the detailed configuration for the RAID partitions: Disk Replacement Procedure -------------------------- -If any one disk fails in the RAID1 arrary, 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 and you will be fine. Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: :: @@ -250,7 +250,7 @@ Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: : 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 arrary +Remove the failed disk from RAID array --------------------------------------- ``mdadm`` is the command that can be used to query and manage the RAID arrays on Linux. To remove the failed disk from RAID array, use the command: :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst index 4862d4ed8..d0d18af6f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst @@ -3,7 +3,7 @@ Overview Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes. -This function is supported for diskful or RAMdisk-based diskless nodes.Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. +This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. @@ -17,7 +17,7 @@ For a new-installing nodes, the Syncing File action will be triggered when perfo The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. -**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes.You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** +**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes. You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst index 6ce471eb3..9af8e913f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst @@ -97,7 +97,7 @@ Note: From xCAT 2.9.2 on AIX and from xCAT 2.12 on Linux, xCAT support a new for file -> (noderange for permitted nodes) file -The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specifed before the file name :: +The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specified before the file name :: /etc/hosts -> (node1,node2) /etc/hosts # The /etc/hosts file is synced to node1 and node2 /etc/hosts -> (node1-node4) /etc/hosts # The /etc/hosts file is synced to node1,node2,node3 and node4 diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst index 198ac04e8..e417ca402 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst @@ -51,7 +51,7 @@ The content above presents some syntax supported in exlist file: +./usr/share/locale/C* - It is useful to include files following an exclude entry to qiuckly remove a larger set of files using a wildcard and then adding back the few necessary files using the + sign. In the above example, all the files and sub-directories matching the pattern ``/usr/share/locale/C*`` will be included in the ``rootimg.gz`` file. + It is useful to include files following an exclude entry to quickly remove a larger set of files using a wildcard and then adding back the few necessary files using the + sign. In the above example, all the files and sub-directories matching the pattern ``/usr/share/locale/C*`` will be included in the ``rootimg.gz`` file. Customize the ``exlist`` file and the osimage definition @@ -77,4 +77,4 @@ If you want to customize the osimage ``sles12.1-ppc64le-netboot-compute`` with y .. [1] The ``exlist`` file entry should not end with a slash ``/``, For example, this entry will never match anything: ``./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/``. -.. [2] Pattern match test applies to the whole file name,starting from one of the start points specified in the ``exlist`` file entry. The regex syntax should comply with the regex syntax of system command ``find -path``, refer to its doc for details. +.. [2] Pattern match test applies to the whole file name, starting from one of the start points specified in the ``exlist`` file entry. The regex syntax should comply with the regex syntax of system command ``find -path``, refer to its doc for details. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index cc7a1fc49..f383e065d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -2,7 +2,7 @@ Manage Virtual Machine (VM) ============================ -Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create,remove and clone VMs. +Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs. Create Virtual Machine ---------------------- @@ -117,7 +117,7 @@ Now a VM "vm1" is created, it can be provisioned like any other nodes in xCAT. T rpower vm1 on -If "vm1" is powered on successfully, the VM status can be obtained by running the following command on management node :: +If "vm1" is powered on successfully, the VM status can be obtained by running the following command on management node :: rpower vm1 status diff --git a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst index 67444a2cd..5a505a57b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst @@ -134,6 +134,6 @@ where is a comma separated postscript like ospkgs,otherpkgs etc. * wget is used in xcatdsklspost/xcataixpost to get all the postscripts from the to the node. You can check /tmp/wget.log file on the node to see if wget was successful or not. You need to make sure the /xcatpost directory has enough space to hold the postscripts. * A file called /xcatpost/mypostscript (Linux) is created on the node which contains the environmental variables and scripts to be run. Make sure this file exists and it contains correct info. You can also run this file on the node manually to debug. * For ospkgs/otherpkgs, if /install is not mounted on the , it will download all the rpms from the to the node using wget. Make sure /tmp and /xcatpost have enough space to hold the rpms and check /tmp/wget.log for errors. - * For ospkgs/otherpkgs, If zypper or yum is installed on the node, it will be used the command to install the rpms. Make sure to run createrepo on the source direcory on the every time a rpm is added or removed. Otherwise, the rpm command will be used, in this case, make sure all the necessary depended rpms are copied in the same source directory. + * For ospkgs/otherpkgs, If zypper or yum is installed on the node, it will be used the command to install the rpms. Make sure to run createrepo on the source directory on the every time a rpm is added or removed. Otherwise, the rpm command will be used, in this case, make sure all the necessary depended rpms are copied in the same source directory. * You can append -x on the first line of ospkgs/otherpkgs to get more debug info. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst index 3bacd82b5..7d10ecd29 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst @@ -45,6 +45,10 @@ Configure DHCP to listen on different network interfaces [**Optional**] To set "eth1" and "eth3" on the management node and "bond0" on all nodes in the nodegroup="service", set ``dhcpinterfaces`` using: :: + chdef -t site dhcpinterfaces="eth1,eth3;service|bond0" + + or, to explicitly identify the management node with hostname ``xcatmn``: :: + chdef -t site dhcpinterfaces="xcatmn|eth1,eth3;service|bond0" **noboot** diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst index fde5e5254..c4c998c9e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst @@ -3,12 +3,12 @@ MTMS-based Discovery MTMS stands for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial. This is one way to uniquely identify each physical server. -MTMS-based hardware discovery assumes the administator has the model type and serial number information for the physical servers and a plan for mapping the servers to intended hostname/IP addresses. +MTMS-based hardware discovery assumes the administrator has the model type and serial number information for the physical servers and a plan for mapping the servers to intended hostname/IP addresses. **Overview** #. Automatically search and collect MTMS information from the servers - #. Write **discovered-bmc-nodes** to xCAT (recommened to set different BMC IP address) + #. Write **discovered-bmc-nodes** to xCAT (recommended to set different BMC IP address) #. Create **predefined-compute-nodes** to xCAT providing additional properties #. Power on the nodes which triggers xCAT hardware discovery engine diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst index 5923a32a5..9399c0405 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -1,11 +1,11 @@ -IBM Power LE / OpenPOWER +IBM POWER LE / OpenPOWER ========================= -Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPower servers. +Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPOWER servers. -IBM OpenPower Servers - * based on Power8 Processor Technology is IPMI managed - * based on Power9 Processor Technology is OpenBmc managed [**Alpha**] +IBM OpenPOWER Servers + * based on POWER8 Processor Technology is IPMI managed + * based on POWER9 Processor Technology is OpenBMC managed [**Alpha**] .. toctree:: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 531266228..396880103 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -7,11 +7,11 @@ Most enterprise servers do not have video adapters installed with the machine an Configure the correct console management by modifying the node definition: - * For OpenPower, **IPMI** managed server: :: + * For OpenPOWER, **IPMI** managed server: :: chdef -t node -o cons=ipmi - * For OpenPower, **OpenBMC** managed servers: :: + * For OpenPOWER, **OpenBMC** managed servers: :: chdef -t node -o cons=openbmc @@ -46,7 +46,7 @@ The xCAT ``rcons`` command relies on conserver (http://www.conserver.com/). The OpenBMC Specific -``````````````` +```````````````` #. For OpenBMC managed servers, the root user must be able to ssh passwordless to the BMC for the ``rcons`` function to work. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst index ce44725f0..0e66ab76d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst @@ -20,7 +20,7 @@ The litefile table specifies the directories and files on the statelite nodes th #. The third column in the litefile table specifies options for the directory or file: #. tmpfs - It provides a file or directory for the node to use when booting, its permission will be the same as the original version on the server. In most cases, it is read-write; however, on the next statelite boot, the original version of the file or directory on the server will be used, it means it is non-persistent. This option can be performed on files and directories. - #. rw - Same as Above.Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. + #. rw - Same as above. Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. #. persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted on the local file or directory. Anything written to that file or directory is preserved. It means, if the file/directory does not exist at first, it will be copied to the persistent location. Next time the file/directory in the persistent location will be used. The file/directory will be persistent across reboots. Its permission will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. This option can be performed on files and directories. #. con - The contents of the pathname are concatenated to the contents of the existing file. For this directive the searching in the litetree hierarchy does not stop when the first match is found. All files found in the hierarchy will be concatenated to the file when found. The permission of the file will be "-rw-r--r--", which means it is read-write for the root user, but readonly for the others. It is non-persistent, when the node reboots, all changes to the file will be lost. It can only be performed on files. Do not use it for one directory. #. ro - The file/directory will be overmounted read-only on the local file/directory. It will be located in the directory hierarchy specified in the litetree table. Changes made to this file or directory on the server will be immediately seen in this file/directory on the node. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. This option can be performed on files and directories. @@ -133,5 +133,5 @@ noderes ``noderes.nfsserver`` attribute can be set for the NFSroot server. If this is not set, then the default is the Management Node. -``noderes.nfsdir`` can be set. If this is not set, the the default is ``/install`` +``noderes.nfsdir`` can be set. If this is not set, the default is ``/install`` diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst index 7a00d46e6..214c79607 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst @@ -88,7 +88,7 @@ Fail to ping the installed VM ADDRCONF(NETDEV_UP): eth0 link is not ready. - **Solutoin**: + **Solution**: Usually caused by the incorrect VM NIC model. Try the following steps to specify "virtio": :: rmvm vm1 diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst index e4f0b0b14..63a2df528 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst @@ -16,7 +16,7 @@ Provision Hypervisor #. Customize the hypervisor node definition to create network bridge - xCAT ships a postscript **xHRM** to create a network bridge on kvm host during installation/netbooting. Specify the **xHRM** with appropriate parameters in **postscripts** attibute. For example: + xCAT ships a postscript **xHRM** to create a network bridge on kvm host during installation/netbooting. Specify the **xHRM** with appropriate parameters in **postscripts** attribute. For example: * To create a bridge named 'br0' against the installation network device specified by **installnic**: :: @@ -68,7 +68,7 @@ If the hypervisor is provisioned successfully according to the steps described a br0 8000.000000000000 no eth0 -If the network bridge is not created or configured successfully, run "xHRM" with **updatenode** on managememt node to create it manually::: +If the network bridge is not created or configured successfully, run "xHRM" with **updatenode** on management node to create it manually::: updatenode kvmhost1 -P "xHRM bridgeprereq eth0:br0" diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst index 8b735a1f4..eb33072f8 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst @@ -15,7 +15,7 @@ Please make sure the following packages have been installed on the management no Set Up the kvm storage directory on the management node(optional) ----------------------------------------------------------------- -It is a recommended configuration to create a shared file system for virtual machines hosting. The shared file system, usually on a SAN, NAS or GPFS, is shared among KVM hypevisors, which simplifies VM migration from one hypervisor to another with xCAT. +It is a recommended configuration to create a shared file system for virtual machines hosting. The shared file system, usually on a SAN, NAS or GPFS, is shared among KVM hypervisors, which simplifies VM migration from one hypervisor to another with xCAT. The easiest shared file system is ``/install`` directory on the management node, it can be shared among hypervisors via NFS. Please refer to the following steps : 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 efe3bde5b..7173c39f5 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -35,7 +35,7 @@ DESCRIPTION *********** -The \ **bmcdiscover**\ command will discover Baseboard Management Controllers (BMCs) using a scan mathod. +The \ **bmcdiscover**\ command will discover Baseboard Management Controllers (BMCs) using a scan method. The command uses \ **nmap**\ to scan active nodes over a specified IP range. The IP range format should be a format that is acceptable by \ **nmap**\ . @@ -52,7 +52,7 @@ OPTIONS \ **-**\ **-range**\ - Specify one or more IP ranges acceptable to nmap. IP rance can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. + Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. diff --git a/docs/source/guides/admin-guides/references/man1/cfgve.1.rst b/docs/source/guides/admin-guides/references/man1/cfgve.1.rst index 6de85a9fd..3c53d9b20 100644 --- a/docs/source/guides/admin-guides/references/man1/cfgve.1.rst +++ b/docs/source/guides/admin-guides/references/man1/cfgve.1.rst @@ -98,7 +98,7 @@ OPTIONS be owned by vdsm:kvm. \ **localfs**\ : "/data/images/rhev" is set by default. - \ **virtsd.host**\ - A host must be specified for a storage doamin as SPM + \ **virtsd.host**\ - A host must be specified for a storage domain as SPM (Storage Pool Manager) when initialize the storage domain. The role of SPM may be migrated to other host by rhev-m during the running of the datacenter (For example, when the current SPM encountered issue or going to maintenance diff --git a/docs/source/guides/admin-guides/references/man1/chvm.1.rst b/docs/source/guides/admin-guides/references/man1/chvm.1.rst index 01e9afc33..14b1f28ea 100644 --- a/docs/source/guides/admin-guides/references/man1/chvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/chvm.1.rst @@ -151,7 +151,7 @@ PPC (using Direct FSP Management) specific: For Power 755(use option \ *--p775*\ to specify): -chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. +chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar. @@ -166,7 +166,7 @@ zVM specific: ============= -The chvm command modifes the virtual machine's configuration specified in noderange. +The chvm command modifies the virtual machine's configuration specified in noderange. @@ -336,7 +336,7 @@ VMware/KVM specific: \ **-**\ **-resize**\ \ *disk*\ =\ *size*\ - Change the size of the Hard disk. The disk in \ *qcow2*\ format can not be set to less than it's current size. The disk in \ *raw*\ format can be resized smaller, use caution. Multiple disks can be resized by using comma separated \ *disk*\ \ **=**\ \ *size*\ pairs. The disks are specified by SCSI id. Size defaults to GB. + Change the size of the Hard disk. The disk in \ *qcow2*\ format can not be set to less than its current size. The disk in \ *raw*\ format can be resized smaller, use caution. Multiple disks can be resized by using comma separated \ *disk*\ \ **=**\ \ *size*\ pairs. The disks are specified by SCSI id. Size defaults to GB. diff --git a/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst b/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst index f03df04a2..cd06071a9 100644 --- a/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The commmand will build two xCAT stanza files that can update the xCAT database with the chdef command. +The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The command will build two xCAT stanza files that can update the xCAT database with the chdef command. Copy the csm2xcat command to the CSM Management Server. Run the command, indicating where you want your stanza files saved with the \ **-**\ **-dir**\ parameter. Check the stanza files to see if the information is what you want put in the xCAT database. Copy the two stanza files: node.stanza, device.stanza back to your xCAT Management node, and run the chdef command to input into the xCAT database. diff --git a/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst b/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst index 96b2fad80..2ea1fed24 100644 --- a/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst +++ b/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst @@ -46,7 +46,7 @@ For full information on the setup of DB2, see Setting_Up_DB2_as_the_xCAT_DB. When running of db2sqlsetup on the MN: One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable. -The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overriden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. +The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overridden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. When running db2sqlseutp on the SN: Not only will the password for the DB2 instance Id be prompted for and must match the one on the Management Node; but also the hostname or ip address of the Management Node as known by the Service Node must be supplied , unless the XCATDB2SERVER environment variable is set. diff --git a/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst b/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst index 8dcaedc47..af89c9fef 100644 --- a/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst +++ b/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst @@ -35,7 +35,7 @@ If not using the binary dump option (-b), then the dumpxCATdb command creates .c Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables. The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records. -If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilites for backup of the entire database. +If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilities for backup of the entire database. ******* @@ -49,7 +49,7 @@ OPTIONS \ **-V**\ Verbose. -\ **-a**\ All,without this flag the eventlog and auditlog will be skipped. +\ **-a**\ All, without this flag the eventlog and auditlog will be skipped. \ **-b**\ This flag is only used for the DB2 or postgreSQL database. The routine will use the database backup utilities to create a binary backup of the entire database. Note to use this backup on DB2, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions. diff --git a/docs/source/guides/admin-guides/references/man1/genimage.1.rst b/docs/source/guides/admin-guides/references/man1/genimage.1.rst index 6d0f8adfd..d28fd3880 100644 --- a/docs/source/guides/admin-guides/references/man1/genimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/genimage.1.rst @@ -46,7 +46,7 @@ for stateless: \ **packimage**\ for statelite: \ **liteimg**\ -Besides prompting for some paramter values, the \ **genimage**\ command takes default guesses for the parameters not specified or not defined in the \ *osimage*\ and \ *linuximage*\ tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use \ **-**\ **-interactive**\ flag if you want the yum/zypper command to prompt you for the answers. +Besides prompting for some parameter values, the \ **genimage**\ command takes default guesses for the parameters not specified or not defined in the \ *osimage*\ and \ *linuximage*\ tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use \ **-**\ **-interactive**\ flag if you want the yum/zypper command to prompt you for the answers. If \ **-**\ **-onlyinitrd**\ is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. diff --git a/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst b/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst index ffac5dd95..881fff450 100644 --- a/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst @@ -43,7 +43,7 @@ If the initrd has been rebuilt by geninitrd, when run nodeset, the \ *--noupdate should be used to skip the rebuilding of initrd to improve the performance. Three attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. \ **netdrivers**\ - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -65,7 +65,7 @@ this command is used to generate the initrd from the rootimg which generated by So the 'genimage' must be run once before running the geninitrd command. Two attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. \ **netdrivers**\ - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -79,7 +79,7 @@ Parameters ********** -\ *imagename*\ specifies the name of an os image definition to be used. The specification for the image is storted in the \ *osimage*\ table and \ *linuximage*\ table. +\ *imagename*\ specifies the name of an os image definition to be used. The specification for the image is stored in the \ *osimage*\ table and \ *linuximage*\ table. \ **-**\ **-ignorekernelchk**\ diff --git a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst index 7bd216c97..316f4bcea 100644 --- a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst @@ -31,26 +31,52 @@ DESCRIPTION Traditionally, network interfaces in Linux are enumerated as eth[0123...], but these names do not necessarily correspond to actual labels on the chassis. \ **getadapter**\ help customer to get predictable network device name and some other network adapter information before provision or network configuration. -\ **getadapter**\ use genesis to collect network adapters information, so that mean it need to restart the target node. +\ **Since getadpter uses genesis to collect network adapters information, the target node will be restarted.**\ \ **getadapter**\ For each node within the , follows below scheme: -If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. -If the target node has ever been scaned, \ **getadapter**\ will use the information from nics table first. +If the target node is scanned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. +If the target node has ever been scanned, \ **getadapter**\ will use the information from nics table first. If user hopes to scan the adapter information for the node but these information already exist, \ **-f**\ option can be used to start rescan process. \ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. -Below are the possible information can be collect up to now: + +****************************** +\ **Collected information:**\ +****************************** + + + \ **name**\ : the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7 + + + \ **pci**\ : the pci location + + + \ **mac**\ : the MAC address + + + \ **candidatename**\ : All the names which satisfy predictable network device naming scheme. \ *(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)*\ + + + \ **vender**\ : the vender of network device + + + \ **model**\ : the model of network device + + + \ **linkstate**\ : the link state of network device + + ******* OPTIONS ******* diff --git a/docs/source/guides/admin-guides/references/man1/getmacs.1.rst b/docs/source/guides/admin-guides/references/man1/getmacs.1.rst index 05bfd6ff0..a38bc1abf 100644 --- a/docs/source/guides/admin-guides/references/man1/getmacs.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getmacs.1.rst @@ -51,12 +51,12 @@ DESCRIPTION The getmacs command collects MAC address from a single or range of nodes. -Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04). +Note that on AIX systems, the returned MAC address is not colon-separated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-separated (for example 8e:e2:24:5c:f0:04). If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database. For PPC (using Direct FSP Management) specific: -Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform \ **Discovery**\ with option "\ **-D**\ ", since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "\ **-D**\ " to get theirs MAC addresses. +Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform \ **Discovery**\ with option "\ **-D**\ ", since there is no HMC command to read them and getmacs has to login to open firmware. And if the LPARs has never been activated before, getmacs need to be performed with the option "\ **-D**\ " to get theirs MAC addresses. For PPC (using HMC) specific: @@ -74,7 +74,7 @@ OPTIONS \ **-**\ **-arp**\ -Read MAC address with ARP protocal. +Read MAC address with ARP protocol. \ **-C**\ @@ -90,7 +90,7 @@ Perform discovery for mac address. By default, it will run ping test to test th \ **-f**\ -Force immediate shutdown of the partition.This flag must be used with -D flag. +Force immediate shutdown of the partition. This flag must be used with -D flag. \ **-F**\ @@ -118,7 +118,7 @@ Read MAC address when the lpar is in openfirmware state. This option mush be us \ **-S**\ -The IP address of the machine to ping. The default is to read from xCAT databse if no \ **-S**\ specified. +The IP address of the machine to ping. The default is to read from xCAT database if no \ **-S**\ specified. \ **-v**\ @@ -167,7 +167,7 @@ Output is similar to: ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -2. To retrieve the MAC address with ARP protocal: +2. To retrieve the MAC address with ARP protocol: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst b/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst index ea06cfd04..3a2675767 100644 --- a/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst @@ -33,7 +33,7 @@ This tool will build a directory of files, one for each defined nodegroup in xCAT. The file will be named the nodegroup name and contain a list of nodes that belong to the nodegroup. The file can be used as input to the AIX dsh command. -The purpose of this tool is to allow backward compatiblity with scripts +The purpose of this tool is to allow backward compatibility with scripts that were created using the AIX or CSM dsh command Reference: man dsh. diff --git a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst index 2e08a1b61..3626725f1 100644 --- a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst @@ -61,7 +61,7 @@ For statelite: where x is the name of the profile. -Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using \ **-e**\ flag. +Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themselves need to be manualy exported using \ **-e**\ flag. For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported. diff --git a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst index e5e542f7c..6359d535d 100644 --- a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst @@ -69,7 +69,7 @@ If \ **-p**\ flag is specified, the \ *postscripts*\ table will be updated wit If \ **-f**\ flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, \ */opt/xcat/share/xcat/netboot/sles/x.pkglist*\ will be copied to \ */install/custom/netboot/sles/compute_new.pkglist*\ and \ */install/netboot/sles11/ppc64/x/kernel*\ will be copied to \ */install/netboot/sles11/ppc64/compute_new/kernel*\ . This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one. -After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment. +After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node deployment. For stateful: nodeset diff --git a/docs/source/guides/admin-guides/references/man1/liteimg.1.rst b/docs/source/guides/admin-guides/references/man1/liteimg.1.rst index ceaec142a..266f59b73 100644 --- a/docs/source/guides/admin-guides/references/man1/liteimg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/liteimg.1.rst @@ -63,7 +63,7 @@ PARAMETERS ********** -\ *imagename*\ specifies the name of a os image definition to be used. The specification for the image is storted in the \ *osimage*\ table and \ *linuximage*\ table. +\ *imagename*\ specifies the name of a os image definition to be used. The specification for the image is stored in the \ *osimage*\ table and \ *linuximage*\ table. ******* diff --git a/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst b/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst index e3c553c2e..e72fc0ce0 100644 --- a/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst @@ -38,7 +38,7 @@ There are several concepts to support the HX5 multiple blades combination: \ **Complex**\ : Multiple blades which combined by a scalability card is a complex. -\ **Parition**\ : A logic concept which containing part of the \ **Blade slot node**\ in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) +\ **Partition**\ : A logic concept which containing part of the \ **Blade slot node**\ in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) \ **Blade slot node**\ : The physical blade which installed in the slot of a chassis. It can be a HX5 or MD. diff --git a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst index 81500f251..895a065e1 100644 --- a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst @@ -89,7 +89,7 @@ OPTIONS - Each tag contains info for a group of kit compoonents belonging to the same kit. The info inside is structured as follows: + Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/lsslp.1.rst b/docs/source/guides/admin-guides/references/man1/lsslp.1.rst index 0d16d5f50..3c83cb355 100644 --- a/docs/source/guides/admin-guides/references/man1/lsslp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsslp.1.rst @@ -41,13 +41,13 @@ OPTIONS ******* -\ **noderange**\ The nodes which the user want to discover. If the user specify the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. +\ **noderange**\ The nodes which the user wants to discover. If the user specifies the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. \ **-i**\ IP(s) the command will send out (defaults to all available adapters). \ **-h**\ Display usage message. -\ **-n**\ Only display and write the newly discovered hardwares. +\ **-n**\ Only display and write the newly discovered hardware. \ **-u**\ Do unicast to a specified IP range. Must be used with \ **-s**\ and \ **-**\ **-range**\ . The \ **-u**\ flag is not supported on AIX. @@ -55,15 +55,15 @@ OPTIONS \ **-r**\ Display Raw SLP response. -\ **-C**\ The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 secondes. The user can use -T flag the specify the time they want to use. A short time will limite the time costing, while a long time will help to find all the nodes. +\ **-C**\ The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 seconds. The user can use -T flag the specify the time they want to use. A short time will limit the time costing, while a long time will help to find all the nodes. -\ **-T**\ The number in seconds to limite the time costing of lsslp. +\ **-T**\ The number in seconds to limit the time of lsslp. \ **-s**\ Service type interested in discovering. \ **-t**\ Number or service-request attempts. -\ **-**\ **-vpdtable**\ Output the SLP response in vpdtable formatting. Easy for writting data to vpd table. +\ **-**\ **-vpdtable**\ Output the SLP response in vpdtable formatting. Easy for writing data to vpd table. \ **-v**\ Command Version. @@ -73,9 +73,9 @@ OPTIONS \ **-x**\ XML format. -\ **-z**\ Stanza formated output. +\ **-z**\ Stanza formatted output. -\ **-I**\ Give the warning message for the nodes in database which have no SLP responses. Note that this flag noly can be used after the database migration finished successfully. +\ **-I**\ Give the warning message for the nodes in database which have no SLP responses. Note that this flag can only be used after the database migration finished successfully. ************ diff --git a/docs/source/guides/admin-guides/references/man1/lstree.1.rst b/docs/source/guides/admin-guides/references/man1/lstree.1.rst index b4c58f176..e6a4eeddf 100644 --- a/docs/source/guides/admin-guides/references/man1/lstree.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lstree.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **lstree**\ command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to disply VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. +The \ **lstree**\ command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to display VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. ******* diff --git a/docs/source/guides/admin-guides/references/man1/lsvm.1.rst b/docs/source/guides/admin-guides/references/man1/lsvm.1.rst index dc53a2c47..ad48cc0af 100644 --- a/docs/source/guides/admin-guides/references/man1/lsvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsvm.1.rst @@ -360,7 +360,7 @@ Output is similar to: Available BSR array: 256 -Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. +Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class description)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. 9. For DFM-managed partition on normal power machine, list out the detailed information: 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 41084a288..066084735 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst @@ -84,7 +84,7 @@ OPTIONS \ **-**\ **-template**\ \ *template-object-name*\ - Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of \ **mkdef**\ command. If there are a template and an existing object with the same name \ *template-object-name*\ , the tempalte object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of \ **-**\ **-template**\ option in lsdef(1)|lsdef.1. + Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of \ **mkdef**\ command. If there are a template and an existing object with the same name \ *template-object-name*\ , the template object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of \ **-**\ **-template**\ option in lsdef(1)|lsdef.1. @@ -96,7 +96,7 @@ 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 commmand, 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. diff --git a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst index 87559be1c..f1e2d2e47 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst @@ -137,7 +137,7 @@ Output is similar to: host01c01: Pull image ubuntu start host01c01: Pull image ubuntu done host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success @@ -155,7 +155,7 @@ Output is similar to: .. code-block:: perl host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success diff --git a/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst b/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst index f1a4294e7..6968e6039 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst @@ -38,7 +38,7 @@ This command will also create a NIM resolv_conf resource to be used when install The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -57,11 +57,11 @@ You can use the "-n" option of the mkdsklsnode command to create and initialize \ **Note:**\ When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes. The NIM resources should not be shared between the old osimage and the new osimage. -You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. +You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. After the mkdsklsnode command completes you can use the \ **lsnim**\ command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **mkdsklsnode**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **mkdsklsnode**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **mkdsklsnode**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *diskless:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current current nodeset action, in this case "diskless". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **mkdsklsnode**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **mkdsklsnode**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **mkdsklsnode**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *diskless:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. ******* diff --git a/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst b/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst index 15d496c90..1d2985946 100644 --- a/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst @@ -43,7 +43,7 @@ When creating a mksysb image definition you must specify either the "-n" or the When creating a diskless osimage definition you also have the option of automatically updating the NIM SPOT resource. You can have additional software installed or you can have configuration files added or updated. To have software installed you must provide either the names of NIM installp_bundle resources or fileset names on the command line using the "attr=val" option. You may also supply the installp flags, RPM flags, emgr flags to use when installing the software. -To have configuration files updated you must provide the full path name of a "synclists" file which contains the the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. +To have configuration files updated you must provide the full path name of a "synclists" file which contains the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. \ **Updating an existing xCAT osimage**\ @@ -69,7 +69,7 @@ You can use the "-i" and "-p" options to copy an existing diskless osimage. To - any other resources (or attributes) included in the original osimage will be included in the new osimage definition. -- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redfined to NIM. (The default would be to use the original lpp_source - to save file system space.) +- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redefined to NIM. (The default would be to use the original lpp_source - to save file system space.) \ **Additional information**\ @@ -85,7 +85,7 @@ To list a NIM resource definition use the AIX \ **lsnim**\ command ("lsnim -l < To check the validity of a SPOT or lpp_source resource use the AIX \ **nim**\ command ("nim -o check "). -To remove specific NIM resource definitons use the AIX \ **nim**\ command. ("nim -o remove "). +To remove specific NIM resource definitions use the AIX \ **nim**\ command. ("nim -o remove "). ******* @@ -255,7 +255,7 @@ OPTIONS - Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). + Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma separated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). @@ -267,7 +267,7 @@ OPTIONS \ **-c|-**\ **-completeosimage**\ - Complete the creation of the osimage definition passed in on the command line. This option will use any additonal values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. + Complete the creation of the osimage definition passed in on the command line. This option will use any additional values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. @@ -492,7 +492,7 @@ The xCAT osimage definition created by this command will include the "otherpkgs" mknimimage -u 61dskls installp_bundle=bndres1,bndres2 installp_flags="-agcQX" -Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definiton is not used or updated. +Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definition is not used or updated. 13) Update an existing image to support NFSv4. Also specify verbose messages. diff --git a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst index 753ddd42e..effaaa109 100644 --- a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst @@ -148,7 +148,7 @@ OPTIONS \ **vmcpus=**\ \ *value*\ \ **vmmemory=**\ \ *value*\ \ **vmphyslots=**\ \ *value*\ \ **vmothersetting=**\ \ *value*\ \ **vmnics=**\ \ *value*\ \ **vmstorage=**\ \ *value*\ [\ **-**\ **-vios**\ ] - To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . + To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . The option \ *vios*\ is used to specify the partition that will be created is a VIOS partition. If specified, the value for \ *vmstorage*\ shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for \ *vmphyslots*\ , all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of \ *vios_name:server_slotid*\ to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. @@ -392,7 +392,7 @@ First, define a node object: mkdef -t node -o lpar1 mgt=fsp cons=fsp nodetype=ppc,osi id=1 hcp=cec parent=cec hwtype=lpar groups=lpar,all -Then, create the partion on the specified cec. +Then, create the partition on the specified cec. .. code-block:: perl @@ -515,7 +515,7 @@ The output is similar to: mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios -The resouces for the node is similar to: +The resources for the node is similar to: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/monadd.1.rst b/docs/source/guides/admin-guides/references/man1/monadd.1.rst index df2c69af8..bb8f629e8 100644 --- a/docs/source/guides/admin-guides/references/man1/monadd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monadd.1.rst @@ -39,9 +39,9 @@ Parameters ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. -\ *settings*\ is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: \ *-s key-value -s key=value ...*\ Note that the square brackets are needed here. Use \ *monls name -d*\ command to look for the possbile setting keys for a plug-in module. +\ *settings*\ is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: \ *-s key-value -s key=value ...*\ Note that the square brackets are needed here. Use \ *monls name -d*\ command to look for the possible setting keys for a plug-in module. ******* diff --git a/docs/source/guides/admin-guides/references/man1/moncfg.1.rst b/docs/source/guides/admin-guides/references/man1/moncfg.1.rst index febc5f32f..a7ac99ccd 100644 --- a/docs/source/guides/admin-guides/references/man1/moncfg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/moncfg.1.rst @@ -31,7 +31,7 @@ DESCRIPTION *********** -This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified, though the configuration of the nodes is usually performed during the node deployment stage. +This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configuration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified, though the configuration of the nodes is usually performed during the node deployment stage. ********** @@ -39,7 +39,7 @@ Parameters ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. \ *noderange*\ specifies the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst b/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst index 1b6b8439b..eeb0dc747 100644 --- a/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst @@ -31,7 +31,7 @@ DESCRIPTION *********** -This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified. The deconfigration operation will remove the nodes from the 3rd party software's monitoring domain. +This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified. The deconfiguration operation will remove the nodes from the 3rd party software's monitoring domain. ********** diff --git a/docs/source/guides/admin-guides/references/man1/monls.1.rst b/docs/source/guides/admin-guides/references/man1/monls.1.rst index 7f321d21b..f5241006d 100644 --- a/docs/source/guides/admin-guides/references/man1/monls.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monls.1.rst @@ -33,7 +33,7 @@ DESCRIPTION *********** -This command is used to list the status, desctiption, the configuration scripts and the settings of one or all of the monitoring plug-in modules. +This command is used to list the status, description, the configuration scripts and the settings of one or all of the monitoring plug-in modules. ********** @@ -49,9 +49,9 @@ OPTIONS ******* -\ **-a | -**\ **-all**\ Searches the \ *XCATROOT/lib/perl/xCAT_monitoring*\ directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the \ *monitoring*\ tabel. +\ **-a | -**\ **-all**\ Searches the \ *XCATROOT/lib/perl/xCAT_monitoring*\ directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the \ *monitoring*\ table. -\ **-d | -**\ **-description**\ Display the description of the plug-in modules. The description ususally contains the possible settings. +\ **-d | -**\ **-description**\ Display the description of the plug-in modules. The description usually contains the possible settings. \ **-h | -**\ **-help**\ Display usage message. @@ -110,7 +110,7 @@ The output looks like this: nagiosmon not-monitored -3. To list the status and the desciption for \ *snmpmon*\ module, enter: +3. To list the status and the description for \ *snmpmon*\ module, enter: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/monshow.1.rst b/docs/source/guides/admin-guides/references/man1/monshow.1.rst index e711239b7..2c8ff130c 100644 --- a/docs/source/guides/admin-guides/references/man1/monshow.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monshow.1.rst @@ -59,7 +59,7 @@ OPTIONS \ **-a**\ specifies a comma-separated list of attributes or metrics names. The default is all. -\ **-w**\ specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, serverity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. +\ **-w**\ specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, severity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. Operator descriptions: diff --git a/docs/source/guides/admin-guides/references/man1/monstart.1.rst b/docs/source/guides/admin-guides/references/man1/monstart.1.rst index 292c72265..1595b28b8 100644 --- a/docs/source/guides/admin-guides/references/man1/monstart.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monstart.1.rst @@ -39,7 +39,7 @@ PARAMETERS ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ **monls -a**\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ **monls -a**\ command to list all the monitoring plug-in modules that can be used. \ *noderange*\ is the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst b/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst index 8a82dad79..1fd244764 100644 --- a/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst @@ -57,9 +57,9 @@ To create a NIM installp_bundle definition you can use the "nim -o define" opera nim -o define -t installp_bundle -a server=master -a location=/install/nim/mypkgs.bnd mypackages -See the AIX documantation for more information on using installp_bundle files. +See the AIX documentation for more information on using installp_bundle files. -The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierachical environment. +The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierarchical environment. ******* diff --git a/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst b/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst index 8c03d0fd7..5f3511342 100644 --- a/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst @@ -33,7 +33,7 @@ This xCAT command can be used to initialize AIX/NIM standalone machines. Once th If you are using xCAT service nodes the \ **nimnodeset**\ command will automatically determine the correct server(s) for the node and do the initialization on that server(s). -The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definiions. +The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definitions. This command will also create a NIM resolv_conf resource to be used when installing the node. If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes. @@ -41,7 +41,7 @@ NIM resolv_conf resource will be created and allocated to the nodes. The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -58,13 +58,13 @@ will be created. You can specify additional attributes and values using the "attr=val" command line option. This information will be passed on to the underlying call to the NIM "nim -o bos_inst" command. See the NIM documentation for information on valid command line options for the nim command. The "attr" must correspond to a NIM attribute supported for the NIM "bos_inst" operation. Information provided by the "attr=val" option will take precedence over the information provided in the osimage definition. -The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. +The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. This command will also create a NIM script resource to enable the xCAT support for user-provided customization scripts. After the \ **nimnodeset**\ command completes you can use the \ **lsnim**\ command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **nimnodeset**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **nimnodeset**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **nimnodeset**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *standalone:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **nimnodeset**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **nimnodeset**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **nimnodeset**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *standalone:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. ******* @@ -76,7 +76,7 @@ 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. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma seperated list. (ex. "script=ascript,bscript"). + val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma separated list. (ex. "script=ascript,bscript"). @@ -106,8 +106,7 @@ OPTIONS \ **-l|-**\ **-location**\ - The directory location to use when creating new NIM resolv_conf resources. The d - efault location is /install/nim. + The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim. diff --git a/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst b/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst index 2a7cd8d10..2ce52c742 100644 --- a/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst @@ -61,7 +61,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst b/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst index d293bcaea..84a1dce0c 100644 --- a/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst @@ -63,7 +63,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst b/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst index 1d02e020a..be6b5300e 100644 --- a/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst @@ -79,7 +79,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst index b791d5180..8d1458b64 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst @@ -114,7 +114,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst index 35e01991d..2171f8da9 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst @@ -59,7 +59,7 @@ When the nodes are discovered, PCM updates the affected configuration files on t When you power on the nodes, they PXE boot and DHCP/TFTP/HTTP on the management node give each node the xCAT genesis boot image, which inventories the node hardware and sends data to the management node. There, either the sequential discovery process or the -profile discovery process assigns node attributes and defines the node in the the database. +profile discovery process assigns node attributes and defines the node in the database. ******* @@ -127,7 +127,7 @@ OPTIONS -\ **chasiss=**\ \ *chassis-name*\ +\ **chassis=**\ \ *chassis-name*\ Sets the chassis name that the Blade server or PureFlex blade is located in, for either the Sequential Discovery or Profile Discovery methods. This option is used for the Blade server and PureFlex system only. You cannot specify this option with the rack option. @@ -196,7 +196,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst index 279166e08..182800616 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst @@ -52,7 +52,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst index 92e5ce339..f95b1b43f 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst @@ -53,7 +53,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst b/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst index 27341b4e8..ccd2a8ab9 100644 --- a/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **nodeimport**\ command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location infomation like rack, chassis, start unit, server height...etc +The \ **nodeimport**\ command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location information like rack, chassis, start unit, server height...etc After nodes imported, the configuration files related with these nodes will be updated automatically. For example: /etc/hosts, dns configuration, dhcp configuration. And the kits node plugins will also be triggered automatically to update kit related configuration/services. @@ -83,9 +83,9 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured while validating parameters. +1 An error has occurred while validating parameters. -2 An error has occured while parsing hostinfo file. +2 An error has occurred while parsing hostinfo file. ******** @@ -143,7 +143,7 @@ To import nodes using a profile, follow the following steps: # hostinfo end. - Another example of a node infomation file, a PureFlex X/P node defined: + Another example of a node information file, a PureFlex X/P node defined: # hostinfo begin # To define a PureFlex P/X node, chassis and slot id must be specified. # The chassis must be a PureFlex chassis. @@ -191,7 +191,7 @@ Description: The name of the node, where __hostname__ is automatically generated \ **mac= This is a mandatory item. -Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. +Description: Specify the MAC address for the NIC used by the provisioning node, where is the NICs MAC address. \ **switches= This is a mandatory item, when define switch, switchport and node nic name relationship. @@ -221,9 +221,9 @@ Description: Lists the IP address for each network interface configuration (NIC) Description: node location info. Specify the rack name which this node will be placed into. If not specify this item, there will be no node location info set for this node. this item must be specified together with height + unit. -\ **chasiss= This is an optional item. +\ **chassis= This is an optional item. -Description: node location info, for blade(or PureFlex) only. Specify the chasiss name which this blade will be placed into. this item can not be specified together with rack. +Description: node location info, for blade(or PureFlex) only. Specify the chassis name which this blade will be placed into. this item can not be specified together with rack. \ **height= This is an optional item. diff --git a/docs/source/guides/admin-guides/references/man1/nodels.1.rst b/docs/source/guides/admin-guides/references/man1/nodels.1.rst index 692331e73..395c72848 100644 --- a/docs/source/guides/admin-guides/references/man1/nodels.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodels.1.rst @@ -109,7 +109,7 @@ OPTIONS \ **-b|-**\ **-blame**\ - For values inherited from groups, display which groups provided the inheritence + For values inherited from groups, display which groups provided the inheritance diff --git a/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst b/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst index c11871cdc..847eb6c7b 100644 --- a/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst @@ -59,7 +59,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst b/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst index 5eabc41af..7f110d908 100644 --- a/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst @@ -57,7 +57,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst index f51b0d015..8d3afd684 100644 --- a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst @@ -63,7 +63,7 @@ Keywords to use: port -- the application daemon port number, if not specified, use internal list, then /etc/services. group -- the name of a node group that needs to get the application status from. If not specified, assume all the nodes in the nodelist table. To specify more than one groups, use group=a,group=b format. cmd -- the command that will be run locally on mn or sn. - lcmd -- the command that will be run the the mn only. + lcmd -- the command that will be run the mn only. dcmd -- the command that will be run distributed on the nodes using xdsh .... @@ -94,7 +94,7 @@ For the command specified by 'dcmd', no input is needed, the output can be a str \ **-m | -**\ **-usemon**\ - Uses the settings from the \ **monsetting**\ talbe to determine a list of applications that need to get status for. + Uses the settings from the \ **monsetting**\ table to determine a list of applications that need to get status for. diff --git a/docs/source/guides/admin-guides/references/man1/piflash.1.rst b/docs/source/guides/admin-guides/references/man1/piflash.1.rst new file mode 100644 index 000000000..1959a893e --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/piflash.1.rst @@ -0,0 +1,23 @@ + +######### +piflash.1 +######### + +.. highlight:: perl + + +******** +SYNOPSIS +******** + + +\ **piflash**\ -**\ **-package + + +*********** +DESCRIPTION +*********** + + +\ **piflash**\ Remotely applies firmware updates to servers. + diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 47b35ae06..087047ab6 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -73,7 +73,7 @@ PPC (with HMC) specific: ======================== -The \ **rflash**\ command uses the \ **xdsh**\ command to connect to the HMC controlling the given managed system and perform the updates. Before running \ **rflash**\ , use \ **rspconfig**\ to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use \ **rspconfig**\ comamnd. +The \ **rflash**\ command uses the \ **xdsh**\ command to connect to the HMC controlling the given managed system and perform the updates. Before running \ **rflash**\ , use \ **rspconfig**\ to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use \ **rspconfig**\ command. \ **Warning!**\ This command may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. @@ -83,7 +83,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f The \ **-**\ **-commit**\ flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The \ **-**\ **-recover**\ flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored. -\ **NOTE:**\ When the \ **-**\ **-commit**\ or \ **-**\ **-recover**\ two flags is used, the noderange \ **cannot**\ be BPA. It only \ **can**\ be CEC or LPAR ,and will take effect for \ **both**\ managed systems and power subsystems. +\ **NOTE:**\ When the \ **-**\ **-commit**\ or \ **-**\ **-recover**\ two flags is used, the noderange \ **cannot**\ be BPA. It only \ **can**\ be CEC or LPAR, and will take effect for \ **both**\ managed systems and power subsystems. xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems. @@ -104,7 +104,7 @@ The \ **deferred**\ option will load the new firmware into the T (temp) side, b In Direct FSP/BPA Management, there is \ **-d**\ \ *data_directory*\ option. The default value is /tmp. When doing firmware update, \ **rflash**\ will put some related data from rpm packages in directory, so the execution of \ **rflash**\ will require available disk space in for the command to properly execute: -For one GFW rpm package and one power code rpm package , if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5\*gfw_rpmsize + 1.5\*power_rpmsize +For one GFW rpm package and one power code rpm package, if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5\*gfw_rpmsize + 1.5\*power_rpmsize For Power 775, the \ **rflash**\ command takes effect on the primary and secondary FSPs or BPAs almost in parallel. @@ -115,7 +115,7 @@ NeXtScale FPC specific: ======================= -The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters +The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters OpenPOWER specific: @@ -140,7 +140,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node \ **-c|-**\ **-check**\ - Chech the firmware version of BMC and HPM file. + Check the firmware version of BMC and HPM file. @@ -209,7 +209,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -1. To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +1. To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: .. code-block:: perl @@ -219,7 +219,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -2. To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +2. To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: .. code-block:: perl @@ -239,7 +239,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -4. To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: +4. To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 9d44f4377..d760fc576 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -25,21 +25,21 @@ BMC/MPA specific: ================= -\ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | asset | vpd | deviceid | guid | firm | dimm | mprom | all**\ ] -OpenPOWER (using ipmi) server specific: -======================================= +OpenPOWER (IPMI) server specific: +================================= -\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ] -OpenPOWER (using openbmc) server specific: -========================================== +OpenPOWER (OpenBMC) server specific: +==================================== -\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | firm | cpu | dimm | all**\ ] [\ **-V | -**\ **-verbose**\ ] PPC (with HMC) specific: @@ -114,10 +114,10 @@ zVM specific: ******************* -\ **rinv**\ retrieves hardware configuration information from the on-board +\ **rinv**\ retrieves hardware configuration information from the on-board Service Processor for a single or range of nodes and groups. -Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. +Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. *************** @@ -126,12 +126,6 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo -\ **pci**\ - - Retrieves PCI bus information. - - - \ **bus**\ List all buses for each I/O slot. @@ -140,8 +134,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **config**\ - Retrieves number of processors, speed, total memory, and DIMM - locations. + Retrieves number of processors, speed, total memory, and DIMM locations. @@ -177,7 +170,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **asset**\ - Retrieves asset tag. Usually it's the MAC address of eth0. + Retrieves asset tag. Usually it's the MAC address of eth0. @@ -195,25 +188,31 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **mprom**\ - Retrieves mprom firmware level + Retrieves mprom firmware level. + + + +\ **dimm**\ + + Retrieves dual in-line memory module information. \ **deviceid**\ - Retrieves device identification. Usually device, manufacturing and product ids. + Retrieves device identification. Usually device, manufacturing and product IDs. \ **uuid**\ - Retrieves the universally unique identifier + Retrieves the universally unique identifier. \ **guid**\ - Retrieves the global unique identifier + Retrieves the global unique identifier . @@ -235,6 +234,12 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo +\ **-V | -**\ **-verbose**\ + + Prints verbose output, if available. + + + \ **-t**\ Set the values in the vm table to what vCenter has for the indicated nodes. diff --git a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst index 33db44ce4..db021f2a9 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst @@ -48,7 +48,7 @@ EXAMPLES .. code-block:: perl rmdocker host01c01 - host01c01: Disconnect customzied network 'mynet0' done + host01c01: Disconnect customized network 'mynet0' done host01c01: success diff --git a/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst b/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst index 1ad0c3b3e..b9dd2625d 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst @@ -39,11 +39,11 @@ If the node you are trying to remove is currently running the \ **rmdsklsnode**\ \ **Removing alternate NIM client definitions**\ -If you used the "-n" option when you created the NIM client definitions with the \ **mkdsklsnode**\ command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions you must provide the name of the osimage that was used using the "-i" option. +If you used the "-n" option when you created the NIM client definitions with the \ **mkdsklsnode**\ command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions, you must provide the name of the osimage that was used using the "-i" option. -In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The \ **rmdsklsnode -r**\ option can be used to remove the old alternate client defintions without stopping the running node. +In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The \ **rmdsklsnode -r**\ option can be used to remove the old alternate client definitions without stopping the running node. -However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason it is recommended that you wait to do this cleanup until right before you do your next upgrade. +However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason, it is recommended that you wait to do this cleanup until right before you do your next upgrade. ******* @@ -60,8 +60,7 @@ OPTIONS \ **-b |-**\ **-backupSN**\ - When using backup service nodes only update the backup. The default is to updat - e both the primary and backup service nodes. + When using backup service nodes only update the backup. The default is to update both the primary and backup service nodes. @@ -85,8 +84,7 @@ OPTIONS \ **-p|-**\ **-primarySN**\ - When using backup service nodes only update the primary. The default is to upda - te both the primary and backup service nodes. + When using backup service nodes only update the primary. The default is to update both the primary and backup service nodes. diff --git a/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst b/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst index 1edd0ad07..225bb4627 100644 --- a/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst @@ -52,7 +52,7 @@ DESCRIPTION For PPC (with HMC) specific: -This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc talbe in xCAT DB. +This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc table in xCAT DB. Note: If a CEC belongs to a frame with a BPA installed, this CEC cannot be disconnected individually. Instead, the whole frame should be disconnected. diff --git a/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst b/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst index d6b67dfcb..c76a6584e 100644 --- a/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst @@ -88,7 +88,7 @@ zVM specific: \ **vm**\ table - -Table governing VM paramaters. See vm(5)|vm.5 for further details. +Table governing VM parameters. See vm(5)|vm.5 for further details. This is used to determine the current host to migrate from. diff --git a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst index 675774440..183372691 100644 --- a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit comoponent meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. +The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. Note: The xCAT support for Kits is only available for Linux operating systems. diff --git a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst index f3fc52f98..39a083ec7 100644 --- a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst @@ -65,7 +65,7 @@ OPTIONS \ **-**\ **-service**\ Remove the service partitions of the specified CECs. -\ **-p**\ KVM: Purge the existence of the VM from persistant storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partiton on normal power machine. +\ **-p**\ KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partition on normal power machine. \ **-f**\ Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. diff --git a/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst b/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst index 90cc2f5fe..866e10306 100644 --- a/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst @@ -66,11 +66,11 @@ Note: if the "val" fields includes spaces or any other characters that will be p \ **-r**\ -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. \ **-t**\ -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. \ **-V|-**\ **-verbose**\ diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index 74dcc3cac..414471bd5 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -32,7 +32,7 @@ BMC (using IPMI): \ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] -OpenPower BMC (using IPMI): +OpenPOWER BMC (using IPMI): =========================== @@ -41,7 +41,7 @@ OpenPower BMC (using IPMI): \ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] -OpenPower OpenBMC: +OpenPOWER OpenBMC: ================== @@ -181,7 +181,7 @@ OPTIONS \ **resetsp**\ - Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the sametime. + Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the same time. @@ -320,13 +320,13 @@ OPTIONS \ **-r**\ \ *retrycount*\ - specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. + specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. \ **-t**\ \ *timeout*\ - Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. + Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. Power off, then on. diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst index 9660a425d..c2165234b 100644 --- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst @@ -564,7 +564,7 @@ OPTIONS \ **USERID**\ ={\ *newpasswd*\ } \ **updateBMC**\ ={\ **y|n**\ } - Change the password of the userid \ **USERID**\ for CMM in Flex system cluster. The option \ *updateBMC*\ can be used to specify whether updating the password of BMCs that connected to the speified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. + Change the password of the userid \ **USERID**\ for CMM in Flex system cluster. The option \ *updateBMC*\ can be used to specify whether updating the password of BMCs that connected to the specified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. If value "\*" is specified for USERID and the object node is \ *Flex System X node*\ , the password used to access the BMC of the System X node through IPMI will be updated as the same password of the userid \ **USERID**\ of the CMM in the same cluster. diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index e6929cdfc..7fa7e62d6 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -56,11 +56,18 @@ BMC specific: \ **rvitals**\ \ *noderange*\ {\ **temp | voltage | wattage | fanspeed | power | leds | all**\ } -OpenPOWER server specific: +OpenPOWER (IPMI) specific: ========================== -\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | all**\ ] +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | chassis | all**\ ] + + +OpenPOWER (OpenBMC) specific: +============================= + + +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | altitude | all**\ ] @@ -69,7 +76,7 @@ OpenPOWER server specific: ******************* -\ **rvitals**\ retrieves hardware vital information from the on-board Service +\ **rvitals**\ Retrieves hardware vital information from the on-board Service Processor for a single or range of nodes and groups. @@ -133,6 +140,18 @@ Processor for a single or range of nodes and groups. +\ **chassis**\ + + Retrieves chassis status. + + + +\ **altitude**\ + + Retrieves altitude related attributes. + + + \ **power**\ Retrieves power status. diff --git a/docs/source/guides/admin-guides/references/man1/sinv.1.rst b/docs/source/guides/admin-guides/references/man1/sinv.1.rst index f1274c9d6..89bf04d4e 100644 --- a/docs/source/guides/admin-guides/references/man1/sinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/sinv.1.rst @@ -116,7 +116,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. then a new template will be created from the node output. This will result in having all nodes that match a given template reported in their group at the end of the run in the output file. - If no template count is specified, 0 is the default, and all nodes will + If no template count is specified, 0 is the default, and all nodes will be compared against the first template. @@ -127,7 +127,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. that is stored in template path. You can use this parameter instead of running the command yourself to build the template. - \ **Note:**\ If the template path file does not exists, and no seed node is + \ **Note:**\ If the template path file does not exist, and no seed node is supplied, the seed node automatically is one node in the noderange. @@ -152,7 +152,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. there can exist more lines in the xdsh return from the nodes. For example, if running a "rpm -qa | grep xCAT" command, without exactmatch - set, if the node containes more xCAT rpms that listed in the template, + set, if the node contains more xCAT rpms that listed in the template, it would be considered a match, as long as all rpms listed in the template were on the node. With exactmatch set, the output must be identical to the template. @@ -165,7 +165,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. of relevant device configuration file. The devicetype value must correspond to a valid device configuration file. xCAT ships some default configuration files - for Ethernet switches and and IB switches under + for Ethernet switches and IB switches under \ */opt/xcat/share/xcat/devicetype*\ directory. If you want to overwrite any of the configuration files, copy them to \ */var/opt/xcat/*\ directory and cutomize. diff --git a/docs/source/guides/admin-guides/references/man1/snmove.1.rst b/docs/source/guides/admin-guides/references/man1/snmove.1.rst index 80c0fd598..453e64c94 100644 --- a/docs/source/guides/admin-guides/references/man1/snmove.1.rst +++ b/docs/source/guides/admin-guides/references/man1/snmove.1.rst @@ -59,7 +59,7 @@ node is second. The \ **xcatmaster**\ attribute must be set to the hostname of the primary service node as it is known by the node. When the \ **snmove**\ command is run it modifies the xCAT database to -switch the the primary server to the backup server. +switch the primary server to the backup server. It will also check the other services that are being used for the node (tftpserver, monserver, nfsserver, conserver), and if they were set @@ -114,13 +114,13 @@ OPTIONS \ **-l|-**\ **-liteonly**\ - Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of thre nodes the the backup servers. + Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of the nodes to the backup servers. \ **-P|-**\ **-postscripts**\ - Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new serive node. If \ **all**\ is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. + Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service node. If \ **all**\ is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. diff --git a/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst b/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst index 55c8b6f4e..158c5f4cf 100644 --- a/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst +++ b/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst @@ -44,7 +44,7 @@ The \ **swapnodes**\ command shouldn't make the decision of which 2 nodes are s After running \ **swapnodes**\ command, the order of the I/O devices may be changed after IO re-assignment, so the administrator needs to run \ **rbootseq**\ to set the boot string for the current_node. And then boot the node with the same image and same postscripts because they have the same attributes. -Without \ **-o**\ option, it's used to swap the location info in the db between 2 nodes. With \ **-o**\ option, it's used to move the \ *current_node*\ definition to \ *fip_node*\ (the 2nd octant), not move the \ *fip_node*\ definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the \ *current_node*\ is a defective non-compute node, and \ *fip_node*\ is a avaible compute node. After the swapping, the \ *current_node*\ will be a available node. +Without \ **-o**\ option, it's used to swap the location info in the db between 2 nodes. With \ **-o**\ option, it's used to move the \ *current_node*\ definition to \ *fip_node*\ (the 2nd octant), not move the \ *fip_node*\ definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the \ *current_node*\ is a defective non-compute node, and \ *fip_node*\ is a available compute node. After the swapping, the \ *current_node*\ will be a available node. ******* @@ -94,7 +94,7 @@ EXAMPLES -1. To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped, and the the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. +1. To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped, and the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. .. code-block:: perl @@ -104,7 +104,7 @@ EXAMPLES -2. To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. +2. To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst index 1ba9aff9b..e84f3e74d 100644 --- a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst @@ -23,13 +23,13 @@ DESCRIPTION *********** -The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format. +The switchdiscover command scans the subnets and discovers all the switches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format. \ **-**\ **-setup**\ flag is for switch-based switch discovery. It will find all the discovered switches on the subnets, then match them with predefined switches in the xCATDB. Next, it will set discovered switches with static ip address and hostname based on the predefined switch. It will also enable snmpv3 configuration. The details of the process are defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html. -To view all the switches defined in the xCAT databasee use \ **lsdef -w "nodetype=switch"**\ command. +To view all the switches defined in the xCAT database use \ **lsdef -w "nodetype=switch"**\ command. -For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep packge or you can get it from http://vincentbernat.github.io/lldpd/installation.html. +For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html. For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. @@ -102,13 +102,13 @@ OPTIONS \ **-x**\ - XML formated output. + XML formatted output. \ **-z**\ - Stanza formated output. + Stanza formatted output. diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 55043ad8d..cd9a37448 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -325,7 +325,7 @@ PARAMETERS The scripts must be executable and copied to the /install/postscripts directory. Each script can take zero or more parameters. - If parameters are spcified, the whole list needs to be quoted by double quotes. + If parameters are specified, the whole list needs to be quoted by double quotes. For example: @@ -341,7 +341,7 @@ PARAMETERS Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. The currently supported attributes are: "installp_bundle", "otherpkgs", "installp_flags", - "emgr_flags" and "rpm_flags". These attribute are only valid for AIX software + "emgr_flags" and "rpm_flags". These attributes are only valid for AIX software maintenance support. @@ -355,9 +355,7 @@ OPTIONS \ **-**\ **-fanout**\ =\ *fanout_value*\ - Specifies a fanout value for the maximum number of concur- - rently executing remote shell processes. Serial execution - can be specified by indicating a fanout value of \ **1**\ . If \ **-**\ **-fanout**\ is not specified, a default fanout value of \ **64**\ is used. + Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of \ **1**\ . If \ **-**\ **-fanout**\ is not specified, a default fanout value of \ **64**\ is used. @@ -441,7 +439,7 @@ OPTIONS AIX and Linux and updating software (-S) for Linux only. The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. - This is not supported in a hiearchical cluster, that is the node is serviced by a service node. + This is not supported in a hierarchical cluster, that is the node is serviced by a service node. See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. diff --git a/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst b/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst index e23510646..9069b27de 100644 --- a/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst @@ -153,7 +153,7 @@ EXAMPLES xcat2nim -l -t node clstrn02 -7. To re-create a NIM machine definiton and display verbose output. +7. To re-create a NIM machine definition and display verbose output. .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man5/networks.5.rst b/docs/source/guides/admin-guides/references/man5/networks.5.rst index b9ab58208..c71afb5f2 100644 --- a/docs/source/guides/admin-guides/references/man5/networks.5.rst +++ b/docs/source/guides/admin-guides/references/man5/networks.5.rst @@ -138,7 +138,7 @@ networks Attributes: \ **mtu**\ - The default MTU for the network + The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks. diff --git a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst index 14cbd3c80..11bbee003 100644 --- a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst +++ b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst @@ -27,7 +27,7 @@ DESCRIPTION *********** -Setting for nodes that are controlled by an on-board OpenBmc. +Setting for nodes that are controlled by an on-board OpenBMC. ******************* diff --git a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst index a87cd902c..6bac116b9 100644 --- a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst +++ b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst @@ -44,13 +44,13 @@ postscripts Attributes: \ **postscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command \ **postbootscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst index 4100de4bb..e2cb86603 100644 --- a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst +++ b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst @@ -567,7 +567,7 @@ notification(5)|notification.5 openbmc(5)|openbmc.5 - Setting for nodes that are controlled by an on-board OpenBmc. + Setting for nodes that are controlled by an on-board OpenBMC. diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 8aea1128b..9a67dd224 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -801,13 +801,13 @@ group Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/network.7.rst b/docs/source/guides/admin-guides/references/man7/network.7.rst index 644e12908..593a52fb0 100644 --- a/docs/source/guides/admin-guides/references/man7/network.7.rst +++ b/docs/source/guides/admin-guides/references/man7/network.7.rst @@ -89,7 +89,7 @@ network Attributes: \ **mtu**\ (networks.mtu) - The default MTU for the network + The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 77646859a..0ab71ac4d 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -807,13 +807,13 @@ node Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man8/makedns.8.rst b/docs/source/guides/admin-guides/references/man8/makedns.8.rst index 9b558dccf..a97c1401a 100644 --- a/docs/source/guides/admin-guides/references/man8/makedns.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makedns.8.rst @@ -43,7 +43,7 @@ The \ **forwarders**\ value should be set to the IP address of one or more name An xCAT \ **network**\ definition must be defined for each network used in the cluster. The \ **net**\ and \ **mask**\ attributes will be used by the \ **makedns**\ command. -A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definiton corresponding to the node or in the \ **site**\ definition. +A network \ **domain**\ and \ **nameservers**\ values must be provided either in the \ **network**\ definition corresponding to the node or in the \ **site**\ definition. Only entries in /etc/hosts or the hosts specified by \ **noderange**\ that have a corresponding xCAT network definition will be added to DNS. diff --git a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst index 8dad0e800..fe31b65ad 100644 --- a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -**\ **-remove | -d | -**\ **-delete**\ ] [\ **-V | -**\ **-verbose**\ ] \ **makeknownhosts**\ [\ **-h | -**\ **-help**\ ] @@ -53,12 +53,18 @@ OPTIONS -\ **-r|-**\ **-remove**\ +\ **-d|-**\ **-delete**\ Only removes the entries for the nodes from the known_hosts file. +\ **-r|-**\ **-remove**\ + + Synonymous to \ **-d|-**\ **-delete**\ . + + + \ **-V|-**\ **-verbose**\ Verbose mode. @@ -97,7 +103,7 @@ EXAMPLES .. code-block:: perl - makeknownhosts node02 -r + makeknownhosts node02 -d diff --git a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst index 4b0b7a11c..aa78cdc5b 100644 --- a/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makenetworks.8.rst @@ -35,7 +35,7 @@ The \ **makenetworks**\ command can be used to gather network information from Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the managment node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. You can use the "-d" option to display the network information without writing it to the database. diff --git a/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst b/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst index 9a0145393..1bb33dd5c 100644 --- a/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeroutes.8.rst @@ -35,7 +35,7 @@ DESCRIPTION *********** -The \ **makeroutes**\ command adds or deletes routes on the management node or any given nodes. The \ **noderange**\ specifies the nodes where the routes are to be added or removed. When the \ *noderange*\ is omitted, the action will be done on the management node. The \ **-r**\ option specifies the name of routes. The details of the routes are defined in the \ **routes**\ table which contians the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on \ **noderes.routenames**\ for the nodes or on \ **site.mnroutenames**\ for the management node will be used. +The \ **makeroutes**\ command adds or deletes routes on the management node or any given nodes. The \ **noderange**\ specifies the nodes where the routes are to be added or removed. When the \ *noderange*\ is omitted, the action will be done on the management node. The \ **-r**\ option specifies the name of routes. The details of the routes are defined in the \ **routes**\ table which contains the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on \ **noderes.routenames**\ for the nodes or on \ **site.mnroutenames**\ for the management node will be used. If you want the routes be automatically setup during node deployment, first put a list of route names to \ **noderes.routenames**\ and then add \ *setroute*\ script name to the \ **postscripts.postbootscripts**\ for the nodes. diff --git a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst index 23ec24e23..35edfcd45 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -53,7 +53,7 @@ Assume that /tftpboot is the root for tftpd (set in site(5)|site.5). \ **nodeset**\ is called by \ **rinstall**\ and \ **winstall**\ and is also called by the installation process remotely to set the boot state back to "boot". -A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. *************** @@ -114,7 +114,7 @@ A user can supply their own scripts to be run on the mn or on the service node ( \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. diff --git a/docs/source/guides/admin-guides/references/man8/rinstall.8.rst b/docs/source/guides/admin-guides/references/man8/rinstall.8.rst index 0e06cd9e6..f33d0144c 100644 --- a/docs/source/guides/admin-guides/references/man8/rinstall.8.rst +++ b/docs/source/guides/admin-guides/references/man8/rinstall.8.rst @@ -19,9 +19,9 @@ Name **************** -\ **rinstall**\ \ *noderange*\ \ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **rinstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ ] [\ **runimage=**\ \ *task*\ ] [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ \ *noderange*\ \ **osimage**\ =\ *imagename*\ | [\ **-O**\ ] \ *imagename*\ [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **rinstall**\ \ *noderange*\ [\ **osimage**\ =\ *imagename*\ | \ *imagename*\ ] [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] \ **rinstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -31,11 +31,11 @@ Name ******************* -\ **rinstall**\ is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +\ **rinstall**\ is a convenience command to begin OS provision on a noderange. -If \ **osimage**\ =\ *imagename*\ | \ **-O**\ \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. +If \ **osimage**\ =\ *imagename*\ | \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. -If -c is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes , see winstall(8)|winstall.8. +If \ **-c**\ is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes, see winstall(8)|winstall.8. *************** @@ -50,9 +50,9 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **osimage | osimage=**\ \ *imagename*\ |\ **-O**\ \ *imagename*\ +\ *imagename*\ | \ **osimage=**\ \ *imagename*\ - Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. + Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the \ *imagename*\ is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. @@ -62,7 +62,7 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **runimage**\ =\ *task*\ +\ **runimage=**\ \ *task*\ If you would like to run a task after deployment, you can define that task with this attribute. @@ -70,14 +70,13 @@ If -c is specified, it will then run rcons on the node. This is allowed only if \ **runcmd=bmcsetup**\ - This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC - for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. + This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. @@ -100,7 +99,7 @@ If -c is specified, it will then run rcons on the node. This is allowed only if -\ **-V | -**\ **-Verbose**\ +\ **-V | -**\ **-verbose**\ Verbose output. diff --git a/docs/source/guides/admin-guides/references/man8/winstall.8.rst b/docs/source/guides/admin-guides/references/man8/winstall.8.rst index cfe21170c..e939b5554 100644 --- a/docs/source/guides/admin-guides/references/man8/winstall.8.rst +++ b/docs/source/guides/admin-guides/references/man8/winstall.8.rst @@ -19,11 +19,11 @@ Name **************** -\ **rinstall**\ \ *noderange*\ \ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **winstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=bmcsetup**\ ] [\ **runimage=**\ \ *task*\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ \ *noderange*\ \ **osimage**\ =\ *imagename*\ | [\ **-O**\ ] \ *imagename*\ [\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **winstall**\ \ *noderange*\ [\ **osimage**\ =\ *imagename*\ | \ *imagename*\ ] [\ **-**\ **-ignorekernelchk**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ] -\ **rinstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] +\ **winstall**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] ******************* @@ -31,11 +31,11 @@ Name ******************* -\ **winstall**\ is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +\ **winstall**\ is a convenience command to begin OS provision on a noderange. -If \ **osimage**\ =\ *imagename*\ | \ **-O**\ \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. +If \ **osimage**\ =\ *imagename*\ | \ *imagename*\ is specified or nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured. -It will then run wcons on the nodes. +It will then run \ **wcons**\ on the noderange. *************** @@ -50,9 +50,9 @@ It will then run wcons on the nodes. -\ **osimage | osimage=**\ \ *imagename*\ |\ **-O**\ \ *imagename*\ +\ *imagename*\ | \ **osimage=**\ \ *imagename*\ - Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. + Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\ table and \ *linuximage*\ table. If the \ *imagename*\ is omitted, the os image name will be obtained from \ *nodetype.provmethod*\ for the node. @@ -62,7 +62,7 @@ It will then run wcons on the nodes. -\ **runimage**\ =\ *task*\ +\ **runimage=**\ \ *task*\ If you would like to run a task after deployment, you can define that task with this attribute. @@ -70,14 +70,13 @@ It will then run wcons on the nodes. \ **runcmd=bmcsetup**\ - This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC - for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. + This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. \ **shell**\ - This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. + This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. @@ -100,18 +99,12 @@ It will then run wcons on the nodes. -\ **-V | -**\ **-Verbose**\ +\ **-V | -**\ **-verbose**\ Verbose output. -\ **-c | -**\ **-console**\ - - Requests that rinstall runs rcons once the provision starts. This will only work if there is only one node in the noderange. See winstall(8)|winstall.8 for starting consoles on multiple nodes. - - - **************** \ **Examples**\ @@ -119,7 +112,7 @@ It will then run wcons on the nodes. -1. Provison nodes 1 through 20, using their current configuration. +1. Provision nodes 1 through 20, using their current configuration. .. code-block:: perl @@ -134,7 +127,7 @@ It will then run wcons on the nodes. .. code-block:: perl - winstall node1-node20 -O rhels6.4-ppc64-netboot-compute + winstall node1-node20 osimage=rhels6.4-ppc64-netboot-compute diff --git a/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst b/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst index 75d981311..85a089555 100644 --- a/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst +++ b/docs/source/guides/admin-guides/references/man8/xcatconfig.8.rst @@ -66,19 +66,19 @@ OPTIONS \ **-i|-**\ **-initialinstall**\ - The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the datebase, export directories, start syslog and other daemons as needed after the initial install of xCAT. + The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the database, export directories, start syslog and other daemons as needed after the initial install of xCAT. \ **-u|-**\ **-updateinstall**\ - The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, datebase, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. + The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, database, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. \ **-k|-**\ **-sshkeys**\ - This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distribute to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. + This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distributed to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. rspconfig will need to be run to distribute the key to the MM and HMCs. Any device, we need to ssh from the MN to the device will also have to be updated with the new ssh keys. @@ -91,7 +91,7 @@ OPTIONS \ **-c|-**\ **-credentials**\ - This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistribed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stop and started. + This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistributed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stopped and started. @@ -103,9 +103,9 @@ OPTIONS \ **-f|-**\ **-force**\ - The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinititialize the site table. This option should be used, if keys or credentials become corrupt or lost. + The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinitialize the site table. This option should be used, if keys or credentials become corrupt or lost. Additional action must be taken after using the force options. ssh keys must be redistributed to the nodes, site table attributes might need to be restored, makeconservercf needs to be rerun to pick up the new credentials and conserver stopped and started, rspconfig needs to be rerun to distribute the new keys to the MM and the HMCs. - A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. + A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. Redistribute credentials and ssh keys to the service nodes and ssh keys to the nodes by using the updatenode -k command. diff --git a/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst b/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst index 494551577..355cc6cb6 100644 --- a/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst +++ b/docs/source/guides/admin-guides/references/man8/xcatsetup.8.rst @@ -124,7 +124,7 @@ Configuration File The \ **config file**\ is organized in stanza format and supports the keywords in the sample file below. Comment lines -begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +begin with "#". Stanzas can be omitted if you do not want to define that type of object. The only hostname formats supported are those shown in this sample file, although you can change the base text and the numbers. For example, hmc1-hmc3 could be changed to hwmgmt01-hwmgmt12. The hostnames specified must sort correctly. I.e. use node01-node80, instead of node1-node80. diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index e9f7cc87e..203b6cea9 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -37,11 +37,11 @@ xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` * **Latest Release (Stable) Builds** - *This is the latest GA (Generally Availability) build that has been tested throughly* + *This is the latest GA (Generally Availability) build that has been tested thoroughly* * **Latest Snapshot Builds** - *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested throughly* + *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested thoroughly* * **Development Builds** diff --git a/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst b/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst index bfc60691f..6e343f834 100644 --- a/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst +++ b/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst @@ -58,7 +58,7 @@ Remove xCAT Files dpkg -l | awk '/xcat/ { print $2 }' - If you want to remove more cleanly, the list bleow maybe helpful. Listed are the packages of xcat installation tarball. Some RPMs may not to be installed in a specific environment. + If you want to remove more cleanly, the list below maybe helpful. Listed are the packages of xcat installation tarball. Some RPMs may not to be installed in a specific environment. * XCAT Core Packages list (xcat-core): diff --git a/docs/source/guides/install-guides/yum/update_xcat.rst b/docs/source/guides/install-guides/yum/update_xcat.rst index fc01d99ad..fbbbe4762 100644 --- a/docs/source/guides/install-guides/yum/update_xcat.rst +++ b/docs/source/guides/install-guides/yum/update_xcat.rst @@ -6,5 +6,5 @@ If at a later date you want to update xCAT, first, update the software repositor yum clean metadata # or, yum clean all yum update '*xCAT*' - - + # To check and update the packages provided by xcat-dep: + yum update '*xcat*' diff --git a/docs/source/guides/install-guides/zypper/update_xcat.rst b/docs/source/guides/install-guides/zypper/update_xcat.rst index c18bb5b3c..3da2a2bb2 100644 --- a/docs/source/guides/install-guides/zypper/update_xcat.rst +++ b/docs/source/guides/install-guides/zypper/update_xcat.rst @@ -6,4 +6,5 @@ If at a later date you want to update xCAT, first, update the software repositor zypper refresh zypper update "*xCAT*" - + # To check and update the packages provided by xcat-dep: + zypper update "*xcat*" diff --git a/docs/source/overview/differentiators.rst b/docs/source/overview/differentiators.rst index f84bf0a8a..eb015c76b 100644 --- a/docs/source/overview/differentiators.rst +++ b/docs/source/overview/differentiators.rst @@ -18,7 +18,7 @@ Differentiators IBM Power, IBM Power LE, x86_64 -* Support Multiple Virtulization Infrastructures +* Support Multiple Virtualization Infrastructures IBM PowerKVM, KVM, IBM zVM, ESXI, XEN diff --git a/docs/source/overview/quick_start.rst b/docs/source/overview/quick_start.rst index 8bf22dfae..d26fc33b8 100644 --- a/docs/source/overview/quick_start.rst +++ b/docs/source/overview/quick_start.rst @@ -33,7 +33,7 @@ If xCAT looks suitable for your requirement, following steps are recommended pro Now you have the node definition. Verify the hardware control for defined nodes is working. e.g. ``rpower stat``. - Refer to the doc: :doc:`Hardware Management ` to learn how to perform the remote hardware control. + Refer to the doc: :doc:`Hardware Management <../guides/admin-guides/manage_clusters/ppc64le/management/index>` to learn how to perform the remote hardware control. #. Deploy OS on the target nodes diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 21a39166b..2062b7c30 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -71,7 +71,7 @@ xCAT 2.12.x | | | | | +---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.12.3 | | |- GitHub Issues resolved | -|| 2016/09/30 | | |- rinv options for OpenPower | +|| 2016/09/30 | | |- rinv options for OpenPOWER | || | | |- switch based switch discovery | | `2.12.3 Release Notes `_ | | |- Add xCAT Troubleshooting Log | | | | |- xCAT Log Classification | | | | |- RAID Configuration | diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index 079a62155..d7df0a9fc 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -33,7 +33,7 @@ if ($inet6support) { if ($^O =~ /^linux/i) { # Is IPv6 enabled on the MN or xcat client node at all? - my $ipv6enabled = `ip addr 2> /dev/null | grep inet6`; + my $ipv6enabled = `ip -6 -o addr 2> /dev/null`; if (!$ipv6enabled) { $inet6support = 0; } diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index fe4864e54..880160f42 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -675,6 +675,7 @@ sub setobjdefs # update the tables a row at a time foreach my $objname (keys %objhash) { + my $obj_need_update = 0; # get attr=val that are set in the DB ?? my $type = $objhash{$objname}{objtype}; @@ -779,6 +780,7 @@ sub setobjdefs $montable->commit; $monsettable->commit; + $objhash{$objname}{updated} = 1; next; } #if ($type eq 'monitoring') @@ -869,6 +871,9 @@ sub setobjdefs } } + unless ($ret) { + $objhash{$objname}{updated} = 1; + } $thistable->commit; @@ -1023,6 +1028,7 @@ sub setobjdefs $rsp->{data}->[0] = "access_tabentry \'$this_attr->{access_tabentry}\' is not valid."; xCAT::MsgUtils->message("E", $rsp, $::callback); + $objhash{$objname}{error} = 1; next; } $lookup_table = $tabentry{'lookup_table'}; @@ -1075,19 +1081,26 @@ sub setobjdefs split(/$delim/, $DBattrvals{$objname}{$attr_name}); my @minusList = split(/$delim/, $objhash{$objname}{$attr_name}); + my $operation_failed = 0; foreach my $em (@minusList) { if (!(grep { $_ eq $em } @currentList)) { if (($::opt_t eq 'group') && ($DBattrvals{$objname}{'grouptype'} ne 'dynamic')) { my $rsp; $rsp->{data}->[0] = "$objname is not a member of \'$em\'."; - xCAT::MsgUtils->message("W", $rsp, $::callback); + xCAT::MsgUtils->message("E", $rsp, $::callback); + $operation_failed = 1; } else { my $rsp; $rsp->{data}->[0] = "$em is not in the attribute of \'$attr_name\' for the \'$objname\' definition."; - xCAT::MsgUtils->message("W", $rsp, $::callback); + xCAT::MsgUtils->message("E", $rsp, $::callback); + $operation_failed = 1; } } } + if ($operation_failed) { + $objhash{$objname}{error} = 1; + next; + } # make a new list without the one specified my $first = 1; @@ -1106,6 +1119,12 @@ sub setobjdefs } $val = $newlist; } + else { + my $rsp; + $rsp->{data}->[0] = "No value got for attribute \'$attr_name\' for the \'$objname\' definition."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + next; + } } else { @@ -1118,10 +1137,13 @@ sub setobjdefs # the key is 'tabattrs' $allupdates{$lookup_table}{$objname}{$attr_name}{'tabattrs'}{$::tabattr} = $val; $setattrs = 1; - + $obj_need_update = 1; push(@setattrlist, $attr_name); } # end - foreach attribute + if ($obj_need_update) { + $objhash{$objname}{updated} = 1; + } my $rsp; foreach my $att (keys %$invalidattr) { diff --git a/perl-xCAT/xCAT/FSPvitals.pm b/perl-xCAT/xCAT/FSPvitals.pm index 3f31bf31c..11915abd7 100644 --- a/perl-xCAT/xCAT/FSPvitals.pm +++ b/perl-xCAT/xCAT/FSPvitals.pm @@ -375,7 +375,6 @@ sub rackenv { push @result, [ $name, $td, $Rc ]; if (!exists($request->{verbose})) { - #if( $td =~ /^Rack altitude in meters/ ) { if ($td =~ /^BPA-B total output in watts/) { last; } diff --git a/perl-xCAT/xCAT/GlobalDef.pm b/perl-xCAT/xCAT/GlobalDef.pm index b953a5168..b9b99ea20 100644 --- a/perl-xCAT/xCAT/GlobalDef.pm +++ b/perl-xCAT/xCAT/GlobalDef.pm @@ -51,7 +51,9 @@ $::STATUS_BOOTED = "booted"; $::STATUS_POWERING_ON = "powering-on"; $::STATUS_POWERING_OFF = "powering-off"; $::STATUS_DISCOVERING = "discovering"; +$::STATUS_DISCOVERED = "discovered"; $::STATUS_CONFIGURING = "configuring"; +$::STATUS_CONFIGURED = "configured"; $::STATUS_STANDING_BY = "standingby"; $::STATUS_SHELL = "shell"; $::STATUS_DEFINED = "defined"; @@ -69,7 +71,9 @@ $::STATUS_BMCREADY = "bmcready"; $::STATUS_POWERING_ON => 1, $::STATUS_POWERING_OFF => 1, $::STATUS_DISCOVERING => 1, + $::STATUS_DISCOVERED => 1, $::STATUS_CONFIGURING => 1, + $::STATUS_CONFIGURED => 1, $::STATUS_STANDING_BY => 1, $::STATUS_SHELL => 1, $::STATUS_DEFINED => 1, diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index b2e6484be..577d97ec4 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -16,6 +16,7 @@ use xCAT::Utils; #use locale; use Socket; use File::Path; +use constant PERF_LOG => "/var/log/xcat/perf.log"; $::NOK = -1; $::OK = 0; @@ -823,5 +824,65 @@ sub trace() { } } +#------------------------------------------------------------------ + +=head3 _perf_log + Libary function to write the perf log. Do not use it directly. +=cut + +#----------------------------------------------------------------- +sub _perf_log +{ + my $type = shift; + my $msg = shift; + my $fh; + my $ret = open($fh, '>>', PERF_LOG); + if (!$ret) { + xCAT::MsgUtils->message("S", "Open perf log file error: $!"); + } + my $line = localtime()."\t$type\t$msg\n"; + print $fh $line; + close $fh; +} + +#------------------------------------------------------------------ + +=head3 perf_log_info + Trace information for perf + Argument: + $msg (trace message) +=cut + +#----------------------------------------------------------------- +sub perf_log_info +{ + shift; + my $msg = shift; + _perf_log('info', $msg); +} + +#------------------------------------------------------------------ + +=head3 perf_log_process + Trace process information for perf + Arguments: + $process_type (immediate, plugin, etc) + $req (xcat reqeust) + $msg (additional message, optional) +=cut + +#----------------------------------------------------------------- +sub perf_log_process +{ + shift; + my ($process_type, $req, $msg, $pid) = @_; + if (defined($req)) { + my $command = $req->{command}->[0]; + _perf_log($process_type, "$$\t$command\t$msg"); + } else { + _perf_log($process_type, "$pid\t$msg"); + } +} + 1; diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index a66576cf4..0c62fb7a0 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -19,8 +19,7 @@ use File::Path; use Math::BigInt; use Socket; use xCAT::GlobalDef; - -#use Data::Dumper; +use Sys::Hostname; use strict; use warnings "all"; my $socket6support = eval { require Socket6 }; @@ -229,6 +228,9 @@ sub gethostname() hostname Optional: GetNumber=>1 (return the address as a BigInt instead of readable string) + GetAllAddresses=>1 (return the ) + OnlyV6=>1 () + OnlyV4=> () Returns: ip address Globals: cache: %::hostiphash @@ -270,69 +272,117 @@ sub getipaddr # #pass in an ip and only want an ip?? # return $iporhost; #} + my $isip=0; + if ($iporhost and ($iporhost =~ /\d+\.\d+\.\d+\.\d+/) || ($iporhost =~ /:/)){ + $isip=1; + } + + +#print "============================\n"; +#print Dumper(\%::hostiphash); +#print "\n"; +#print Dumper(\%extraarguments); +#print "\n"; +#print "iporhost=$iporhost"; +#print "\n"; +#print "============================\n"; #cache, do not lookup DNS each time - if ($::hostiphash and defined($::hostiphash{$iporhost}) && $::hostiphash{$iporhost}) + if ( + ((not $extraarguments{OnlyV6}) and (not $extraarguments{GetAllAddresses})) and defined($::hostiphash{$iporhost}) and $::hostiphash{$iporhost}) { - return $::hostiphash{$iporhost}; + + if($extraarguments{GetNumber} ) { + if($::hostiphash{$iporhost}{Number}){ + #print "YYYYYYYYYY GetNumber Cache Hit!!!YYYYYYYYY\n"; + return $::hostiphash{$iporhost}{Number}; + } + } elsif($::hostiphash{$iporhost}{hostip}) { + #print "YYYYYYYYYY dns Cache Hit!!!YYYYYYYYY\n"; + return $::hostiphash{$iporhost}{hostip}; + } + } + + if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6 + { + my @returns; + my $reqfamily = AF_UNSPEC; + if ($extraarguments{OnlyV6}) { + $reqfamily = AF_INET6; + } elsif ($extraarguments{OnlyV4}) { + $reqfamily = AF_INET; + } + my @addrinfo; + if($isip) { + @addrinfo=Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6,Socket6::AI_NUMERICHOST()); + }else{ + @addrinfo=Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6); + } + my ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); + unless($reqfamily == AF_INET6){ + if($isip){ + if($name){ + $::hostiphash{$iporhost}{hostip}=$name; + } + }elsif($ip){ + $::hostiphash{$iporhost}{hostip}=$ip; + } + } + while ($ip) + { + if ($extraarguments{GetNumber}) { #return a BigInt for compare, e.g. for comparing ip addresses for determining if they are in a common network or range + my $ip = (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; + my $bignumber = Math::BigInt->new(0); + foreach (unpack("N*", Socket6::inet_pton($family, $ip))) { #if ipv4, loop will iterate once, for v6, will go 4 times + $bignumber->blsft(32); + $bignumber->badd($_); + } + push(@returns, $bignumber); + $::hostiphash{$iporhost}{Number}=$returns[0]; + } else { + push @returns, (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; + $::hostiphash{$iporhost}{hostip}=$returns[0]; + } + if (scalar @addrinfo and $extraarguments{GetAllAddresses}) { + ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); + } else { + $ip = 0; + } + } + unless ($extraarguments{GetAllAddresses}) { + return $returns[0]; + } + return @returns; } else { - if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6 - { - my @returns; - my $reqfamily = AF_UNSPEC; - if ($extraarguments{OnlyV6}) { - $reqfamily = AF_INET6; - } elsif ($extraarguments{OnlyV4}) { - $reqfamily = AF_INET; - } - my @addrinfo = Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6); - my ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); - while ($ip) - { - if ($extraarguments{GetNumber}) { #return a BigInt for compare, e.g. for comparing ip addresses for determining if they are in a common network or range - my $ip = (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; - my $bignumber = Math::BigInt->new(0); - foreach (unpack("N*", Socket6::inet_pton($family, $ip))) { #if ipv4, loop will iterate once, for v6, will go 4 times - $bignumber->blsft(32); - $bignumber->badd($_); - } - push(@returns, $bignumber); - } else { - push @returns, (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; - } - if (scalar @addrinfo and $extraarguments{GetAllAddresses}) { - ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); - } else { - $ip = 0; - } - } - unless ($extraarguments{GetAllAddresses}) { - return $returns[0]; - } - return @returns; - } - else - { - #return inet_ntoa(inet_aton($iporhost)) - #TODO, what if no scoket6 support, but passing in a IPv6 hostname? - if ($iporhost =~ /:/) { #ipv6 - return undef; + #return inet_ntoa(inet_aton($iporhost)) + #TODO, what if no scoket6 support, but passing in a IPv6 hostname? + if ($iporhost =~ /:/) { #ipv6 + return undef; - #die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support"; - } - my $packed_ip; - $iporhost and $packed_ip = inet_aton($iporhost); - if (!$packed_ip) - { - return undef; - } - if ($extraarguments{GetNumber}) { #only 32 bits, no for loop needed. - return Math::BigInt->new(unpack("N*", $packed_ip)); - } - return inet_ntoa($packed_ip); + #die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support"; } + my $packed_ip; + $iporhost and $packed_ip = inet_aton($iporhost); + if (!$packed_ip) + { + return undef; + } + + my $myip=inet_ntoa($packed_ip); + + unless($isip) { + $::hostiphash{$iporhost}{hostip}=$myip; + } + + if ($extraarguments{GetNumber}) { #only 32 bits, no for loop needed. + my $number=Math::BigInt->new(unpack("N*", $packed_ip)); + $::hostiphash{$iporhost}{Number}=$number; + return $number; + } + + return $myip; } } @@ -417,7 +467,7 @@ sub linklocaladdr { =cut #------------------------------------------------------------------------------- -sub ishostinsubnet { +sub ishostinsubnet{ my ($class, $ip, $mask, $subnet) = @_; #safe guard @@ -425,6 +475,40 @@ sub ishostinsubnet { { return 0; } + + my $maskType=0; + + #CIDR notation supported + if ($subnet && ($subnet =~ /\//)) { + ($subnet, $mask) = split /\//, $subnet, 2; + $subnet =~ s/\/.*$//; + $maskType=1; + }elsif ($mask) { + if ($mask =~ /\//) { + $mask =~ s/^\///; + $maskType=1; + } elsif($mask =~ /^0x/i ) { + $maskType=2; + } + } + + my $ret=xCAT::NetworkUtils::isInSameSubnet( $ip, $subnet, $mask, $maskType); + if(defined $ret and $ret==1){ + return 1; + }else{ + return 0; + } +} + +sub ishostinsubnet_orig { + my ($class, $ip, $mask, $subnet) = @_; + + #safe guard + if (!defined($ip) || !defined($mask) || !defined($subnet)) + { + return 0; + } + my $numbits = 32; if ($ip =~ /:/) { #ipv6 $numbits = 128; @@ -1314,7 +1398,7 @@ sub formatNetmask Returns: 1: they are in same subnet - 2: not in same subnet + undef: not in same subnet Globals: none @@ -1853,16 +1937,13 @@ sub get_subnet_aix sub determinehostname { my $hostname; - my $hostnamecmd = "/bin/hostname"; - my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); - if ($::RUNCMD_RC != 0) - { # could not get hostname - xCAT::MsgUtils->message("S", - "Error $::RUNCMD_RC from $hostnamecmd command\n"); - exit $::RUNCMD_RC; + eval { + $hostname = hostname; + }; + if($@){ + xCAT::MsgUtils->message("S","Fail to get hostname: $@\n"); + exit -1; } - $hostname = $thostname[0]; - #get all potentially valid abbreviations, and pick the one that is ok #by 'noderange' my @hostnamecandidates; diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index dc351df6a..65cb35804 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1365,7 +1365,7 @@ sub gen_chain_for_profiles { #run bmcsetups. #PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC. - #But OpenPower need to support bmcsetup + #But OpenPOWER need to support bmcsetup my $nodehmtab = xCAT::Table->new('nodehm'); my $comments = ""; my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hwprofile, ['comments']); diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index bf4816595..a19207611 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -446,7 +446,7 @@ passed as argument rather than by table value', openbmc => { cols => [qw(node bmc consport taggedvlan username password comments disable)], keys => [qw(node)], - table_desc => 'Setting for nodes that are controlled by an on-board OpenBmc.', + table_desc => 'Setting for nodes that are controlled by an on-board OpenBMC.', descriptions => { node => 'The node name or group name.', bmc => 'The hostname of the BMC adapter.', @@ -893,8 +893,8 @@ passed as argument rather than by table value', table_desc => 'The scripts that should be run on each node after installation or diskless boot.', descriptions => { node => 'The node name or group name.', - postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute.', - postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list.', + postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command', + postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, diff --git a/perl-xCAT/xCAT/Scope.pm b/perl-xCAT/xCAT/Scope.pm index 654e6950a..a7aaf2588 100644 --- a/perl-xCAT/xCAT/Scope.pm +++ b/perl-xCAT/xCAT/Scope.pm @@ -1,8 +1,173 @@ package xCAT::Scope; + use xCAT::Utils; use xCAT::Table; use xCAT::ServiceNodeUtils qw(getSNList); + +#----------------------------------------------------------------------------- + +=head3 split_node_array + + Split a node array into multiple subsets in case to handle them in parallel. + + Arguments: + Reference of source array + Maximum subset number + Default element capacity in each subset + Returns: An array of all subsets + Error: + none + Example: + my $subsets = split_node_array(\@nodes, 5, 250); +=cut + +#----------------------------------------------------------------------------- +sub split_node_array { + my $source = shift; + if ($source =~ /xCAT::Scope/) { + $source = shift; + } + my $max_sub = shift; + my $capacity = shift; + + if ($max_sub < 2) {return [$source];} + + my @dest = (); + my $total = $#{$source} + 1; + my $n_sub = int ($total / $capacity); + unless ($n_sub * $capacity == $total) { $n_sub++;} #POSIX::ceil + + if ( $n_sub <= 1 ) { + # Only 1 subset is enough + $dest[0] = $source; + + } elsif ( $n_sub > $max_sub ) { + # Exceed, then to recaculate the capacity of each subset as we only allow max_sub + $capacity = int ($total / $max_sub); + if ( $total % $max_sub > 0 ) { + $capacity += 1; + } + my $start = $end = 0; + for (1..$max_sub) { + $end = $start + $capacity - 1; + if ( $end > $total - 1 ) { + $end = $total - 1 + } + + my @temp = @$source[$start..$end]; + $dest[$_-1]=\@temp; + $start = $end + 1; + } + + } else { + # Only n_sub subsets are required, split the noderange into each subset + my $start = $end = 0; + for (1..$n_sub) { + $end = $start + $capacity - 1; + if ( $end > $total - 1 ) { + $end = $total - 1 + } + #print "subset #$_: $start to $end"; + my @temp = @$source[$start..$end]; + $dest[$_-1]=\@temp; + $start = $end + 1; + } + } + + return \@dest; +} + +#----------------------------------------------------------------------------- + +=head3 get_parallel_scope + + Convert a request object to an array of multiple requests according to the + splitted node range. + + Arguments: + Reference of request + Maximum subset number: Optional, default is 5 + Default element capacity in each subset: Optional, default is 250 + Returns: An array of requests + Error: + none + Example: + my $reqs = xCAT::Scope->get_parallel_scope($request); +=cut + +#----------------------------------------------------------------------------- +sub get_parallel_scope { + my $req = shift; + if ($req =~ /xCAT::Scope/) { + $req = shift; + } + my ($max_sub, $capacity) = @_; + #TODO, make the value configurable + unless ($max_sub) { $max_sub = 5; } + unless ($capacity) { $capacity = 250; } + + my $subsets = split_node_array(\@{$req->{node}}, $max_sub, $capacity); + # Just return the origin one if node range is not big enough. + if ($#{$subsets} < 1) { return [$req]; } + + my @requests = (); + foreach (@$subsets) { + my $reqcopy = {%$req}; + $reqcopy->{node} = $_; + push @requests, $reqcopy; + } + return \@requests; +} + +#----------------------------------------------------------------------------- + +=head3 get_broadcast_scope_with_parallel + + Convert a request object to an array of multiple requests according to the + splitted node range. + + Arguments: + Reference of request + Callback: TODO, Optional, the Callback will be used to filter the nodes + Returns: An array of requests + Error: + none + Example: + my $reqs = xCAT::Scope->get_broadcast_scope($request); +=cut + +#----------------------------------------------------------------------------- +sub get_broadcast_scope_with_parallel { + my $req = shift; + if ($req =~ /xCAT::Scope/) { + $req = shift; + } + #Exit if the packet has been preprocessed in its history + if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } + + #Handle the one for current management/service node + my $reqs = get_parallel_scope($req); + my @requests = @$reqs; + + #Broadcast the request to other management/service nodes + foreach (xCAT::ServiceNodeUtils->getSNList()) { + if (xCAT::NetworkUtils->thishostisnot($_)) { + my $xcatdest = $_; + my $reqcopy = {%$req}; + $reqcopy->{'_xcatdest'} = $_; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + #Apply callback to filter the node range in future. + $reqs = get_parallel_scope($reqcopy); + foreach (@$reqs) { + push @requests, {%$_}; + } + } + } + return \@requests; +} + + sub get_broadcast_scope { my $req = shift; if ($req =~ /xCAT::Scope/) { diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index 5daf5c237..c27601874 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -14,7 +14,6 @@ if ($^O =~ /^aix/i) { } use lib "$::XCATROOT/lib/perl"; use strict; - #----------------------------------------------------------------------------- =head3 readSNInfo @@ -353,6 +352,37 @@ sub getSNandNodes #----------------------------------------------------------------------------- sub getSNList +{ + require xCAT::Table; + require xCAT::NodeRange; + my ($class, $service, $options) = @_; + my @servicenodes; + my $servicenodetab = xCAT::Table->new('servicenode'); + my $nodetab = xCAT::Table->new('nodelist'); + unless ($servicenodetab) # no servicenode table + { + xCAT::MsgUtils->message('I', "Unable to open servicenode table.\n"); + $servicenodetab->close; + return @servicenodes; + } + + + if($service){ + @servicenodes = $servicenodetab->getAllAttribsWhere(["$service==1"],'node'); + }else{ + @servicenodes = $servicenodetab->getAllAttribs(('node')); + } + + @servicenodes=xCAT::NodeRange::noderange(join(',',map {$_->{node}} @servicenodes)); + if($options eq "ALL"){ + return @servicenodes; + } + + @servicenodes = $nodetab->getAllAttribsWhere("node in ("."\'".join("\',\'", @servicenodes)."\'".") and groups not like '%__mgmtnode%'",'node'); + return map {$_->{node}} @servicenodes; +} + +sub getSNList_orig { require xCAT::Table; my ($class, $service, $options) = @_; @@ -367,6 +397,7 @@ sub getSNList } my @nodes = $servicenodetab->getAllNodeAttribs([$service]); $servicenodetab->close; + foreach my $node (@nodes) { if (!defined($service) || ($service eq "")) # want all the service nodes diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 30ba4b701..b0348dd53 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -29,10 +29,10 @@ my %usage = ( BMC (using IPMI): rpower noderange [on|off|softoff|reset|boot|stat|state|status|wake|suspend [-w timeout] [-o] [-r]] rpower noderange [pduon|pduoff|pdustat] - OpenPower BMC: + OpenPOWER BMC: rpower noderange [on|off|reset|boot|stat|state|status] rpower noderange [pduon|pduoff|pdustat] - OpenPower OpenBMC: + OpenPOWER OpenBMC: rpower noderange [on|off|reset|boot|stat|state|status] KVM Virtualization specific: rpower [boot] [ -c ] @@ -81,8 +81,10 @@ my %usage = ( rvitals noderange {temp|wattage|fanspeed|leds|summary|all} BMC specific: rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} - OpenPOWER server specific: - rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] + OpenPOWER (IPMI) specific: + rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|chassis|all] + OpenPOWER (OpenBMC) specific: + rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: rvitals noderange {thermal|all}", "reventlog" => @@ -93,14 +95,12 @@ my %usage = ( Common: rinv [all|model|serial] [-V|--verbose] rinv [-h|--help|-v|--version] - BMC specific: - rinv [mprom|deviceid|uuid|guid|vpd|dimm|all] - OpenPOWER (using ipmi) server specific: + BMC/MPA specific: + rinv [model|serial|asset|vpd|deviceid|guid|firm|dimm|mprom|all] + OpenPOWER (IPMI) server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] - OpenPOWER (using openbmc) server specific: - rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|cpu|dimm|all] - MPA specific: - rinv [firm|bios|diag|mprom|sprom|mparom|mac|mtm] + OpenPOWER (OpenBMC) server specific: + rinv [model|serial|firm|cpu|dimm|all] [-V|--verbose] PPC specific(with HMC): rinv [all|bus|config|serial|model|firm] PPC specific(using Direct FSP Management): @@ -620,3 +620,41 @@ sub parseCommand { return ""; } +#------------------------------------------------------------------------------ + +=head3 validateArgs + This function validates the arguments of the specified command + Arguments: + command + arguments(array @) + Returns: + $ref: a reference to array of [$retcode(integer),$info(string)] + $ref->[0]=0 : validation passed + $ret->[0]!=0: validation failed, the error info is returned in $ref->[1] + +=cut + +#------------------------------------------------------------------------------- + +sub validateArgs { + my $command=shift; + if ($command =~ /xCAT::Usage/) { $command = shift; } + + my $count=0; + my @extrargs=@_; + if($command =~ m/^(nodeset|rinstall|winstall)$/ ){ + #suppose that argument like "-p foo" have been processed and + #filtered by GetOpt subroutine + #fortunately the commands in this branch does not have such options + foreach(@extrargs){ + if($_ !~ m/^-[-]?\S+/){ + $count+=1; + } + } + if ($count!=1) { + return [1,"Invalid argument: '".join(" ",@extrargs)."'"]; + } + } + + return [0]; +} diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index a39ea8bb2..ea107f482 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -579,6 +579,69 @@ sub Version return $version; } +#------------------------------------------------------------------------------- + +=head3 get_conserver_version + Returns: + consever version number like 8.1.16, undef if error happens + Globals: + none + Error: + none + Example: + $version=xCAT::Utils->get_conserver_version(); + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub get_conserver_version +{ + my $cmd = "/usr/sbin/conserver -V"; + # output format: + # conserver: conserver.com version 8.2.1 + # conserver: default access type `r' + my @out = xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0 || @out < 1) { + return undef; + } + my @parts = split(' ',$out[0]); + if (@parts < 4) { + return undef; + } + my @count = $parts[3] =~ /\./g; + if (@count < 2) { + return undef; + } + return $parts[3]; +} + +#------------------------------------------------------------------------------- + +=head3 calc_conserver_version + Arguments: + version in string format + Returns: + version number + Globals: + none + Error: + none + Example: + $version=xCAT::Utils->calc_conserver_version("8.2.1"); + Comments: + none +=cut + +#------------------------------------------------------------------------------- +sub calc_conserver_version +{ + my $ver_str = shift; + my @vers = split(/\./, $ver_str); + return int($vers[2]) + int($vers[1]) * 10000 + int($vers[0]) * 100000000; +} + + #------------------------------------------------------------------------------- =head3 make_node_list_file @@ -3306,10 +3369,25 @@ sub isSELINUX =cut #------------------------------------------------------------------------------- + + sub noderangecontainsMn { my ($class, @noderange) = @_; + # check if any node in the noderange is the Management Node return the + # name + my @mnames; # management node names in the database, members of __mgmtnode + my $tab = xCAT::Table->new('nodelist'); + + my @nodelist = $tab->getAllAttribsWhere("node in ("."\'".join("\',\'", @noderange)."\'".") and groups like '%__mgmtnode%'",'node'); + return map {$_->{node}} @nodelist; # if no MN in the noderange, return nothing +} + +sub noderangecontainsMn_orig +{ + my ($class, @noderange) = @_; + # check if any node in the noderange is the Management Node return the # name my @mnames; # management node names in the database, members of __mgmtnode diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 75274be3e..c3432566a 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -11,8 +11,9 @@ require Exporter; @EXPORT = qw(); @EXPORT_OK = qw(distnames numdiscs); +use strict; -my %distnames = ( +our %distnames = ( "1480943823.812754" => "centos7.3", #x86_64 "1450147276.351714" => "centos7.2", #ppc64le "1449699925.561114" => "centos7.2", #x86_64 @@ -135,7 +136,7 @@ my %distnames = ( "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM ); -my %numdiscs = ( +our %numdiscs = ( "1156364963.862322" => 4, "1178480581.024704" => 3 ); diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm new file mode 100644 index 000000000..79c36abfa --- /dev/null +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -0,0 +1,45 @@ +# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html + +#This module includes some glocal table to look up the switch type via mac and vendor + +package xCAT::data::switchinfo; + +require Exporter; +@ISA = qw(Exporter); +@EXPORT = qw(); +@EXPORT_OK = qw(global_mac_identity global_switch_type); + +use strict; + +#the hash to look up switch type with MAC +our %global_mac_identity = ( + "a8:97:dc" => "BNT G8052 switch", + "6c:ae:8b" => "BNT G8264-T switch", + "fc:cf:62" => "BNT G8124 switch", + "7c:fe:90" => "Mellanox IB switch", + "cc:37:ab" => "Edgecore Networks Switch", + "8c:ea:1b" => "Edgecore Networks Switch" +); + +#the hash to lookup switch type with vendor +our %global_switch_type = ( + Juniper => "Juniper", + juniper => "Juniper", + Cisco => "Cisco", + cisco => "Cisco", + BNT => "BNT", + Blade => "BNT", + G8052 => "BNT", + RackSwitch => "BNT", + Mellanox => "Mellanox", + mellanox => "Mellanox", + MLNX => "Mellanox", + MELLAN => "Mellanox", + Cumulus => "onie", + cumulus => "onie", + Edgecore => "onie" +); + + + +1; diff --git a/xCAT-OpenStack/postscripts/configgw b/xCAT-OpenStack/postscripts/configgw index 36c246eaf..e2b97be77 100755 --- a/xCAT-OpenStack/postscripts/configgw +++ b/xCAT-OpenStack/postscripts/configgw @@ -9,7 +9,7 @@ if [ -z "$1" ];then fi str_nic_name=$1 -str_ip_mask=`ip addr show dev $str_nic_name | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1` +str_ip_mask=`ip -4 -o addr show dev $str_nic_name | awk '{print $4}' | head -n 1` str_ip=`echo $str_ip_mask | awk -F'/' '{print $1}'` str_mask=`echo $str_ip_mask | awk -F'/' '{print $2}'` diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 2fa148d6a..c5b1b78df 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -87,7 +87,7 @@ if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/ fi if [ -z "$CONSERVER" ]; then CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '` - declare -a ipaddrs=`ip addr | grep 'inet' | awk {'print $2'} | cut -d/ -f1 | grep -v : | tr '\n' ' '` + declare -a ipaddrs=`ip -o a | awk {'print $4'} | cut -d/ -f1 | grep -v : | tr '\n' ' '` for IP in ${ipaddrs[*]}; do if [[ "${CONSERVER}" == "${IP}" ]]; then # conserver is the same node, do not connect using -s @@ -127,12 +127,22 @@ elif [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then #NOTE: IPv6 is not good with the below if going by IP, needs more sophisticated #parsing CONSERVER=`echo $CONSERVER|cut -d: -f 1` - + CONSOLE_VER=`console -V | awk '/conserver.com version/ {print $4}'` #Detect console support of SSL, only fixup consolerc if encryption is detected if ! console -h 2>&1 | grep "encryption not compiled" > /dev/null; then # generate .consolerc if it does not exist or is empty if [ ! -s $HOME/.consolerc ]; then - cat > $HOME/.consolerc << EOF + if [ "$CONSOLE_VER" != "8.1.16" ]; then + cat > $HOME/.consolerc << EOF +config * { + port 782; + sslenabled yes; + sslcacertificatefile $HOME/.xcat/ca.pem; + sslcredentials $HOME/.xcat/client-cred.pem; +} +EOF + else + cat > $HOME/.consolerc << EOF config * { port 782; sslenabled yes; @@ -140,6 +150,7 @@ config * { sslcredentials $HOME/.xcat/client-cred.pem; } EOF + fi fi else # ssl is not enabled, comment out the ssl settings in .consolerc @@ -147,7 +158,10 @@ EOF sed -i 's/\Wssl/#ssl/1' $HOME/.consolerc fi fi - + # for migration, upgrade conserver + if [ "$CONSOLE_VER" != "8.1.16" ]; then + sed -i 's/sslauthority/sslcacertificatefile/1' $HOME/.consolerc + fi exec console $FORCE -M $CONSERVER $1 else if [[ "$FORCE" == "-s" ]]; then diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 3d4058f51..2e967fab5 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -17,7 +17,7 @@ B [B<-u> I] [B<-p> I] B<-i> I B<--ips =head1 DESCRIPTION -The B command will discover Baseboard Management Controllers (BMCs) using a scan mathod. +The B command will discover Baseboard Management Controllers (BMCs) using a scan method. The command uses B to scan active nodes over a specified IP range. The IP range format should be a format that is acceptable by B. @@ -31,7 +31,7 @@ Note: The scan method currently support is B. =item B<--range> -Specify one or more IP ranges acceptable to nmap. IP rance can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. +Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. =item B<-s> diff --git a/xCAT-client/pods/man1/cfgve.1.pod b/xCAT-client/pods/man1/cfgve.1.pod index 93c8dbc60..e2df6268f 100644 --- a/xCAT-client/pods/man1/cfgve.1.pod +++ b/xCAT-client/pods/man1/cfgve.1.pod @@ -81,7 +81,7 @@ The NFS export directory must be configured for read write access and must be owned by vdsm:kvm. B: "/data/images/rhev" is set by default. -B - A host must be specified for a storage doamin as SPM +B - A host must be specified for a storage domain as SPM (Storage Pool Manager) when initialize the storage domain. The role of SPM may be migrated to other host by rhev-m during the running of the datacenter (For example, when the current SPM encountered issue or going to maintenance diff --git a/xCAT-client/pods/man1/chvm.1.pod b/xCAT-client/pods/man1/chvm.1.pod index 99ec573f7..f1ac27855 100644 --- a/xCAT-client/pods/man1/chvm.1.pod +++ b/xCAT-client/pods/man1/chvm.1.pod @@ -114,7 +114,7 @@ This command also supports to change specific partition attributes by specifying For Power 755(use option I<--p775> to specify): -chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. +chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar. @@ -127,7 +127,7 @@ chvm could be used to modify the resources assigned to partitions. The admin sha =head2 zVM specific: -The chvm command modifes the virtual machine's configuration specified in noderange. +The chvm command modifies the virtual machine's configuration specified in noderange. =head1 OPTIONS @@ -248,7 +248,7 @@ Purge the Hard disk. Deregisters and deletes the files. Multiple can be done w =item B<--resize> I=I -Change the size of the Hard disk. The disk in I format can not be set to less than it's current size. The disk in I format can be resized smaller, use caution. Multiple disks can be resized by using comma separated IB<=>I pairs. The disks are specified by SCSI id. Size defaults to GB. +Change the size of the Hard disk. The disk in I format can not be set to less than its current size. The disk in I format can be resized smaller, use caution. Multiple disks can be resized by using comma separated IB<=>I pairs. The disks are specified by SCSI id. Size defaults to GB. =back diff --git a/xCAT-client/pods/man1/csm2xcat.1.pod b/xCAT-client/pods/man1/csm2xcat.1.pod index fc1f66411..dffc47c79 100644 --- a/xCAT-client/pods/man1/csm2xcat.1.pod +++ b/xCAT-client/pods/man1/csm2xcat.1.pod @@ -11,7 +11,7 @@ B [B<-h>] =head1 DESCRIPTION -The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The commmand will build two xCAT stanza files that can update the xCAT database with the chdef command. +The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The command will build two xCAT stanza files that can update the xCAT database with the chdef command. Copy the csm2xcat command to the CSM Management Server. Run the command, indicating where you want your stanza files saved with the B<--dir> parameter. Check the stanza files to see if the information is what you want put in the xCAT database. Copy the two stanza files: node.stanza, device.stanza back to your xCAT Management node, and run the chdef command to input into the xCAT database. diff --git a/xCAT-client/pods/man1/db2sqlsetup.1.pod b/xCAT-client/pods/man1/db2sqlsetup.1.pod index 4bf2768de..8d9e9f059 100644 --- a/xCAT-client/pods/man1/db2sqlsetup.1.pod +++ b/xCAT-client/pods/man1/db2sqlsetup.1.pod @@ -28,7 +28,7 @@ For full information on the setup of DB2, see Setting_Up_DB2_as_the_xCAT_DB. When running of db2sqlsetup on the MN: One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable. -The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overriden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. +The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overridden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. When running db2sqlseutp on the SN: Not only will the password for the DB2 instance Id be prompted for and must match the one on the Management Node; but also the hostname or ip address of the Management Node as known by the Service Node must be supplied , unless the XCATDB2SERVER environment variable is set. diff --git a/xCAT-client/pods/man1/dumpxCATdb.1.pod b/xCAT-client/pods/man1/dumpxCATdb.1.pod index b9e155a08..fbdf7e392 100644 --- a/xCAT-client/pods/man1/dumpxCATdb.1.pod +++ b/xCAT-client/pods/man1/dumpxCATdb.1.pod @@ -17,7 +17,7 @@ If not using the binary dump option (-b), then the dumpxCATdb command creates .c Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables. The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records. -If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilites for backup of the entire database. +If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilities for backup of the entire database. =head1 OPTIONS @@ -28,7 +28,7 @@ B<-v> Command Version. B<-V> Verbose. -B<-a> All,without this flag the eventlog and auditlog will be skipped. +B<-a> All, without this flag the eventlog and auditlog will be skipped. B<-b> This flag is only used for the DB2 or postgreSQL database. The routine will use the database backup utilities to create a binary backup of the entire database. Note to use this backup on DB2, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions. diff --git a/xCAT-client/pods/man1/genimage.1.pod b/xCAT-client/pods/man1/genimage.1.pod index 7d2414604..bc4f09d8b 100644 --- a/xCAT-client/pods/man1/genimage.1.pod +++ b/xCAT-client/pods/man1/genimage.1.pod @@ -29,7 +29,7 @@ for stateless: B for statelite: B -Besides prompting for some paramter values, the B command takes default guesses for the parameters not specified or not defined in the I and I tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use B<--interactive> flag if you want the yum/zypper command to prompt you for the answers. +Besides prompting for some parameter values, the B command takes default guesses for the parameters not specified or not defined in the I and I tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use B<--interactive> flag if you want the yum/zypper command to prompt you for the answers. If B<--onlyinitrd> is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. diff --git a/xCAT-client/pods/man1/geninitrd.1.pod b/xCAT-client/pods/man1/geninitrd.1.pod index fce267474..f2d4cfc7a 100644 --- a/xCAT-client/pods/man1/geninitrd.1.pod +++ b/xCAT-client/pods/man1/geninitrd.1.pod @@ -26,7 +26,7 @@ If the initrd has been rebuilt by geninitrd, when run nodeset, the I<--noupdatei should be used to skip the rebuilding of initrd to improve the performance. Three attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. B - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -51,7 +51,7 @@ this command is used to generate the initrd from the rootimg which generated by So the 'genimage' must be run once before running the geninitrd command. Two attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. B - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -64,7 +64,7 @@ B - comma separated driver rpm packages (full path should be sp =head1 Parameters -I specifies the name of an os image definition to be used. The specification for the image is storted in the I table and I table. +I specifies the name of an os image definition to be used. The specification for the image is stored in the I table and I table. =over 12 diff --git a/xCAT-client/pods/man1/getadapter.1.pod b/xCAT-client/pods/man1/getadapter.1.pod index 0c10af7a1..0bdb93c42 100644 --- a/xCAT-client/pods/man1/getadapter.1.pod +++ b/xCAT-client/pods/man1/getadapter.1.pod @@ -12,24 +12,35 @@ B [B<-h>|B<--help>|B<-v>|B<--version>|B<-V>] Traditionally, network interfaces in Linux are enumerated as eth[0123...], but these names do not necessarily correspond to actual labels on the chassis. B help customer to get predictable network device name and some other network adapter information before provision or network configuration. -B use genesis to collect network adapters information, so that mean it need to restart the target node. +B B For each node within the , follows below scheme: -If the target node is scaned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. -If the target node has ever been scaned, B will use the information from nics table first. +If the target node is scanned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. +If the target node has ever been scanned, B will use the information from nics table first. If user hopes to scan the adapter information for the node but these information already exist, B<-f> option can be used to start rescan process. B tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. -Below are the possible information can be collect up to now: -B: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7 -B: the pci location -B: the MAC address -B: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)> -B: the vender of network device -B: the model of network device -B: the link state of network device +=head1 B + +=over 2 + +=item B: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7 + +=item B: the pci location + +=item B: the MAC address + +=item B: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)> + +=item B: the vender of network device + +=item B: the model of network device + +=item B: the link state of network device + +=back =head1 OPTIONS diff --git a/xCAT-client/pods/man1/getmacs.1.pod b/xCAT-client/pods/man1/getmacs.1.pod index 68572339f..8bbbb8d17 100644 --- a/xCAT-client/pods/man1/getmacs.1.pod +++ b/xCAT-client/pods/man1/getmacs.1.pod @@ -23,12 +23,12 @@ B I [B<-V>| B<--verbose>] [B<-d>] [B<--arp>] [B<-i> I =head1 DESCRIPTION The getmacs command collects MAC address from a single or range of nodes. -Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04). +Note that on AIX systems, the returned MAC address is not colon-separated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-separated (for example 8e:e2:24:5c:f0:04). If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database. For PPC (using Direct FSP Management) specific: -Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform B with option "B<-D>", since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses. +Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform B with option "B<-D>", since there is no HMC command to read them and getmacs has to login to open firmware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses. For PPC (using HMC) specific: @@ -42,7 +42,7 @@ Note: If "B<-d>" is specified, all the MAC of the blades will be displayed. If n B<--arp> -Read MAC address with ARP protocal. +Read MAC address with ARP protocol. B<-C> @@ -58,7 +58,7 @@ Perform discovery for mac address. By default, it will run ping test to test th B<-f> -Force immediate shutdown of the partition.This flag must be used with -D flag. +Force immediate shutdown of the partition. This flag must be used with -D flag. B<-F> @@ -86,7 +86,7 @@ Read MAC address when the lpar is in openfirmware state. This option mush be us B<-S> -The IP address of the machine to ping. The default is to read from xCAT databse if no B<-S> specified. +The IP address of the machine to ping. The default is to read from xCAT database if no B<-S> specified. B<-v> @@ -122,7 +122,7 @@ Output is similar to: ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -2. To retrieve the MAC address with ARP protocal: +2. To retrieve the MAC address with ARP protocol: getmacs lpar4 --arp diff --git a/xCAT-client/pods/man1/groupfiles4dsh.1.pod b/xCAT-client/pods/man1/groupfiles4dsh.1.pod index 171b99978..7f2281eba 100644 --- a/xCAT-client/pods/man1/groupfiles4dsh.1.pod +++ b/xCAT-client/pods/man1/groupfiles4dsh.1.pod @@ -15,7 +15,7 @@ This tool will build a directory of files, one for each defined nodegroup in xCAT. The file will be named the nodegroup name and contain a list of nodes that belong to the nodegroup. The file can be used as input to the AIX dsh command. -The purpose of this tool is to allow backward compatiblity with scripts +The purpose of this tool is to allow backward compatibility with scripts that were created using the AIX or CSM dsh command Reference: man dsh. diff --git a/xCAT-client/pods/man1/imgexport.1.pod b/xCAT-client/pods/man1/imgexport.1.pod index a2376df26..0e535a57b 100644 --- a/xCAT-client/pods/man1/imgexport.1.pod +++ b/xCAT-client/pods/man1/imgexport.1.pod @@ -45,7 +45,7 @@ For statelite: where x is the name of the profile. -Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using B<-e> flag. +Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themselves need to be manualy exported using B<-e> flag. For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported. diff --git a/xCAT-client/pods/man1/imgimport.1.pod b/xCAT-client/pods/man1/imgimport.1.pod index f652f9d74..2757ee48a 100644 --- a/xCAT-client/pods/man1/imgimport.1.pod +++ b/xCAT-client/pods/man1/imgimport.1.pod @@ -50,7 +50,7 @@ If B<-p> flag is specified, the I table will be updated with the po If B<-f> flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, I will be copied to I and I will be copied to I. This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one. -After this command, you can run the B command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment. +After this command, you can run the B command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node deployment. For stateful: nodeset diff --git a/xCAT-client/pods/man1/liteimg.1.pod b/xCAT-client/pods/man1/liteimg.1.pod index 4a98c114a..9f8ed39ff 100644 --- a/xCAT-client/pods/man1/liteimg.1.pod +++ b/xCAT-client/pods/man1/liteimg.1.pod @@ -41,7 +41,7 @@ Note: If you make any changes to your litefile table after running liteimg then =head1 PARAMETERS -I specifies the name of a os image definition to be used. The specification for the image is storted in the I table and I table. +I specifies the name of a os image definition to be used. The specification for the image is stored in the I table and I table. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/lsflexnode.1.pod b/xCAT-client/pods/man1/lsflexnode.1.pod index bcb1a2c93..4fa436316 100644 --- a/xCAT-client/pods/man1/lsflexnode.1.pod +++ b/xCAT-client/pods/man1/lsflexnode.1.pod @@ -22,7 +22,7 @@ There are several concepts to support the HX5 multiple blades combination: B: Multiple blades which combined by a scalability card is a complex. -B: A logic concept which containing part of the B in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) +B: A logic concept which containing part of the B in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) B: The physical blade which installed in the slot of a chassis. It can be a HX5 or MD. diff --git a/xCAT-client/pods/man1/lskitcomp.1.pod b/xCAT-client/pods/man1/lskitcomp.1.pod index 413e7f6be..dfd6e307c 100644 --- a/xCAT-client/pods/man1/lskitcomp.1.pod +++ b/xCAT-client/pods/man1/lskitcomp.1.pod @@ -57,7 +57,7 @@ Return the output with XML tags. The data is returned as: -Each tag contains info for a group of kit compoonents belonging to the same kit. The info inside is structured as follows: +Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: The sub-tag contains the kit's name. The sub-tags store info about the kit's components. diff --git a/xCAT-client/pods/man1/lsslp.1.pod b/xCAT-client/pods/man1/lsslp.1.pod index 81d5cfdef..fe1e04cac 100755 --- a/xCAT-client/pods/man1/lsslp.1.pod +++ b/xCAT-client/pods/man1/lsslp.1.pod @@ -19,13 +19,13 @@ NOTE: SLP broadcast requests will propagate only within the subnet of the networ =head1 OPTIONS -B The nodes which the user want to discover. If the user specify the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. +B The nodes which the user wants to discover. If the user specifies the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. B<-i> IP(s) the command will send out (defaults to all available adapters). B<-h> Display usage message. -B<-n> Only display and write the newly discovered hardwares. +B<-n> Only display and write the newly discovered hardware. B<-u> Do unicast to a specified IP range. Must be used with B<-s> and B<--range>. The B<-u> flag is not supported on AIX. @@ -33,16 +33,16 @@ B<--range> Specify one or more IP ranges. Must be use in unicast mode. It ac B<-r> Display Raw SLP response. -B<-C> The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 secondes. The user can use -T flag the specify the time they want to use. A short time will limite the time costing, while a long time will help to find all the nodes. +B<-C> The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 seconds. The user can use -T flag the specify the time they want to use. A short time will limit the time costing, while a long time will help to find all the nodes. -B<-T> The number in seconds to limite the time costing of lsslp. +B<-T> The number in seconds to limit the time of lsslp. B<-s> Service type interested in discovering. B<-t> Number or service-request attempts. -B<--vpdtable> Output the SLP response in vpdtable formatting. Easy for writting data to vpd table. +B<--vpdtable> Output the SLP response in vpdtable formatting. Easy for writing data to vpd table. B<-v> Command Version. @@ -52,9 +52,9 @@ B<-w> Writes output to xCAT database. B<-x> XML format. -B<-z> Stanza formated output. +B<-z> Stanza formatted output. -B<-I> Give the warning message for the nodes in database which have no SLP responses. Note that this flag noly can be used after the database migration finished successfully. +B<-I> Give the warning message for the nodes in database which have no SLP responses. Note that this flag can only be used after the database migration finished successfully. =head1 RETURN VALUE diff --git a/xCAT-client/pods/man1/lstree.1.pod b/xCAT-client/pods/man1/lstree.1.pod index 182abe37b..618151539 100644 --- a/xCAT-client/pods/man1/lstree.1.pod +++ b/xCAT-client/pods/man1/lstree.1.pod @@ -10,7 +10,7 @@ B [B<-s> | B<--servicenode>] [B<-H> | B<--hardwaremgmt>] [B<-v> | B<--vi =head1 DESCRIPTION -The B command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to disply VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. +The B command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to display VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/lsvm.1.pod b/xCAT-client/pods/man1/lsvm.1.pod index d588fbf42..ac802ed7a 100644 --- a/xCAT-client/pods/man1/lsvm.1.pod +++ b/xCAT-client/pods/man1/lsvm.1.pod @@ -248,7 +248,7 @@ Output is similar to: Bytes per BSR array: 4096 Available BSR array: 256 -Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. +Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class description)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. 9. For DFM-managed partition on normal power machine, list out the detailed information: diff --git a/xCAT-client/pods/man1/mkdef.1.pod b/xCAT-client/pods/man1/mkdef.1.pod index 8f5cdb899..af59220b2 100644 --- a/xCAT-client/pods/man1/mkdef.1.pod +++ b/xCAT-client/pods/man1/mkdef.1.pod @@ -50,7 +50,7 @@ A set of comma delimited object types. Use the help option to get a list of val =item B<--template> I -Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of B command. If there are a template and an existing object with the same name I, the tempalte object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of B<--template> option in L. +Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of B command. If there are a template and an existing object with the same name I, the template object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of B<--template> option in L. =item B<-V|--verbose> @@ -58,7 +58,7 @@ 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 commmand, 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. diff --git a/xCAT-client/pods/man1/mkdocker.1.pod b/xCAT-client/pods/man1/mkdocker.1.pod index 1f9ee535c..dcb4eb0e4 100644 --- a/xCAT-client/pods/man1/mkdocker.1.pod +++ b/xCAT-client/pods/man1/mkdocker.1.pod @@ -82,7 +82,7 @@ Output is similar to: host01c01: Pull image ubuntu start host01c01: Pull image ubuntu done host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success 2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". @@ -92,7 +92,7 @@ Output is similar to: Output is similar to: host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success =head1 SEE ALSO diff --git a/xCAT-client/pods/man1/mkdsklsnode.1.pod b/xCAT-client/pods/man1/mkdsklsnode.1.pod index 5e0a95278..3b51f160f 100644 --- a/xCAT-client/pods/man1/mkdsklsnode.1.pod +++ b/xCAT-client/pods/man1/mkdsklsnode.1.pod @@ -19,7 +19,7 @@ This command will also create a NIM resolv_conf resource to be used when install The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -41,11 +41,11 @@ You can use the "-n" option of the mkdsklsnode command to create and initialize B When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes. The NIM resources should not be shared between the old osimage and the new osimage. -You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. +You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. After the mkdsklsnode command completes you can use the B command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/mknimimage.1.pod b/xCAT-client/pods/man1/mknimimage.1.pod index 78dc2b00e..700ccdc43 100644 --- a/xCAT-client/pods/man1/mknimimage.1.pod +++ b/xCAT-client/pods/man1/mknimimage.1.pod @@ -24,7 +24,7 @@ B When creating a diskless osimage definition you also have the option of automatically updating the NIM SPOT resource. You can have additional software installed or you can have configuration files added or updated. To have software installed you must provide either the names of NIM installp_bundle resources or fileset names on the command line using the "attr=val" option. You may also supply the installp flags, RPM flags, emgr flags to use when installing the software. -To have configuration files updated you must provide the full path name of a "synclists" file which contains the the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. +To have configuration files updated you must provide the full path name of a "synclists" file which contains the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. B @@ -50,7 +50,7 @@ You can use the "-i" and "-p" options to copy an existing diskless osimage. To - any other resources (or attributes) included in the original osimage will be included in the new osimage definition. -- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redfined to NIM. (The default would be to use the original lpp_source - to save file system space.) +- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redefined to NIM. (The default would be to use the original lpp_source - to save file system space.) B @@ -67,7 +67,7 @@ To list a NIM resource definition use the AIX B command ("lsnim -l command ("nim -o check "). -To remove specific NIM resource definitons use the AIX B command. ("nim -o remove "). +To remove specific NIM resource definitions use the AIX B command. ("nim -o remove "). =head1 OPTIONS @@ -187,7 +187,7 @@ Value Specifies the security method required for NFS access. =back -Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). +Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma separated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). =item B<-b> I @@ -195,7 +195,7 @@ Used to specify the path name of a mksysb file to use when defining a NIM mksysb =item B<-c|--completeosimage> -Complete the creation of the osimage definition passed in on the command line. This option will use any additonal values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. +Complete the creation of the osimage definition passed in on the command line. This option will use any additional values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. =item B<-f|--force> @@ -333,7 +333,7 @@ The xCAT osimage definition created by this command will include the "otherpkgs" mknimimage -u 61dskls installp_bundle=bndres1,bndres2 installp_flags="-agcQX" -Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definiton is not used or updated. +Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definition is not used or updated. 13) Update an existing image to support NFSv4. Also specify verbose messages. diff --git a/xCAT-client/pods/man1/mkvm.1.pod b/xCAT-client/pods/man1/mkvm.1.pod index 700521841..fd98f4525 100644 --- a/xCAT-client/pods/man1/mkvm.1.pod +++ b/xCAT-client/pods/man1/mkvm.1.pod @@ -88,7 +88,7 @@ Request to create a new full system partition for each CEC. =item B I B I B I B I B I B I [B<--vios>] -To specify the parameters which are used to create a partition. The I, I are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. +To specify the parameters which are used to create a partition. The I, I are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. The option I is used to specify the partition that will be created is a VIOS partition. If specified, the value for I shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for I, all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of I to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. @@ -241,7 +241,7 @@ First, define a node object: mkdef -t node -o lpar1 mgt=fsp cons=fsp nodetype=ppc,osi id=1 hcp=cec parent=cec hwtype=lpar groups=lpar,all -Then, create the partion on the specified cec. +Then, create the partition on the specified cec. mkvm lpar1 --full @@ -321,7 +321,7 @@ The output is similar to: mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios -The resouces for the node is similar to: +The resources for the node is similar to: viosnode: Lpar Processor Info: Curr Processor Min: 1. diff --git a/xCAT-client/pods/man1/monadd.1.pod b/xCAT-client/pods/man1/monadd.1.pod index 1e587afdd..1ad4bd093 100644 --- a/xCAT-client/pods/man1/monadd.1.pod +++ b/xCAT-client/pods/man1/monadd.1.pod @@ -18,9 +18,9 @@ This command is used to register a monitoring plug-in module to monitor the xCAT =head1 Parameters -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. -I is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: I<-s key-value -s key=value ...> Note that the square brackets are needed here. Use I command to look for the possbile setting keys for a plug-in module. +I is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: I<-s key-value -s key=value ...> Note that the square brackets are needed here. Use I command to look for the possible setting keys for a plug-in module. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/moncfg.1.pod b/xCAT-client/pods/man1/moncfg.1.pod index a1fc5a20c..47a3bba3a 100644 --- a/xCAT-client/pods/man1/moncfg.1.pod +++ b/xCAT-client/pods/man1/moncfg.1.pod @@ -15,12 +15,12 @@ B I I<[noderange]> B<[-r|--remote]> =head1 DESCRIPTION -This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified, though the configuration of the nodes is usually performed during the node deployment stage. +This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configuration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified, though the configuration of the nodes is usually performed during the node deployment stage. =head1 Parameters -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. I specifies the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/xCAT-client/pods/man1/mondecfg.1.pod b/xCAT-client/pods/man1/mondecfg.1.pod index 1884ab1b1..6f7ccc753 100644 --- a/xCAT-client/pods/man1/mondecfg.1.pod +++ b/xCAT-client/pods/man1/mondecfg.1.pod @@ -15,7 +15,7 @@ B I I<[noderange]> B<[-r|--remote]> =head1 DESCRIPTION -This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified. The deconfigration operation will remove the nodes from the 3rd party software's monitoring domain. +This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified. The deconfiguration operation will remove the nodes from the 3rd party software's monitoring domain. =head1 PARAMETERS diff --git a/xCAT-client/pods/man1/monls.1.pod b/xCAT-client/pods/man1/monls.1.pod index 55cd86498..c9130a98e 100644 --- a/xCAT-client/pods/man1/monls.1.pod +++ b/xCAT-client/pods/man1/monls.1.pod @@ -15,7 +15,7 @@ B =head1 DESCRIPTION -This command is used to list the status, desctiption, the configuration scripts and the settings of one or all of the monitoring plug-in modules. +This command is used to list the status, description, the configuration scripts and the settings of one or all of the monitoring plug-in modules. =head1 Parameters @@ -26,9 +26,9 @@ I is the name of the monitoring plug-in module. =head1 OPTIONS -B<-a | --all> Searches the I directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the I tabel. +B<-a | --all> Searches the I directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the I table. -B<-d | --description> Display the description of the plug-in modules. The description ususally contains the possible settings. +B<-d | --description> Display the description of the plug-in modules. The description usually contains the possible settings. B<-h | --help> Display usage message. @@ -64,7 +64,7 @@ The output looks like this: nagiosmon not-monitored -3. To list the status and the desciption for I module, enter: +3. To list the status and the description for I module, enter: monls snmpmon -d diff --git a/xCAT-client/pods/man1/monshow.1.pod b/xCAT-client/pods/man1/monshow.1.pod index 22d4309f9..c3aa85385 100755 --- a/xCAT-client/pods/man1/monshow.1.pod +++ b/xCAT-client/pods/man1/monshow.1.pod @@ -36,7 +36,7 @@ B<-t> specifies a range of time for the data, The default is last 60 minutes. Fo B<-a> specifies a comma-separated list of attributes or metrics names. The default is all. -B<-w> specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, serverity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. +B<-w> specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, severity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. Operator descriptions: diff --git a/xCAT-client/pods/man1/monstart.1.pod b/xCAT-client/pods/man1/monstart.1.pod index 624fad4fa..092d6a399 100644 --- a/xCAT-client/pods/man1/monstart.1.pod +++ b/xCAT-client/pods/man1/monstart.1.pod @@ -18,7 +18,7 @@ This command is used to start a 3rd party software, (for example start the daemo =head1 PARAMETERS -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use B command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use B command to list all the monitoring plug-in modules that can be used. I is the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/xCAT-client/pods/man1/nimnodecust.1.pod b/xCAT-client/pods/man1/nimnodecust.1.pod index ea5eaa711..93cba2a36 100644 --- a/xCAT-client/pods/man1/nimnodecust.1.pod +++ b/xCAT-client/pods/man1/nimnodecust.1.pod @@ -30,9 +30,9 @@ To create a NIM installp_bundle definition you can use the "nim -o define" opera nim -o define -t installp_bundle -a server=master -a location=/install/nim/mypkgs.bnd mypackages -See the AIX documantation for more information on using installp_bundle files. +See the AIX documentation for more information on using installp_bundle files. -The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierachical environment. +The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierarchical environment. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/nimnodeset.1.pod b/xCAT-client/pods/man1/nimnodeset.1.pod index 2e9b9835f..04ecd9587 100644 --- a/xCAT-client/pods/man1/nimnodeset.1.pod +++ b/xCAT-client/pods/man1/nimnodeset.1.pod @@ -14,7 +14,7 @@ This xCAT command can be used to initialize AIX/NIM standalone machines. Once th If you are using xCAT service nodes the B command will automatically determine the correct server(s) for the node and do the initialization on that server(s). -The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definiions. +The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definitions. This command will also create a NIM resolv_conf resource to be used when installing the node. If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes. @@ -22,7 +22,7 @@ NIM resolv_conf resource will be created and allocated to the nodes. The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -35,13 +35,13 @@ will be created. You can specify additional attributes and values using the "attr=val" command line option. This information will be passed on to the underlying call to the NIM "nim -o bos_inst" command. See the NIM documentation for information on valid command line options for the nim command. The "attr" must correspond to a NIM attribute supported for the NIM "bos_inst" operation. Information provided by the "attr=val" option will take precedence over the information provided in the osimage definition. -The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. +The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. This command will also create a NIM script resource to enable the xCAT support for user-provided customization scripts. After the B command completes you can use the B command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 OPTIONS @@ -50,7 +50,7 @@ You can supply your own scripts to be run on the management node or on the serv =item I Specifies one or more "attribute equals value" pairs, separated by spaces. Attr= -val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma seperated list. (ex. "script=ascript,bscript"). +val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma separated list. (ex. "script=ascript,bscript"). =item B<-b|--backupSN> @@ -70,8 +70,7 @@ The name of an existing xCAT osimage definition. =item B<-l|--location> -The directory location to use when creating new NIM resolv_conf resources. The d -efault location is /install/nim. +The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim. =item B<-p|--primarySN> diff --git a/xCAT-client/pods/man1/nodeaddunmged.1.pod b/xCAT-client/pods/man1/nodeaddunmged.1.pod index 60258c7a0..675daa669 100644 --- a/xCAT-client/pods/man1/nodeaddunmged.1.pod +++ b/xCAT-client/pods/man1/nodeaddunmged.1.pod @@ -34,7 +34,7 @@ Sets the IP address of the unmanaged node, where I is the IP address 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodechmac.1.pod b/xCAT-client/pods/man1/nodechmac.1.pod index 593b20a51..0bf9830f8 100644 --- a/xCAT-client/pods/man1/nodechmac.1.pod +++ b/xCAT-client/pods/man1/nodechmac.1.pod @@ -36,7 +36,7 @@ Sets the new MAC address for the NIC used by the provisioning node, where is 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverls.1.pod b/xCAT-client/pods/man1/nodediscoverls.1.pod index 5b6af9bf6..bde7b37e0 100644 --- a/xCAT-client/pods/man1/nodediscoverls.1.pod +++ b/xCAT-client/pods/man1/nodediscoverls.1.pod @@ -76,7 +76,7 @@ Command version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstart.1.pod b/xCAT-client/pods/man1/nodediscoverstart.1.pod index 165a68d5a..4e3b98d37 100755 --- a/xCAT-client/pods/man1/nodediscoverstart.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstart.1.pod @@ -52,7 +52,7 @@ When the nodes are discovered, PCM updates the affected configuration files on t When you power on the nodes, they PXE boot and DHCP/TFTP/HTTP on the management node give each node the xCAT genesis boot image, which inventories the node hardware and sends data to the management node. There, either the sequential discovery process or the -profile discovery process assigns node attributes and defines the node in the the database. +profile discovery process assigns node attributes and defines the node in the database. =head1 OPTIONS @@ -99,7 +99,7 @@ Sets the node groups that the discovered nodes should be put in for either the S Sets the rack name where the node is located for either the Sequential Discovery or Profile Discovery methods. -=item BI +=item BI Sets the chassis name that the Blade server or PureFlex blade is located in, for either the Sequential Discovery or Profile Discovery methods. This option is used for the Blade server and PureFlex system only. You cannot specify this option with the rack option. @@ -146,7 +146,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstatus.1.pod b/xCAT-client/pods/man1/nodediscoverstatus.1.pod index 2e261fdef..f65597e40 100644 --- a/xCAT-client/pods/man1/nodediscoverstatus.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstatus.1.pod @@ -25,7 +25,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstop.1.pod b/xCAT-client/pods/man1/nodediscoverstop.1.pod index 8cde9a0cb..b8ce5b563 100644 --- a/xCAT-client/pods/man1/nodediscoverstop.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstop.1.pod @@ -26,7 +26,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodeimport.1.pod b/xCAT-client/pods/man1/nodeimport.1.pod index 30087957b..2c3b670f7 100644 --- a/xCAT-client/pods/man1/nodeimport.1.pod +++ b/xCAT-client/pods/man1/nodeimport.1.pod @@ -10,7 +10,7 @@ B B I B I command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location infomation like rack, chassis, start unit, server height...etc +The B command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location information like rack, chassis, start unit, server height...etc After nodes imported, the configuration files related with these nodes will be updated automatically. For example: /etc/hosts, dns configuration, dhcp configuration. And the kits node plugins will also be triggered automatically to update kit related configuration/services. @@ -56,9 +56,9 @@ Sets the node groups that the imported node belongs to, where is a 0 The command completed successfully. -1 An error has occured while validating parameters. +1 An error has occurred while validating parameters. -2 An error has occured while parsing hostinfo file. +2 An error has occurred while parsing hostinfo file. =head1 EXAMPLES @@ -106,7 +106,7 @@ To import nodes using a profile, follow the following steps: # hostinfo end. - Another example of a node infomation file, a PureFlex X/P node defined: + Another example of a node information file, a PureFlex X/P node defined: # hostinfo begin # To define a PureFlex P/X node, chassis and slot id must be specified. # The chassis must be a PureFlex chassis. @@ -153,7 +153,7 @@ Description: The name of the node, where __hostname__ is automatically generated B> This is a mandatory item. -Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. +Description: Specify the MAC address for the NIC used by the provisioning node, where is the NICs MAC address. B> This is a mandatory item, when define switch, switchport and node nic name relationship. @@ -183,9 +183,9 @@ B> This is an optional item. Description: node location info. Specify the rack name which this node will be placed into. If not specify this item, there will be no node location info set for this node. this item must be specified together with height + unit. -B> This is an optional item. +B> This is an optional item. -Description: node location info, for blade(or PureFlex) only. Specify the chasiss name which this blade will be placed into. this item can not be specified together with rack. +Description: node location info, for blade(or PureFlex) only. Specify the chassis name which this blade will be placed into. this item can not be specified together with rack. B> This is an optional item. diff --git a/xCAT-client/pods/man1/nodels.1.pod b/xCAT-client/pods/man1/nodels.1.pod index b976091bf..e3e76cd58 100644 --- a/xCAT-client/pods/man1/nodels.1.pod +++ b/xCAT-client/pods/man1/nodels.1.pod @@ -75,7 +75,7 @@ Force display of table name and column name context for each result =item B<-b|--blame> -For values inherited from groups, display which groups provided the inheritence +For values inherited from groups, display which groups provided the inheritance =item B<-S> diff --git a/xCAT-client/pods/man1/nodepurge.1.pod b/xCAT-client/pods/man1/nodepurge.1.pod index 73b6a94ba..714f164f2 100644 --- a/xCAT-client/pods/man1/nodepurge.1.pod +++ b/xCAT-client/pods/man1/nodepurge.1.pod @@ -32,7 +32,7 @@ The nodes to be removed. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/noderefresh.1.pod b/xCAT-client/pods/man1/noderefresh.1.pod index b25693c71..cafd50986 100644 --- a/xCAT-client/pods/man1/noderefresh.1.pod +++ b/xCAT-client/pods/man1/noderefresh.1.pod @@ -30,7 +30,7 @@ The nodes to be updated. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodestat.1.pod b/xCAT-client/pods/man1/nodestat.1.pod index 42a0dc5f0..fd964a3c9 100644 --- a/xCAT-client/pods/man1/nodestat.1.pod +++ b/xCAT-client/pods/man1/nodestat.1.pod @@ -41,7 +41,7 @@ Keywords to use: port -- the application daemon port number, if not specified, use internal list, then /etc/services. group -- the name of a node group that needs to get the application status from. If not specified, assume all the nodes in the nodelist table. To specify more than one groups, use group=a,group=b format. cmd -- the command that will be run locally on mn or sn. - lcmd -- the command that will be run the the mn only. + lcmd -- the command that will be run the mn only. dcmd -- the command that will be run distributed on the nodes using xdsh .... For commands specified by 'cmd' and 'lcmd', the input of is a list of comma separated node names, the output must be in the following format: @@ -63,7 +63,7 @@ Uses fping instead of nmap even if nmap is available. If you seem to be having =item B<-m>|B<--usemon> -Uses the settings from the B talbe to determine a list of applications that need to get status for. +Uses the settings from the B table to determine a list of applications that need to get status for. =item B<-p>|B<--powerstat> diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index de1f11e60..091eec11a 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -40,7 +40,7 @@ The command will update firmware for NeXtScale FPC when given an FPC node and th =head2 PPC (with HMC) specific: -The B command uses the B command to connect to the HMC controlling the given managed system and perform the updates. Before running B, use B to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B comamnd. +The B command uses the B command to connect to the HMC controlling the given managed system and perform the updates. Before running B, use B to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B command. B This command may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. @@ -50,7 +50,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f The B<--commit> flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The B<--recover> flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored. -BWhen the B<--commit> or B<--recover> two flags is used, the noderange B be BPA. It only B be CEC or LPAR ,and will take effect for B managed systems and power subsystems. +BWhen the B<--commit> or B<--recover> two flags is used, the noderange B be BPA. It only B be CEC or LPAR, and will take effect for B managed systems and power subsystems. xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems. @@ -68,7 +68,7 @@ The B option will load the new firmware into the T (temp) side, but wi In Direct FSP/BPA Management, there is B<-d> I option. The default value is /tmp. When doing firmware update, B will put some related data from rpm packages in directory, so the execution of B will require available disk space in for the command to properly execute: -For one GFW rpm package and one power code rpm package , if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5*gfw_rpmsize + 1.5*power_rpmsize +For one GFW rpm package and one power code rpm package, if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5*gfw_rpmsize + 1.5*power_rpmsize For Power 775, the B command takes effect on the primary and secondary FSPs or BPAs almost in parallel. @@ -76,7 +76,7 @@ For more details about the Firmware Update using Direct FSP/BPA Management, refe =head2 NeXtScale FPC specific: -The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters +The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters =head2 OpenPOWER specific: @@ -92,7 +92,7 @@ Writes the command's usage statement to standard output. =item B<-c|--check> -Chech the firmware version of BMC and HPM file. +Check the firmware version of BMC and HPM file. =item B<-p> I @@ -139,12 +139,12 @@ Verbose output. =over 4 =item 1. -To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: rflash cec_name -p /tmp/fw --activate disruptive =item 2. -To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: rflash bpa_name -p /tmp/fw --activate disruptive @@ -154,7 +154,7 @@ To commit a firmware update to permanent flash for both managed system and the r rflash cec_name --commit =item 4. -To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: +To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: rflash fpc01 http://10.1.147.169/install/firmware/fhet17a/ibm_fw_fpc_fhet17a-2.02_anyos_noarch.rom diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index e0799d15b..52ed22ccc 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -8,15 +8,15 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] =head2 BMC/MPA specific: -B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B|B] -=head2 OpenPOWER (using ipmi) server specific: +=head2 OpenPOWER (IPMI) server specific: -B I {B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B] -=head2 OpenPOWER (using openbmc) server specific: +=head2 OpenPOWER (OpenBMC) server specific: -B I {B|B|B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B] [B<-V>|B<--verbose>] =head2 PPC (with HMC) specific: @@ -40,7 +40,6 @@ B I [B<-t>] B I - =head2 zVM specific: B I [B|B] @@ -69,27 +68,22 @@ B I [B<--zfcppoolnames>] =head1 B -B retrieves hardware configuration information from the on-board +B retrieves hardware configuration information from the on-board Service Processor for a single or range of nodes and groups. -Calling B for VMware will display the UUID/GUID, nuumber of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. +Calling B for VMware will display the UUID/GUID, number of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. =head1 B =over 7 -=item B - -Retrieves PCI bus information. - =item B List all buses for each I/O slot. =item B -Retrieves number of processors, speed, total memory, and DIMM -locations. +Retrieves number of processors, speed, total memory, and DIMM locations. =item B @@ -113,7 +107,7 @@ To output the raw information of deconfigured resources for CEC. =item B -Retrieves asset tag. Usually it's the MAC address of eth0. +Retrieves asset tag. Usually it's the MAC address of eth0. =item B @@ -125,19 +119,23 @@ Diagnostics information of firmware. =item B -Retrieves mprom firmware level +Retrieves mprom firmware level. + +=item B + +Retrieves dual in-line memory module information. =item B -Retrieves device identification. Usually device, manufacturing and product ids. +Retrieves device identification. Usually device, manufacturing and product IDs. =item B -Retrieves the universally unique identifier +Retrieves the universally unique identifier. =item B -Retrieves the global unique identifier +Retrieves the global unique identifier . =item B @@ -151,6 +149,10 @@ Print help. Print version. +=item B<-V>|B<--verbose> + +Prints verbose output, if available. + =item B<-t> Set the values in the vm table to what vCenter has for the indicated nodes. diff --git a/xCAT-client/pods/man1/rmdocker.1.pod b/xCAT-client/pods/man1/rmdocker.1.pod index efe339027..d02992870 100644 --- a/xCAT-client/pods/man1/rmdocker.1.pod +++ b/xCAT-client/pods/man1/rmdocker.1.pod @@ -29,7 +29,7 @@ Force to removal of a running container or failed to disconnect customized netwo =head1 EXAMPLES rmdocker host01c01 - host01c01: Disconnect customzied network 'mynet0' done + host01c01: Disconnect customized network 'mynet0' done host01c01: success =head1 SEE ALSO diff --git a/xCAT-client/pods/man1/rmdsklsnode.1.pod b/xCAT-client/pods/man1/rmdsklsnode.1.pod index 9500d2290..f7ed75e27 100644 --- a/xCAT-client/pods/man1/rmdsklsnode.1.pod +++ b/xCAT-client/pods/man1/rmdsklsnode.1.pod @@ -20,11 +20,11 @@ If the node you are trying to remove is currently running the B com B -If you used the "-n" option when you created the NIM client definitions with the B command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions you must provide the name of the osimage that was used using the "-i" option. +If you used the "-n" option when you created the NIM client definitions with the B command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions, you must provide the name of the osimage that was used using the "-i" option. -In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The B option can be used to remove the old alternate client defintions without stopping the running node. +In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The B option can be used to remove the old alternate client definitions without stopping the running node. -However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason it is recommended that you wait to do this cleanup until right before you do your next upgrade. +However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason, it is recommended that you wait to do this cleanup until right before you do your next upgrade. =head1 OPTIONS @@ -36,8 +36,7 @@ Use the force option to stop and remove running nodes. This handles the situatio =item B<-b |--backupSN> -When using backup service nodes only update the backup. The default is to updat -e both the primary and backup service nodes. +When using backup service nodes only update the backup. The default is to update both the primary and backup service nodes. =item B<-h |--help> @@ -53,8 +52,7 @@ A set of comma delimited node names and/or group names. See the "noderange" man =item B<-p|--primarySN> -When using backup service nodes only update the primary. The default is to upda -te both the primary and backup service nodes. +When using backup service nodes only update the primary. The default is to update both the primary and backup service nodes. =item B<-r|--remdef> diff --git a/xCAT-client/pods/man1/rmhwconn.1.pod b/xCAT-client/pods/man1/rmhwconn.1.pod index 86ea9a15e..d0dd7cad9 100644 --- a/xCAT-client/pods/man1/rmhwconn.1.pod +++ b/xCAT-client/pods/man1/rmhwconn.1.pod @@ -24,7 +24,7 @@ B B<-s> For PPC (with HMC) specific: -This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc talbe in xCAT DB. +This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc table in xCAT DB. Note: If a CEC belongs to a frame with a BPA installed, this CEC cannot be disconnected individually. Instead, the whole frame should be disconnected. diff --git a/xCAT-client/pods/man1/rmigrate.1.pod b/xCAT-client/pods/man1/rmigrate.1.pod index fea02a867..2be54a94f 100644 --- a/xCAT-client/pods/man1/rmigrate.1.pod +++ b/xCAT-client/pods/man1/rmigrate.1.pod @@ -49,7 +49,7 @@ The maximum quiesce time a VM may be stopped during a relocation attempt. =head1 B B table - -Table governing VM paramaters. See L for further details. +Table governing VM parameters. See L for further details. This is used to determine the current host to migrate from. =head1 B diff --git a/xCAT-client/pods/man1/rmkitcomp.1.pod b/xCAT-client/pods/man1/rmkitcomp.1.pod index 591f0cfd7..5484300dc 100644 --- a/xCAT-client/pods/man1/rmkitcomp.1.pod +++ b/xCAT-client/pods/man1/rmkitcomp.1.pod @@ -10,7 +10,7 @@ B [B<-V>|B<--verbose>] [B<-u>|B<--uninstall>] [B<-f>|B<--force>] [B<- =head1 DESCRIPTION -The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit comoponent meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. +The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. Note: The xCAT support for Kits is only available for Linux operating systems. diff --git a/xCAT-client/pods/man1/rmvm.1.pod b/xCAT-client/pods/man1/rmvm.1.pod index 959a350d8..2dcf8cc67 100644 --- a/xCAT-client/pods/man1/rmvm.1.pod +++ b/xCAT-client/pods/man1/rmvm.1.pod @@ -37,7 +37,7 @@ B<-r> Retain the data object definitions of the nodes. B<--service> Remove the service partitions of the specified CECs. -B<-p> KVM: Purge the existence of the VM from persistant storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partiton on normal power machine. +B<-p> KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partition on normal power machine. B<-f> Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. diff --git a/xCAT-client/pods/man1/rnetboot.1.pod b/xCAT-client/pods/man1/rnetboot.1.pod index 6b9fc9671..e968e9f2d 100644 --- a/xCAT-client/pods/man1/rnetboot.1.pod +++ b/xCAT-client/pods/man1/rnetboot.1.pod @@ -41,11 +41,11 @@ Note: if the "val" fields includes spaces or any other characters that will be p B<-r> -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. B<-t> -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. B<-V|--verbose> diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index 61e7be87c..0e38e78c8 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -14,13 +14,13 @@ B I [B|B|B|B|B|B|B I [B|B|B|B] -=head2 OpenPower BMC (using IPMI): +=head2 OpenPOWER BMC (using IPMI): B I [B|B|B|B|B|B|B] B I [B|B|B|B] -=head2 OpenPower OpenBMC: +=head2 OpenPOWER OpenBMC: B I [B|B|B|B|B|B|B] @@ -104,7 +104,7 @@ Exit Rack standby will be the default state that a rack goes into when power is =item B -Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the sametime. +Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the same time. =item B @@ -207,11 +207,11 @@ Do not use dependency table (default is to use dependency table). Valid only wit =item B<-r> I -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. =item B<-t> I -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. Power off, then on. diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index 900224f65..aba5fcd5a 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -416,7 +416,7 @@ Set the blade or MPA textid. When using '*', the textid used is the node name sp =item B={I} B={B} -Change the password of the userid B for CMM in Flex system cluster. The option I can be used to specify whether updating the password of BMCs that connected to the speified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. +Change the password of the userid B for CMM in Flex system cluster. The option I can be used to specify whether updating the password of BMCs that connected to the specified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. If value "*" is specified for USERID and the object node is I, the password used to access the BMC of the System X node through IPMI will be updated as the same password of the userid B of the CMM in the same cluster. diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index 32ff2fb81..fb246eb40 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -26,13 +26,17 @@ B I {B|B|B|B|B|B I {B|B|B|B|B|B|B} -=head2 OpenPOWER server specific: +=head2 OpenPOWER (IPMI) specific: -B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B|B] + +=head2 OpenPOWER (OpenBMC) specific: + +B I [B|B|B|B|B|B|B] =head1 B -B retrieves hardware vital information from the on-board Service +B Retrieves hardware vital information from the on-board Service Processor for a single or range of nodes and groups. =head1 B @@ -75,6 +79,14 @@ Retrieves rack environmentals. Retrieves LEDs status. +=item B + +Retrieves chassis status. + +=item B + +Retrieves altitude related attributes. + =item B Retrieves power status. diff --git a/xCAT-client/pods/man1/sinv.1.pod b/xCAT-client/pods/man1/sinv.1.pod index 9c08ced7e..b81db7b57 100644 --- a/xCAT-client/pods/man1/sinv.1.pod +++ b/xCAT-client/pods/man1/sinv.1.pod @@ -95,7 +95,7 @@ If there is no match, and we are not over the template count, then a new template will be created from the node output. This will result in having all nodes that match a given template reported in their group at the end of the run in the output file. -If no template count is specified, 0 is the default, and all nodes will +If no template count is specified, 0 is the default, and all nodes will be compared against the first template. =item B<-s>|B<--seed> I @@ -104,7 +104,7 @@ This is the node that will be used to build the first template that is stored in template path. You can use this parameter instead of running the command yourself to build the template. -B If the template path file does not exists, and no seed node is +B If the template path file does not exist, and no seed node is supplied, the seed node automatically is one node in the noderange. @@ -126,7 +126,7 @@ template (except for xdshcoll header and comments). If not in exactmatch mode, there can exist more lines in the xdsh return from the nodes. For example, if running a "rpm -qa | grep xCAT" command, without exactmatch -set, if the node containes more xCAT rpms that listed in the template, +set, if the node contains more xCAT rpms that listed in the template, it would be considered a match, as long as all rpms listed in the template were on the node. With exactmatch set, the output must be identical to the template. @@ -137,7 +137,7 @@ Specify a user-defined device type that references the location of relevant device configuration file. The devicetype value must correspond to a valid device configuration file. xCAT ships some default configuration files -for Ethernet switches and and IB switches under +for Ethernet switches and IB switches under I directory. If you want to overwrite any of the configuration files, copy them to I directory and cutomize. diff --git a/xCAT-client/pods/man1/snmove.1.pod b/xCAT-client/pods/man1/snmove.1.pod index 477ba7ea6..d1e4fad4d 100644 --- a/xCAT-client/pods/man1/snmove.1.pod +++ b/xCAT-client/pods/man1/snmove.1.pod @@ -40,7 +40,7 @@ node is second. The B attribute must be set to the hostname of the primary service node as it is known by the node. When the B command is run it modifies the xCAT database to -switch the the primary server to the backup server. +switch the primary server to the backup server. It will also check the other services that are being used for the node (tftpserver, monserver, nfsserver, conserver), and if they were set @@ -84,11 +84,11 @@ No modifications will be made on the nodes. If not specified, several xCAT posts =item B<-l|--liteonly> -Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of thre nodes the the backup servers. +Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of the nodes to the backup servers. =item B<-P|--postscripts> -Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new serive node. If B is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. +Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service node. If B is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory. =item B<-s|--source> diff --git a/xCAT-client/pods/man1/swapnodes.1.pod b/xCAT-client/pods/man1/swapnodes.1.pod index c1e17308f..63b3c59f2 100644 --- a/xCAT-client/pods/man1/swapnodes.1.pod +++ b/xCAT-client/pods/man1/swapnodes.1.pod @@ -25,7 +25,7 @@ The B command shouldn't make the decision of which 2 nodes are swappe After running B command, the order of the I/O devices may be changed after IO re-assignment, so the administrator needs to run B to set the boot string for the current_node. And then boot the node with the same image and same postscripts because they have the same attributes. -Without B<-o> option, it's used to swap the location info in the db between 2 nodes. With B<-o> option, it's used to move the I definition to I (the 2nd octant), not move the I definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the I is a defective non-compute node, and I is a avaible compute node. After the swapping, the I will be a available node. +Without B<-o> option, it's used to swap the location info in the db between 2 nodes. With B<-o> option, it's used to move the I definition to I (the 2nd octant), not move the I definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the I is a defective non-compute node, and I is a available compute node. After the swapping, the I will be a available node. =head1 OPTIONS @@ -61,12 +61,12 @@ one way. Only move the I definition to the I's hardware =over 3 =item 1. -To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped, and the the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. +To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped, and the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. swapnodes -c sn1 -f compute2 =item 2. -To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. +To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. swapnodes -c sn1 -f compute2 diff --git a/xCAT-client/pods/man1/switchdiscover.1.pod b/xCAT-client/pods/man1/switchdiscover.1.pod index 7bcdbc27b..ec16fcaad 100755 --- a/xCAT-client/pods/man1/switchdiscover.1.pod +++ b/xCAT-client/pods/man1/switchdiscover.1.pod @@ -16,13 +16,13 @@ B [I | B<--range> I] B<[-V] [-w][-r|-x|-z] =head1 DESCRIPTION -The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format. +The switchdiscover command scans the subnets and discovers all the switches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format. B<--setup> flag is for switch-based switch discovery. It will find all the discovered switches on the subnets, then match them with predefined switches in the xCATDB. Next, it will set discovered switches with static ip address and hostname based on the predefined switch. It will also enable snmpv3 configuration. The details of the process are defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html. -To view all the switches defined in the xCAT databasee use B command. +To view all the switches defined in the xCAT database use B command. -For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep packge or you can get it from http://vincentbernat.github.io/lldpd/installation.html. +For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html. For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. @@ -77,11 +77,11 @@ Writes output to xCAT database. =item B<-x> -XML formated output. +XML formatted output. =item B<-z> -Stanza formated output. +Stanza formatted output. =item B<--setup> diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index 5f7f060f2..582a9da26 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -249,7 +249,7 @@ A comma-separated list of script names. The scripts must be executable and copied to the /install/postscripts directory. Each script can take zero or more parameters. -If parameters are spcified, the whole list needs to be quoted by double quotes. +If parameters are specified, the whole list needs to be quoted by double quotes. For example: "script1 p1 p2,script2" @@ -259,7 +259,7 @@ For example: Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. The currently supported attributes are: "installp_bundle", "otherpkgs", "installp_flags", -"emgr_flags" and "rpm_flags". These attribute are only valid for AIX software +"emgr_flags" and "rpm_flags". These attributes are only valid for AIX software maintenance support. =back @@ -270,9 +270,7 @@ maintenance support. =item B<--fanout>=I -Specifies a fanout value for the maximum number of concur- -rently executing remote shell processes. Serial execution -can be specified by indicating a fanout value of B<1>. If B<--fanout> is not specified, a default fanout value of B<64> is used. +Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of B<1>. If B<--fanout> is not specified, a default fanout value of B<64> is used. =item B<-A|--updateallsw> @@ -340,7 +338,7 @@ Specifies a non-root user name to use for remote command execution. This option AIX and Linux and updating software (-S) for Linux only. The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. -This is not supported in a hiearchical cluster, that is the node is serviced by a service node. +This is not supported in a hierarchical cluster, that is the node is serviced by a service node. See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. diff --git a/xCAT-client/pods/man1/xcat2nim.1.pod b/xCAT-client/pods/man1/xcat2nim.1.pod index 97e7e9aee..318aad0df 100644 --- a/xCAT-client/pods/man1/xcat2nim.1.pod +++ b/xCAT-client/pods/man1/xcat2nim.1.pod @@ -98,7 +98,7 @@ B<-V|--verbose> Verbose mode. xcat2nim -l -t node clstrn02 -7. To re-create a NIM machine definiton and display verbose output. +7. To re-create a NIM machine definition and display verbose output. xcat2nim -V -t node -f clstrn05 diff --git a/xCAT-client/pods/man8/makedns.8.pod b/xCAT-client/pods/man8/makedns.8.pod index e74603548..8366b8c8e 100644 --- a/xCAT-client/pods/man8/makedns.8.pod +++ b/xCAT-client/pods/man8/makedns.8.pod @@ -24,7 +24,7 @@ The B value should be set to the IP address of one or more nameserve An xCAT B definition must be defined for each network used in the cluster. The B and B attributes will be used by the B command. -A network B and B values must be provided either in the B definiton corresponding to the node or in the B definition. +A network B and B values must be provided either in the B definition corresponding to the node or in the B definition. Only entries in /etc/hosts or the hosts specified by B that have a corresponding xCAT network definition will be added to DNS. diff --git a/xCAT-client/pods/man8/makeknownhosts.8.pod b/xCAT-client/pods/man8/makeknownhosts.8.pod index 612c04b7e..99047d1cb 100644 --- a/xCAT-client/pods/man8/makeknownhosts.8.pod +++ b/xCAT-client/pods/man8/makeknownhosts.8.pod @@ -4,7 +4,7 @@ B - Make a known_hosts file under $ROOTHOME/.ssh for input noder =head1 SYNOPSIS -B I [B<-r>|B<--remove>] [B<-V>|B<--verbose>] +B I [B<-r>|B<--remove>|B<-d>|B<--delete>] [B<-V>|B<--verbose>] B [B<-h>|B<--help>] @@ -29,10 +29,14 @@ The file should be distributed using B to all the nodes, if you want node A set of comma delimited node names and/or group names. See the I man page for details on supported formats. -=item B<-r|--remove> +=item B<-d|--delete> Only removes the entries for the nodes from the known_hosts file. +=item B<-r|--remove> + +Synonymous to B<-d|--delete>. + =item B<-V|--verbose> Verbose mode. @@ -56,7 +60,7 @@ To build the known_hosts entry for the nodes in the lpars and service groups =item 3. To remove the known_hosts entry for node02 - makeknownhosts node02 -r + makeknownhosts node02 -d =back diff --git a/xCAT-client/pods/man8/makenetworks.8.pod b/xCAT-client/pods/man8/makenetworks.8.pod index 963fdde9f..771ff4eeb 100644 --- a/xCAT-client/pods/man8/makenetworks.8.pod +++ b/xCAT-client/pods/man8/makenetworks.8.pod @@ -16,7 +16,7 @@ The B command can be used to gather network information from an xC Every network that will be used to install a cluster node must be defined in the xCAT database. -The default behavior is to gather network information from the managment node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. +The default behavior is to gather network information from the management node, and any configured xCAT service nodes, and automatically save this information in the xCAT database. You can use the "-d" option to display the network information without writing it to the database. diff --git a/xCAT-client/pods/man8/makeroutes.8.pod b/xCAT-client/pods/man8/makeroutes.8.pod index b20e161e0..77b315ec4 100644 --- a/xCAT-client/pods/man8/makeroutes.8.pod +++ b/xCAT-client/pods/man8/makeroutes.8.pod @@ -16,7 +16,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 DESCRIPTION -The B command adds or deletes routes on the management node or any given nodes. The B specifies the nodes where the routes are to be added or removed. When the I is omitted, the action will be done on the management node. The B<-r> option specifies the name of routes. The details of the routes are defined in the B table which contians the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on B for the nodes or on B for the management node will be used. +The B command adds or deletes routes on the management node or any given nodes. The B specifies the nodes where the routes are to be added or removed. When the I is omitted, the action will be done on the management node. The B<-r> option specifies the name of routes. The details of the routes are defined in the B table which contains the route name, subnet, net mask and gateway. If -r option is omitted, the names of the routes found on B for the nodes or on B for the management node will be used. If you want the routes be automatically setup during node deployment, first put a list of route names to B and then add I script name to the B for the nodes. diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index bc8e2fb46..15618d46d 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -34,7 +34,7 @@ B only sets the next boot state, but does not reboot. B is called by B and B and is also called by the installation process remotely to set the boot state back to "boot". -A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of I table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of I table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 B @@ -77,7 +77,7 @@ for basic remote access. This causes the IP, netmask, gateway, username, and pa =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B diff --git a/xCAT-client/pods/man8/rinstall.8.pod b/xCAT-client/pods/man8/rinstall.8.pod index f7060e929..6675b0ca3 100644 --- a/xCAT-client/pods/man8/rinstall.8.pod +++ b/xCAT-client/pods/man8/rinstall.8.pod @@ -4,19 +4,19 @@ B - Begin OS provision on a noderange =head1 B -B I B | B | B [B<-c>|B<--console>] [B<-V>|B<--verbose>] +B I [B | B | B] [BI] [B<-c>|B<--console>] [B<-V>|B<--verbose>] -B I B=I | [B<-O>] I [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] +B I [B=I | I] [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 B -B is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +B is a convenience command to begin OS provision on a noderange. -If B=I | B<-O> I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. +If B=I | I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. -If -c is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes , see L. +If B<-c> is specified, it will then run rcons on the node. This is allowed only if one node in the noderange. If need consoles on multiple nodes, see L. =head1 B @@ -26,26 +26,25 @@ If -c is specified, it will then run rcons on the node. This is allowed only if Instruct network boot loader to be skipped, generally meaning boot to hard disk -=item B|BI|B<-O>I +=item I | BI -Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the is omitted, the os image name will be obtained from I for the node. +Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the I is omitted, the os image name will be obtained from I for the node. =item B<--ignorekernelchk> Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel. -=item B=I +=item BI If you would like to run a task after deployment, you can define that task with this attribute. =item B -This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC -for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. +This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B<-h>|B<--help> @@ -60,7 +59,7 @@ Display version. For BMC-based servers, to specify the next boot mode to be "UEFI Mode". -=item B<-V>|B<--Verbose> +=item B<-V>|B<--verbose> Verbose output. diff --git a/xCAT-client/pods/man8/winstall.8.pod b/xCAT-client/pods/man8/winstall.8.pod index e8f25bb3c..acc377761 100644 --- a/xCAT-client/pods/man8/winstall.8.pod +++ b/xCAT-client/pods/man8/winstall.8.pod @@ -4,19 +4,19 @@ B - Begin OS provision on a noderange =head1 B -B I B | B | B [B<-c>|B<--console>] [B<-V>|B<--verbose>] +B I [B | B | B] [BI] [B<-V>|B<--verbose>] -B I B=I | [B<-O>] I [B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] +B I [B=I | I] [B<--ignorekernelchk>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>] -B [B<-h>|B<--help>|B<-v>|B<--version>] +B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 B -B is a convenience command to begin OS provision on a noderange(support nodes with "nodetype.mgt=ipmi,blade,hmc,ivm,fsp,kvm,esx,rhevm"). +B is a convenience command to begin OS provision on a noderange. -If B=I | B<-O> I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. - -It will then run wcons on the nodes. +If B=I | I is specified or nodetype.provmethod=B is set, provision the noderange with the osimage specified/configured. + +It will then run B on the noderange. =head1 B @@ -26,26 +26,25 @@ It will then run wcons on the nodes. Instruct network boot loader to be skipped, generally meaning boot to hard disk -=item B|BI|B<-O>I +=item I | BI -Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the is omitted, the os image name will be obtained from I for the node. +Prepare server for installing a node using the specified os image. The os image is defined in the I table and I table. If the I is omitted, the os image name will be obtained from I for the node. =item B<--ignorekernelchk> Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel. -=item B=I +=item BI If you would like to run a task after deployment, you can define that task with this attribute. =item B -This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC -for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. +This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. =item B -This instructs tho node to boot to the xCAT genesis environment, and present a shell prompt on console. +This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. =item B<-h>|B<--help> @@ -60,31 +59,28 @@ Display version. For BMC-based servers, to specify the next boot mode to be "UEFI Mode". -=item B<-V>|B<--Verbose> +=item B<-V>|B<--verbose> Verbose output. -=item B<-c>|B<--console> - -Requests that rinstall runs rcons once the provision starts. This will only work if there is only one node in the noderange. See L for starting consoles on multiple nodes. - =back + =head1 B =over 2 =item 1. -Provison nodes 1 through 20, using their current configuration. +Provision nodes 1 through 20, using their current configuration. winstall node1-node20 =item 2. Provision nodes 1 through 20 with the osimage rhels6.4-ppc64-netboot-compute. - winstall node1-node20 -O rhels6.4-ppc64-netboot-compute + winstall node1-node20 osimage=rhels6.4-ppc64-netboot-compute -=back +=back =head1 B B diff --git a/xCAT-client/pods/man8/xcatconfig.8.pod b/xCAT-client/pods/man8/xcatconfig.8.pod index 7d7e73be7..3ad208093 100644 --- a/xCAT-client/pods/man8/xcatconfig.8.pod +++ b/xCAT-client/pods/man8/xcatconfig.8.pod @@ -38,15 +38,15 @@ Displays verbose messages. =item B<-i|--initialinstall> -The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the datebase, export directories, start syslog and other daemons as needed after the initial install of xCAT. +The install option is normally run as a post operation from the rpm xCAT.spec file during the initial install of xCAT on the Management Node. It will setup the root ssh keys, ssh node keys, xCAT credentials, initialize the database, export directories, start syslog and other daemons as needed after the initial install of xCAT. =item B<-u|--updateinstall> -The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, datebase, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. +The update install option is normally run as a post operation from the rpm xCAT.spec file during an update install of xCAT on the Management Node. It will check the setup the root ssh keys, ssh node keys, xCAT credentials, database, exported directories, syslog and the state of daemons needed by xCAT, after the updateinstall of xCAT. If setup is required, it will perform the operation. It will restart the necessary daemons. =item B<-k|--sshkeys> -This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distribute to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. +This option will remove and regenerate the root id_rsa keys. It should only be used, if the keys are deleted or corrupted. The keys must then be distributed to the nodes by installing, running updatenode -k, or using xdsh -K option, for root to be able to ssh to the nodes without being prompted for a password. rspconfig will need to be run to distribute the key to the MM and HMCs. Any device, we need to ssh from the MN to the device will also have to be updated with the new ssh keys. =item B<-s|--sshnodehostkeys> @@ -55,7 +55,7 @@ This option will remove and regenerate the node host ssh keys. It should only b =item B<-c|--credentials> -This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistribed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stop and started. +This option will remove all xcat credentials for root and any userids where credentials have been created. It will regenerate roots credentials, but the admin will have to add back all the userid credentials needed with the /opt/xcat/share/xcat/scripts/setup-local-client.sh command. It should only be used, if they are deleted or become corrupted. The root credentials must be redistributed to the service nodes by installing the service node or using updatenode -k. makeconservercf must be rerun to pick up the new credentials, and conserver must be stopped and started. =item B<-d|--database> @@ -63,9 +63,9 @@ This option will reinitialize the basic xCAT database table setup. It will not =item B<-f|--force> -The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinititialize the site table. This option should be used, if keys or credentials become corrupt or lost. +The force option may be used after the install to reinitialize the Management Node. This option will regenerate keys, credential and reinitialize the site table. This option should be used, if keys or credentials become corrupt or lost. Additional action must be taken after using the force options. ssh keys must be redistributed to the nodes, site table attributes might need to be restored, makeconservercf needs to be rerun to pick up the new credentials and conserver stopped and started, rspconfig needs to be rerun to distribute the new keys to the MM and the HMCs. -A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. +A new set of common ssh host keys will have been generated for the nodes. If you wish your nodes to be able to ssh to each other with out password intervention, then you should redistribute these new keys to the nodes. If the nodes hostkeys are updated then you will need to remove their entries from the known_hosts files on the management node before using ssh, xdsh, xdcp. Redistribute credentials and ssh keys to the service nodes and ssh keys to the nodes by using the updatenode -k command. =item B<-m|--mgtnode> diff --git a/xCAT-client/pods/man8/xcatsetup.8.pod b/xCAT-client/pods/man8/xcatsetup.8.pod index 7ee96dd95..bea98a54c 100644 --- a/xCAT-client/pods/man8/xcatsetup.8.pod +++ b/xCAT-client/pods/man8/xcatsetup.8.pod @@ -85,7 +85,7 @@ The B command has only been implemented and tested for system p serve =head2 Configuration File The B is organized in stanza format and supports the keywords in the sample file below. Comment lines -begin with "#". Stanzas can be ommitted if you do not want to define that type of object. +begin with "#". Stanzas can be omitted if you do not want to define that type of object. The only hostname formats supported are those shown in this sample file, although you can change the base text and the numbers. For example, hmc1-hmc3 could be changed to hwmgmt01-hwmgmt12. The hostnames specified must sort correctly. I.e. use node01-node80, instead of node1-node80. diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index f301961a3..28f3985aa 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -133,30 +133,8 @@ if [ "$HOSTOS" = "mcp" ]; then # For ppc64 platform, needs to remove some files, # # and some files are in different directories elif [ $BUILDARCH = "ppc64" ]; then - sed -i 's/dracut_install efibootmgr//' $DRACUTMODDIR/install + sed -i 's/ efibootmgr//' $DRACUTMODDIR/install sed -i 's/ dmidecode//' $DRACUTMODDIR/install - sed -i 's/\/lib\/libncurses.so.5.7/\/lib64\/libncurses.so.5.7/' $DRACUTMODDIR/install - sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.13/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libgcc_s.so.1/\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.7/' $DRACUTMODDIR/install - # following changes are required on Fedora 20 ppc64 - # sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install - # following changes are required on Fedora 23 ppc64 - sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.22.so/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libc.so.6/\/lib64\/libc.so.6/' $DRACUTMODDIR/install - # following changes are required on Fedora 23 ppc64 - #sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.18.so/' $DRACUTMODDIR/install - sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.22.so/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libdl.so.2/\/lib64\/libdl.so.2/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libm.so.6/\/lib64\/libm.so.6/' $DRACUTMODDIR/install - sed -i 's/\/lib\/libpthread.so.0/\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install - sed -i 's/\/lib64\/libncurses.so.5.7/\/lib64\/libncurses.so.5.9/' $DRACUTMODDIR/install - # following changes are required on Fedora 22 ppc64 - #sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.19/' $DRACUTMODDIR/install - sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.21/' $DRACUTMODDIR/install - sed -i 's/\/lib64\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.9/' $DRACUTMODDIR/install - sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install - #sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install fi @@ -189,7 +167,8 @@ cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi # add the perl library -PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5" +# add /usr/share/ntp/lib for Fedora26 ppc64, the ntp-perl will installed libraries under it +PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/share/ntp/lib" for d in `echo $PERL_LIB_DIR`; do if [ -e $d ]; then echo Adding perl libary "$d" diff --git a/xCAT-genesis-builder/dhclient-script b/xCAT-genesis-builder/dhclient-script index fcf51c9ac..21c1e0e76 100755 --- a/xCAT-genesis-builder/dhclient-script +++ b/xCAT-genesis-builder/dhclient-script @@ -14,7 +14,7 @@ elif [ $reason = "BOUND" ]; then if [ ! -z "$old_ip_address" ]; then ip addr del dev $interface $old_ip_address/$old_subnet_mask fi - for oldip in `ip addr show dev $interface|grep 'inet '|awk '{print $2}'`; do + for oldip in `ip -o addr show dev $interface|awk '{print $4}'`; do ip addr del dev $interface $oldip done if [ ! -z "$new_ip_address" -a ! -z "$new_subnet_mask" ]; then diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 2f1d0507f..e5dfbe0f0 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -5,18 +5,12 @@ dracut_install netstat # broadcom update requires dracut_install uniq # mellanox update requires dracut_install grep ip hostname /usr/bin/awk egrep grep dirname expr dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 mkfs.xfs xfs_db #mkfs.btrfs removed -dracut_install efibootmgr #dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad -dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2 dracut_install poweroff ntpq ntpd ntp-wait hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc -dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements -dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si -dracut_install dmidecode /usr/lib64/libstdc++.so.5 #broadcom firmware update links against old lib -dracut_install /lib/libpthread.so.0 #32 bit lib because UXSPI will not ship a native 64 bit build -dracut_install /lib/libncurses.so.5.7 /usr/lib/libstdc++.so.6.0.13 /lib/libgcc_s.so.1 /lib/libtinfo.so.5.7 -dracut_install /lib64/libldap-2.4.so.2 /lib64/liblber-2.4.so.2 /usr/lib64/libsasl2.so.2 #uxspi has incurred these... +dracut_install chmod /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements +dracut_install efibootmgr lldptool dmidecode #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si dracut_install /usr/share/zoneinfo/posix/Zulu dracut_install /usr/share/zoneinfo/posix/GMT-0 dracut_install /usr/share/zoneinfo/posix/Europe/Istanbul @@ -594,7 +588,6 @@ inst_dir /var/lib/nfs/statd/sm inst_dir /var/lib/nfs/statd/sm.bak inst_dir /var/lib/nfs/rpc_pipefs/nfs inst "/bin/bash" "/bin/sh" -inst "/lib64/libnss_dns-2.12.so" inst "/lib/terminfo/l/linux" "/lib/terminfo/l/linux" inst "/lib/terminfo/v/vt100" "/lib/terminfo/v/vt100" inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" @@ -624,4 +617,4 @@ dracut_install /lib/udev/rules.d/95-dm-notify.rules dracut_install /usr/share/hwdata/pci.ids # The DB files for udevadm dracut_install /etc/udev/hwdb.bin -dracut_install /lib64/libform.so.5 /lib64/libpanel.so.5 /lib64/libmenu.so.5 /lib64/libsysfs.so.2 /usr/sbin/iprconfig # iprconfig for IBM Power RAID configuration +dracut_install /usr/sbin/iprconfig # iprconfig for IBM Power RAID configuration diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index b8208abe8..cb2aba4a5 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -37,7 +37,7 @@ function cold_reset_bmc() { fi if [ "$XPROD" = "309" -o "$XPROD" = "43707" ] ; then if [ "$XPROD" = "43707" ]; then - # OpenPower SPECIFIC, the OpenPower machines with AMI BMC should NOT need a + # OpenPOWER SPECIFIC, the OpenPOWER machines with AMI BMC should NOT need a # reset after applying ipmitool commands. However, it seems there is a problem with # the BMC where after 15 seconds, it stops responding. To work around, sleep 30 # seconds before issuing the reset of the BMC. @@ -49,7 +49,7 @@ function cold_reset_bmc() { fi if [ "$XPROD" = "43707" ]; then - # OpenPower SPECIFIC, check the BMC with the following raw command to + # OpenPOWER SPECIFIC, check the BMC with the following raw command to # make sure that the bmc is really in a "ready" state before continuing SLEEP_INTERVAL=3 MAX_ITERATION=100 @@ -65,7 +65,7 @@ function cold_reset_bmc() { TOTAL_SEC=$((${SLEEP_INTERVAL} * ${MAX_ITERATION})) logger -s -t $log_label -p local4.error "ERROR, After waiting ${TOTAL_SEC} seconds, the BMC is not in a ready state." else - # for Non OpenPower servers, just sleep for some set time. + # for Non OpenPOWER servers, just sleep for some set time. sleep 15 TRIES=0 @@ -82,7 +82,7 @@ function cold_reset_bmc() { # # Function snooze() # -# The purpose of this is to work around the issue with OpenPower BMCs after +# The purpose of this is to work around the issue with OpenPOWER BMCs after # making a change to network configuration, sleep 30 to be sure the changes apply. # function snooze() { @@ -95,8 +95,8 @@ function snooze() { return fi if [ "$XPROD" = "43707" ]; then - # For OpenPower Machines - logger -s -t $log_label -p local4.debug "OpenPower, snooze for 30 seconds..." + # For OpenPOWER Machines + logger -s -t $log_label -p local4.debug "OpenPOWER, snooze for 30 seconds..." sleep 30 else logger -s -t $log_label -p local4.debug "snooze for 1 second..." @@ -167,7 +167,7 @@ logger -s -t $log_label -p local4.info "IPMIVER=$IPMIVER, IPMIMFG=$IPMIMFG, XPRO # # IPMIMFG=2 = IBM -# IPMIMFG=0 = OpenPower +# IPMIMFG=0 = OpenPOWER # IPMIMFG=42817 and XPROD=16975 = OpenBMC # if [ "$IPMIMFG" == 2 ]; then #IBM @@ -416,7 +416,7 @@ if [ ! -z "$ISOPENBMC" ]; then rm -f /tmp/ipmicfg.xml exit $bmc_config_rc fi -# After network commands are issued, pause to allow the BMC to apply (OpenPower) +# After network commands are issued, pause to allow the BMC to apply (OpenPOWER) snooze let idev=NUMBMCS-1 @@ -646,7 +646,7 @@ while [ $idev -gt 0 ]; do logger -s -t $log_label -p local4.info "Lighting Identify Light" if [ "$XPROD" = "43707" -a "$IPMIMFG" = '0' ]; then - # OpenPower BMC specific, turn on the LED beacon light. + # OpenPOWER BMC specific, turn on the LED beacon light. # - default interval, # ipmitool chassis identify # Chassis identify interval: default (15 seconds) # - 275 is too large, # ipmitool chassis identify 275 diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index f33ef9c3d..5c3591c00 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -25,11 +25,11 @@ logger -s -t $log_label -p local4.info "Waiting for nics to get addresses" while [ ! -z "$NICSGETTINGADDR" -a $timewaiting != 700 ]; do NEWNICSGETTINGADDR="" for nic in $NICSGETTINGADDR; do - if ! ip addr show dev $nic |grep -v inet6|grep inet >/dev/null; then + if ! ip -4 -o a show dev $nic |grep -q inet; then NEWNICSGETTINGADDR="$NEWNICSGETTINGADDR $nic" else echo -n "$nic|" - ip addr show dev $nic |grep -v inet6|grep inet|sed -e s/\\/.*//|awk '{print $2}' + ip -4 -o addr show dev $nic | awk '{print $4}' | sed -e sX/.*XX fi done sleep 0.1 @@ -187,8 +187,8 @@ for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://|grep -v ONBOARDINDEX="" DRIVER=`grep DRIVER /sys/class/net/$dev/device/uevent|awk -F= '{print $2}'` PCI_SLOT=`grep PCI_SLOT_NAME /sys/class/net/$dev/device/uevent|awk -F= '{print $2}'` - ADDRESS=`ip address show dev $dev|grep "inet "|grep global|awk '{print $2}'` - MAC=`ip link show dev $dev|grep ether|awk '{print $2}'| tr /a-f/ /A-F/` + ADDRESS=`ip -4 -o a show dev $dev|awk '/global/{print $4}'` + MAC=`ip -o l show dev $dev|awk '/ether/{print $15}'| tr /a-f/ /A-F/` if [ "$MAC_OF_FIRST_UP_NIC" == "unknown" ]; then MAC_OF_FIRST_UP_NIC=`echo $MAC | sed -e s/://g` fi diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 88f86890d..b95a0e0e1 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -212,7 +212,7 @@ else tries=0 while [ -z "$bootnic" ]; do for tmp1 in $ALLUP_NICS; do - if ip addr show dev $tmp1|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; then + if ip -4 -o a show dev $tmp1|grep -v 'scope link'|grep -v 'dynamic'|grep -q inet ; then result=`ping -c1 -I $tmp1 $XCATMASTER 2>&1` if [ $? -eq 0 ]; then logger -s -t $log_label -p local4.info "the nic $tmp1 can ping $XCATMASTER" @@ -247,7 +247,7 @@ else gripeiter=101 logger -s -t $log_label -p local4.info "Acquiring network addresses.." - while ! ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; do + while ! ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -q inet; do sleep 0.1 if [ $gripeiter = 1 ]; then logger -s -t $log_label -p local4.info "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..." @@ -261,7 +261,7 @@ openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 & logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic" -ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}' +ip -4 -o a show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|awk '{print $4}' logger -s -t $log_label -p local4.info "Starting ntpd..." ntpd -g -x diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index d192ae60d..e7867d51c 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -387,7 +387,7 @@ sub check_network { # on SN, get ip address by compare 'master' attribute in 'site' table # choose the one in the same network with 'master' - my @ipoutput = `ip addr show 2>&1| grep inet | grep -v inet6`; + my @ipoutput = `ip -4 a show 2>&1| grep inet`; foreach (@ipoutput) { if ($_ =~ /inet\s+(.+)\/(.+)\s+brd\s+(.+)\s+scope global/i) { if (xCAT::NetworkUtils::isInSameSubnet($sitetable_ref->{master}, $1, $2, 1)) { diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index d7223dc6b..4b444ac48 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -181,6 +181,7 @@ sub new { my $self = {}; bless $self, $class; my %args = @_; + $self->init(); unless ($ipmi2support) { $self->{ipmi15only} = 1; } @@ -238,7 +239,6 @@ sub new { } else { $self->{peeraddr} = sockaddr_in($self->{port}, $bmc_n); } - $self->init(); return $self; } @@ -471,6 +471,11 @@ sub checksum { sub subcmd { my $self = shift; my %args = @_; + while ($self->{incommand}) { + $self->waitforrsp(timeout=>1); + } + $self->{incommand} = 1; + $self->{expectedcmd} = $args{command}; $self->{expectednetfn} = $args{netfn} + 1; if ($self->{onlogon_args}->{xcatdebugmode}) { @@ -573,6 +578,7 @@ sub timedout { $self->{timeout} = $initialtimeout + (0.5 * rand()); my $rsp = {}; $rsp->{error} = "timeout"; + $self->{incommand} = 0; $self->{ipmicallback}->($rsp, $self->{ipmicallback_args}); $self->{nowait} = 0; return; @@ -833,6 +839,7 @@ sub init { #if we should incur 7 bumps, clear the taboo list and continue on, hoping for best (pessimistically assuming the spec means seq number or that someone could at least interpret it that way) #I'll implement this later... $self->{'logged'} = 0; + $self->{'incommand'} = 0; } sub relog { @@ -1008,6 +1015,7 @@ sub parse_ipmi_payload { $rsp->{code} = shift @payload; $rsp->{data} = \@payload; $self->{timeout} = $initialtimeout + (0.5 * rand()); + $self->{incommand} = 0; $self->{ipmicallback}->($rsp, $self->{ipmicallback_args}); return 0; } diff --git a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm index dbfec4b69..3d9b395a6 100644 --- a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm +++ b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm @@ -568,11 +568,13 @@ sub setSSHcfg { my $enable_cmd = "enable\r"; my $config_cmd = "configure terminal\r"; my $exit_cmd = "exit\r"; + my $init_cmd = "no\r"; my $pwd_prompt = "Password: "; my $sw_prompt = "^.*\] > "; my $enable_prompt = "^.*\] \#"; my $config_prompt = "^.*\\\(config\\\) \#"; + my $init_prompt = "Do you want to use the wizard for initial configuration?"; my $debug = 0; @@ -664,6 +666,14 @@ sub setSSHcfg { $mysw->exp_continue(); } ], + [ + "-re", $init_prompt, + sub { + $mysw->clear_accum(); + $mysw->send($init_cmd); + $mysw->exp_continue(); + } + ], [ "-re", $sw_prompt, sub { diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 3e306e7fb..41350d242 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -1266,7 +1266,7 @@ sub get_mac_by_arp () } else { ($ip, $mac) = (undef, undef); } - if (@$IP[1] !~ $ip) { + if (@$IP[1] ne $ip) { ($ip, $mac) = (undef, undef); } else { last; diff --git a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm index 4eb76eacb..256ce90a3 100644 --- a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm +++ b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm @@ -130,7 +130,7 @@ sub process_request { if ($runconservercmd) { push @commandslist, [ 'makeconservercf', '-d' ]; } - push @commandslist, [ 'makeknownhosts', '-r' ]; + push @commandslist, [ 'makeknownhosts', '-d' ]; if ($macflag) { push @commandslist, [ 'makedhcp', '-d' ]; } diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 8faed0d4f..5fd00c2e8 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1999,6 +1999,18 @@ sub defmk } else { + my $nodenum = 0; + my $ret = 0; + my @nodes_updated = (); + foreach my $node (keys %::FINALATTRS) { + if ($::FINALATTRS{$node}{updated}) { + $nodenum++; + push @nodes_updated, $node; + } + if ($::FINALATTRS{$node}{error}) { + $ret = 1; + } + } if ($::verbose) { @@ -2007,7 +2019,7 @@ sub defmk xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; - foreach my $o (sort(keys %::FINALATTRS)) + foreach my $o (sort( @nodes_updated)) { $rsp->{data}->[$n] = "$o"; $n++; @@ -2023,21 +2035,17 @@ sub defmk xCAT::MsgUtils->message("E", $rsp, $::callback); } } - else - { - my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); - $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; - if ($nodenum > 0) { - # Some objects were created, report as success - xCAT::MsgUtils->message("I", $rsp, $::callback); - } - else { - # No objects were created, report as error - xCAT::MsgUtils->message("E", $rsp, $::callback); - } + my $rsp; + $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; + if ($nodenum > 0) { + # Some objects were created, report as success + xCAT::MsgUtils->message("I", $rsp, $::callback); } - return 0; + else { + # No objects were created, report as error + xCAT::MsgUtils->message("E", $rsp, $::callback); + } + return $ret; } } @@ -2786,18 +2794,29 @@ sub defch } else { + my $nodenum = 0; + my $ret = 0; + my @nodes_updated = (); + foreach my $node (keys %::FINALATTRS) { + if ($::FINALATTRS{$node}{updated}) { + $nodenum++; + push @nodes_updated, $node; + } + if ($::FINALATTRS{$node}{error}) { + $ret = 1; + } + } if ($::verbose) { # give results my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); if ($nodenum) { $rsp->{data}->[0] = "The database was updated for the following objects:"; xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; - foreach my $o (sort(keys %::FINALATTRS)) + foreach my $o (sort(@nodes_updated)) { $rsp->{data}->[$n] = "$o\n"; $n++; @@ -2810,7 +2829,7 @@ sub defch else { my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); + if ($nodenum) { $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; } else { @@ -2842,7 +2861,7 @@ sub defch } } } - return 0; + return $ret; } } diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 0222362ba..fb2a7cd19 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -607,7 +607,7 @@ sub mknetboot $xcatmaster = '!myipfn!'; #allow service nodes to dynamically nominate themselves as a good contact point, this is of limited use in the event that xcat is not the dhcp/tftp server } - if ($ient and $ient->{tftpserver}) + if ($ient and $ient->{tftpserver} and $ient->{tftpserver} ne '') { $imgsrv = $ient->{tftpserver}; } @@ -859,7 +859,7 @@ sub mknetboot } # turn off the selinux - if ($osver =~ m/fedora12/ || $osver =~ m/fedora13/) { + if ($osver =~ m/(fedora12|fedora13|rhels7)/) { $kcmdline .= " selinux=0 "; } diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 439203163..c7b3ae80c 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -29,6 +29,9 @@ use Data::Dumper; use File::Basename; use File::Path; use Cwd; +use LWP; +use HTTP::Cookies; +use HTTP::Response; use JSON; my $nmap_path; @@ -41,6 +44,9 @@ if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { my $parent_fd; my $bmc_user; my $bmc_pass; +my $openbmc_user; +my $openbmc_pass; +my $openbmc_port = 2200; #------------------------------------------------------- @@ -77,6 +83,13 @@ sub process_request $::CALLBACK = $callback; #$::args = $request->{arg}; + if (ref($request->{environment}) eq 'ARRAY' and ref($request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}) eq 'ARRAY') { + $::XCAT_DEV_WITHERSPOON = $request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}->[0]; + } elsif (ref($request->{environment}) eq 'ARRAY') { + $::XCAT_DEV_WITHERSPOON = $request->{environment}->[0]->{XCAT_DEV_WITHERSPOON}; + } else { + $::XCAT_DEV_WITHERSPOON = $request->{environment}->{XCAT_DEV_WITHERSPOON}; + } unless (defined($request->{arg})) { bmcdiscovery_usage(); @@ -211,10 +224,11 @@ sub bmcdiscovery_processargs { # Get the default bmc account from passwd table, # this is only done for the discovery process ############################################ - ($bmc_user, $bmc_pass) = bmcaccount_from_passwd(); + ($bmc_user, $bmc_pass, $openbmc_user, $openbmc_pass) = bmcaccount_from_passwd(); # overwrite the default user and password if one is provided if ($::opt_U) { $bmc_user = $::opt_U; + $openbmc_user = $::opt_U; } elsif ($::opt_P) { # If password is provided, but no user, set the user to blank # Support older FSP and Tuletta machines @@ -222,6 +236,7 @@ sub bmcdiscovery_processargs { } if ($::opt_P) { $bmc_pass = $::opt_P; + $openbmc_pass = $::opt_P; } ######################################### @@ -577,9 +592,9 @@ sub scan_process { # Set child process default, if not the function runcmd may return error $SIG{CHLD} = 'DEFAULT'; - my $nmap_cmd = "nmap ${$live_ip}[$i] -p 2200 -Pn"; + my $nmap_cmd = "nmap ${$live_ip}[$i] -p $openbmc_port -Pn"; my $nmap_output = xCAT::Utils->runcmd($nmap_cmd, -1); - if ($nmap_output =~ /2200\/tcp (\w+)/) { + if ($nmap_output =~ /$openbmc_port\/tcp (\w+)/) { my $port_stat = $1; if ($port_stat eq "open") { bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command); @@ -587,7 +602,9 @@ sub scan_process { bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command); } } else { - xCAT::MsgUtils->message("E", "Can not get status of 2200 port.", $::CALLBACK); + my $rsp = {}; + push @{ $rsp->{data} }, "Can not get status of 2200 port for ip ${$live_ip}[$i].\n"; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); exit 1; } @@ -868,12 +885,16 @@ sub bmcdiscovery { sub bmcaccount_from_passwd { my $bmcusername = "ADMIN"; my $bmcpassword = "admin"; + my $openbmcusername = "root"; + my $openbmcpassword = "0penBmc"; my $passwdtab = xCAT::Table->new("passwd", -create => 0); if ($passwdtab) { my $bmcentry = $passwdtab->getAttribs({ 'key' => 'ipmi' }, 'username', 'password'); if (defined($bmcentry)) { $bmcusername = $bmcentry->{'username'}; $bmcpassword = $bmcentry->{'password'}; + + # if username or password is undef or empty in passwd table, bmcusername or bmcpassword is empty unless ($bmcusername) { $bmcusername = ''; } @@ -881,8 +902,21 @@ sub bmcaccount_from_passwd { $bmcpassword = ''; } } + + my $openbmcentry = $passwdtab->getAttribs({ 'key' => 'openbmc' }, 'username', 'password'); + if (defined($openbmcentry)) { + $openbmcusername = $openbmcentry->{'username'}; + $openbmcpassword = $openbmcentry->{'password'}; + # if username or password is undef or empty in passwd table, openbmcusername or openbmcpassword is empty + unless ($openbmcusername) { + $openbmcusername = ''; + } + unless ($openbmcpassword) { + $openbmcpassword = ''; + } + } } - return ($bmcusername, $bmcpassword); + return ($bmcusername, $bmcpassword, $openbmcusername, $openbmcpassword); } #---------------------------------------------------------------------------- @@ -958,6 +992,10 @@ sub bmcdiscovery_ipmi { } } + if ($mtm eq '' or $serial eq '') { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); + return; + } $node_data .= ",$mtm"; $node_data .= ",$serial"; @@ -1018,22 +1056,58 @@ sub bmcdiscovery_openbmc{ my $request_command = shift; my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); - my $node_data = $ip; - my $cjar_file = "/tmp/cjar_$ip"; - my $data = '{"data": [ "' . $bmc_user .'", "' . $bmc_pass . '" ] }'; + print "$ip: Detected openbmc, attempting to obtain system information...\n"; + my $http_protocol="https"; + my $openbmc_project_url = "xyz/openbmc_project"; + my $login_endpoint = "login"; + my $system_endpoint = "inventory/system"; + my $motherboard_boxelder_endpoint = "$system_endpoint/chassis/motherboard/boxelder/bmc"; - my $output = `curl -c $cjar_file -k -X POST -H \"Content-Type: application/json\" -d '$data' https://$ip/login`; + my $node_data = $ip; + my $brower = LWP::UserAgent->new( ssl_opts => { SSL_verify_mode => 0x00, verify_hostname => 0 }, ); + my $cookie_jar = HTTP::Cookies->new(); + my $header = HTTP::Headers->new('Content-Type' => 'application/json'); + my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; + $brower->cookie_jar($cookie_jar); + + my $url = "$http_protocol://$ip/$login_endpoint"; + my $login_request = HTTP::Request->new( 'POST', $url, $header, $data ); + my $login_response = $brower->request($login_request); - if ($output =~ /\"status\": \"ok\"/) { - my $req_output = `curl -b $cjar_file -k https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard`; - my $response = decode_json $req_output; + if ($login_response->is_success) { + # attempt to find the system serial/model + $url = "$http_protocol://$ip/$openbmc_project_url/$system_endpoint"; + my $req = HTTP::Request->new('GET', $url, $header); + my $req_output = $brower->request($req); + if ($req_output->is_error) { + # If the host system has not yet been powered on, check the boxelder bmc info for model/serial + $url = "$http_protocol://$ip/$openbmc_project_url/$motherboard_boxelder_endpoint"; + $req = HTTP::Request->new('GET', $url, $header); + $req_output = $brower->request($req); + if ($req_output->is_error) { + xCAT::MsgUtils->message("W", { data => ["$ip: Could not obtain system information from BMC."] }, $::CALLBACK); + return; + } + } + my $response = decode_json $req_output->content; my $mtm; my $serial; - if (defined($response->{data}) and defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{Model}; - $serial = $response->{data}->{SerialNumber}; - } else { + if (defined($response->{data})) { + if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{Model}; + if (defined($::XCAT_DEV_WITHERSPOON) && ($::XCAT_DEV_WITHERSPOON eq "TRUE")) { + xCAT::MsgUtils->message("I", { data => ["XCAT_DEV_WITHERSPOON=TRUE, forcing MTM to empty string for $ip (Original MTM=$mtm)"] }, $::CALLBACK); + $mtm = ""; + } + $serial = $response->{data}->{SerialNumber}; + } else { + xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); + return; + } + + } else { + xCAT::MsgUtils->message("E", { data => ["Unable to connect to REST server at $ip"] }, $::CALLBACK); return; } @@ -1059,11 +1133,11 @@ sub bmcdiscovery_openbmc{ $node =~ s/(.*)/\L$1/g; $node =~ s/[\s:\._]/-/g; } - - unlink $cjar_file; } else { - if ($output =~ /\"description\": \"Invalid username or password\"/) { + if ($login_response->status_line =~ /401 Unauthorized/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); + } else { + xCAT::MsgUtils->message("W", { data => ["$login_response->status_line for $ip"] }, $::CALLBACK); } return; } diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 24336d186..11c3f9b90 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -207,7 +207,16 @@ sub docfheaders { { push @newheaders, "config * {\n"; push @newheaders, " sslrequired yes;\n"; - push @newheaders, " sslauthority /etc/xcat/cert/ca.pem;\n"; + my $version = xCAT::Utils::get_conserver_version(); + if (!$version) { + xCAT::SvrUtils::sendmsg([ 1, "Failed to get conserver version" ], $cb); + return; + } + if (xCAT::Utils::calc_conserver_version($version) < xCAT::Utils::calc_conserver_version("8.1.19")) { + push @newheaders, " sslauthority /etc/xcat/cert/ca.pem;\n"; + } else { + push @newheaders, " sslcacertificatefile /etc/xcat/cert/ca.pem;\n"; + } push @newheaders, " sslcredentials /etc/xcat/cert/server-cred.pem;\n"; push @newheaders, "}\n"; } diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 03d0b7843..ba55424f8 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -76,15 +76,24 @@ sub process_request { sub relay_response { my $resp = shift; + my $failure = 0; $callback->($resp); if ($resp and ($resp->{errorcode} and $resp->{errorcode}->[0]) or ($resp->{error} and $resp->{error}->[0])) { - $errored = 1; + $failure = 1; } - foreach (@{ $resp->{node} }) { - if ($_->{error} or $_->{errorcode}) { - $errored = 1; + # quick return when detect failure. + unless ( $failure ) { + foreach (@{ $resp->{node} }) { + if ($_->{error} or $_->{errorcode}) { + $failure = 1; + last; + } } } + if ( $failure ) { + $errored = $failure; + } + } sub setdestiny { @@ -187,8 +196,15 @@ sub setdestiny { chomp($state); my $target; my $action; + my $rawstate=$state; if ($state =~ /=/) { ($state, $target) = split '=', $state, 2; + + if(!$target){ + $callback->({ error => "invalid argument: \"$rawstate\"", errorcode => [1] }); + return; + } + if ($target =~ /:/) { ($target, $action) = split ':', $target, 2; } @@ -401,6 +417,7 @@ sub setdestiny { bootparams => \$bphash}, \&relay_response); if ($errored) { # The error messeage for mkinstall/mknetboot/mkstatelite had been output within relay_response function above, don't need to output more + xCAT::MsgUtils->trace($verbose_on_off, "d", "destiny->process_request: Failed in processing mk$tempstate. Processing will not continue."); return; } diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index e2ff8556a..c30eceffd 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -502,7 +502,7 @@ sub addnode if ($nrhash) { $nrent = $nrhash->{$node}->[0]; - if ($nrent and $nrent->{tftpserver}) + if ($nrent and $nrent->{tftpserver} and $nrent->{tftpserver} ne '') { #check the value of inet_ntoa(inet_aton("")),if the hostname cannot be resolved, #the value of inet_ntoa() will be "undef", which will cause fatal error @@ -531,9 +531,7 @@ sub addnode my $node_server = undef; if ($nrent->{xcatmaster}) { $node_server = $nrent->{xcatmaster}; - } elsif ($nrent->{servicenode}) { - $node_server = $nrent->{servicenode}; - } + } unless ($node_server) { my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($node); unless ($nxtsrvd[0]) { $nxtsrv = $nxtsrvd[1]; } @@ -2271,6 +2269,7 @@ sub addnet6 push @netent, " option domain-search $domainstring;\n"; } } + my $nameservers = $netcfgs{$net}->{nameservers}; if ($nameservers and $nameservers =~ /:/) { @@ -2456,10 +2455,11 @@ sub addnet { $tftp = $ent->{tftpserver}; } - else - { #presume myself to be it, dhcp no longer does this for us + if (!$tftp || ($tftp eq '')) + { $tftp = $myip; } + if ($ent and $ent->{gateway}) { $gateway = $ent->{gateway}; @@ -2574,6 +2574,7 @@ sub addnet push @netent, " option interface-mtu $mtu;\n"; } + # add domain-search if not sles10 or rh5 my $osv = xCAT::Utils->osver(); unless (($osv =~ /^sle[sc]10/) || ($osv =~ /^rh.*5$/)) { @@ -2591,6 +2592,8 @@ sub addnet push @netent, " option domain-search $domainstring;\n"; } } + #for cumulus ZTP process + push @netent, " option cumulus-provision-url \"http://$tftp/install/postscripts/cumulusztp\";\n"; my $ddnserver = $nameservers; $ddnserver =~ s/,.*//; @@ -2928,6 +2931,7 @@ sub newconfig } push @dhcpconf, "option gpxe.no-pxedhcp 1;\n"; push @dhcpconf, "option www-server code 114 = string;\n"; + push @dhcpconf, "option cumulus-provision-url code 239 = text;\n"; push @dhcpconf, "\n"; push @dhcpconf, "omapi-port 7911;\n"; #Enable omapi... push @dhcpconf, "key xcat_key {\n"; diff --git a/xCAT-server/lib/xcat/plugins/getadapter.pm b/xCAT-server/lib/xcat/plugins/getadapter.pm index 19edc1817..3cdbe5bff 100644 --- a/xCAT-server/lib/xcat/plugins/getadapter.pm +++ b/xCAT-server/lib/xcat/plugins/getadapter.pm @@ -122,8 +122,8 @@ sub route_request { my $command = $request->{command}->[0]; my $ret = xCAT::State->REQUEST_ERROR; - if (scalar(@{ $request->{node} }) == 0) { - return $ret; + if (!$request->{node}) { + return xCAT::State->REQUEST_WAIT; } my $build_request_message_func = sub { @@ -404,7 +404,7 @@ sub update_adapter_result { $interface_exists = 0; if (exists($msg->{nic}->[$i]->{interface})) { - $output .= $msg->{nic}->[$i]->{interface}; + $output .= $msg->{nic}->[$i]->{interface}."!"; if ($has_nic) { $data .= "," . $msg->{nic}->[$i]->{interface} . "!"; } @@ -414,38 +414,46 @@ sub update_adapter_result { $interface_exists = 1; $has_nic = 1; } + my @nic_attrs = (); + my @output_attrs = (); if (exists($msg->{nic}->[$i]->{mac})) { - $output .= "!mac=" . $msg->{nic}->[$i]->{mac}; + push(@output_attrs, "mac=" . $msg->{nic}->[$i]->{mac}); if ($interface_exists) { - $data .= " mac=" . $msg->{nic}->[$i]->{mac}; + push(@nic_attrs, "mac=" . $msg->{nic}->[$i]->{mac}); } } if (exists($msg->{nic}->[$i]->{pcilocation})) { - $output .= "|pci=" . $msg->{nic}->[$i]->{pcilocation}; + push(@output_attrs, "pci=" . $msg->{nic}->[$i]->{pcilocation}); if ($interface_exists) { - $data .= "pci=" . $msg->{nic}->[$i]->{pcilocation}; + push(@nic_attrs, "pci=" . $msg->{nic}->[$i]->{pcilocation}); } } if (exists($msg->{nic}->[$i]->{predictablename})) { - $output .= "|candidatename=" . $msg->{nic}->[$i]->{predictablename}; + push(@output_attrs, "candidatename=" . $msg->{nic}->[$i]->{predictablename}); } if (exists($msg->{nic}->[$i]->{vendor})) { - $output .= "|vendor=" . $msg->{nic}->[$i]->{vendor}; + $msg->{nic}->[$i]->{vendor} =~ s/^\s+|\s+$//g; + push(@output_attrs, "vendor=" . $msg->{nic}->[$i]->{vendor}); } if (exists($msg->{nic}->[$i]->{model})) { - $output .= "|model=" . $msg->{nic}->[$i]->{model}; + $msg->{nic}->[$i]->{model} =~ s/^\s+|\s+$//g; + push(@output_attrs, "model=" . $msg->{nic}->[$i]->{model}); } if (exists($msg->{nic}->[$i]->{linkstate})) { - $output .= "|linkstate=" . $msg->{nic}->[$i]->{linkstate}; + push(@output_attrs, "linkstate=" . (split(' ', $msg->{nic}->[$i]->{linkstate}))[0]); if ($interface_exists) { - $data .= " linkstate=" . $msg->{nic}->[$i]->{linkstate}; + push(@nic_attrs, "linkstate=". (split(' ', $msg->{nic}->[$i]->{linkstate}))[0]); } } + if (@nic_attrs) { + $data .= join(" ", @nic_attrs); + } + $output .= join("|", @output_attrs); $output .= "\n"; } $callback->({ data => "$output" }); if (!$has_nic) { - $callback->({ data => "$node: nics talbe will not be updated as not any ". + $callback->({ data => "$node: nics table will not be updated as not any ". "useful information could be found with udevadm command." }); return 0; } diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index e465db55b..f6600d22c 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -12,7 +12,7 @@ use File::Path; use Socket; use Getopt::Long; use xCAT::Table; - +use xCAT::Usage; my $request; my %breaknetbootnodes; our %normalnodes; @@ -218,21 +218,36 @@ sub setstate { } elsif (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'xcatmaster'}) { $tftpserver = $nrhash{$node}->[0]->{'xcatmaster'}; } else { - my @master = xCAT::TableUtils->get_site_attribute("master"); - $tftpserver = $master[0]; - } - my $serverip; - if (defined($tftpserverip{$tftpserver})) { - $serverip = $tftpserverip{$tftpserver}; - } else { - $serverip = xCAT::NetworkUtils->getipaddr($tftpserver); - unless ($serverip) { - syslog("local1|err", "xCAT unable to resolve $tftpserver"); - return; - } - $tftpserverip{$tftpserver} = $serverip; + $tftpserver = ""; } + my $serverip; + + if($tftpserver eq ""){ + my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($node); + unless ($nxtsrvd[0]) { + $serverip = $nxtsrvd[1]; + } else { + $callback->({ error => [ $nxtsrvd[1] ], errorcode => [1] }); + return; + } + }else{ + if (defined($tftpserverip{$tftpserver})) { + $serverip = $tftpserverip{$tftpserver}; + } else { + $serverip = xCAT::NetworkUtils->getipaddr($tftpserver); + unless ($serverip) { + syslog("local1|err", "xCAT unable to resolve $tftpserver"); + return; + } + $tftpserverip{$tftpserver} = $serverip; + } + } + + unless($serverip){ + $callback->({ error => ["Unable to determine the tftpserver for $node"], errorcode => [1] }); + return; + } my $grub2protocol = "tftp"; if (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'} && ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) { @@ -426,10 +441,13 @@ sub preprocess_request { return; } - if (@ARGV == 0) { + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { if ($usage{$command}) { my %rsp; - $rsp{data}->[0] = $usage{$command}; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; $callback1->(\%rsp); } return; @@ -465,10 +483,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } sub process_request { @@ -589,9 +607,10 @@ sub process_request { my $inittime = 0; if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -599,8 +618,11 @@ sub process_request { arg => \@args, bootparams => \%bphash }, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 5d3c15e87..859283636 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2470,6 +2470,8 @@ sub fpc_firmxfer_watch { } } +my %fpcsessions; + sub reseat_node { my $sessdata = shift; if (1) { # TODO: FPC path checked for @@ -2490,8 +2492,19 @@ sub reseat_node { my $nodeuser = $authdata->{$fpc}->{username}; my $nodepass = $authdata->{$fpc}->{password}; $sessdata->{slotnumber} = $mpent->{id}; - $sessdata->{fpcipmisession} = xCAT::IPMI->new(bmc => $mpent->{mpa}, userid => $nodeuser, password => $nodepass); - $sessdata->{fpcipmisession}->login(callback => \&fpc_node_reseat, callback_args => $sessdata); + if (exists $fpcsessions{$mpent->{mpa}}) { + $sessdata->{fpcipmisession} = $fpcsessions{$mpent->{mpa}}; + until ($sessdata->{fpcipmisession}->{logged}) { + $sessdata->{fpcipmisession}->waitforrsp(timeout=>1); + } + $sessdata->{fpcipmisession}->subcmd(netfn => 0x32, command => 0xa4, + data => [ $sessdata->{slotnumber}, 2 ], + callback => \&fpc_node_reseat_complete, callback_args => $sessdata); + } else { + $sessdata->{fpcipmisession} = xCAT::IPMI->new(bmc => $mpent->{mpa}, userid => $nodeuser, password => $nodepass); + $fpcsessions{$mpent->{mpa}} = $sessdata->{fpcipmisession}; + $sessdata->{fpcipmisession}->login(callback => \&fpc_node_reseat, callback_args => $sessdata); + } } } @@ -2535,7 +2548,7 @@ sub power { my $code; if (($sessdata->{subcommand} !~ /^on$|^off$|^reset$|^boot$|^stat$|^state$|^status$/) and isopenpower($sessdata)) { - xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPower" ], $callback, $sessdata->{node}, %allerrornodes); + xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPOWER" ], $callback, $sessdata->{node}, %allerrornodes); return; } @@ -6506,30 +6519,30 @@ sub vitals { $sensor_filters{leds} = 1; $doall = 1; } - if (grep /temp/, @textfilters) { + if (grep /^temp$/, @textfilters) { $sensor_filters{0x01} = 1; } - if (grep /volt/, @textfilters) { + if (grep /^voltage$/, @textfilters) { $sensor_filters{0x02} = 1; } - if (grep /watt/, @textfilters) { + if (grep /^wattage$/, @textfilters) { $sensor_filters{watt} = 1; } - if (grep /fan/, @textfilters) { + if (grep /^fanspeed$/, @textfilters) { $sensor_filters{0x04} = 1; } - if (grep /power/, @textfilters) { #power does not really include energy, but most people use 'power' to mean both + if (grep /^power$/, @textfilters) { #power does not really include energy, but most people use 'power' to mean both $sensor_filters{0x03} = 1; $sensor_filters{powerstate} = 1; $sensor_filters{energy} = 1; } - if (grep /energy/, @textfilters) { + if (grep /^energy$/, @textfilters) { $sensor_filters{energy} = 1; } - if (grep /led/, @textfilters) { + if (grep /^leds$/, @textfilters) { $sensor_filters{leds} = 1; } - if (grep /chassis/, @textfilters) { + if (grep /^chassis$/, @textfilters) { $sensor_filters{chassis} = 1; } unless (keys %sensor_filters) { diff --git a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm index ef15946a3..f5efe5390 100644 --- a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm +++ b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm @@ -65,13 +65,14 @@ sub process_request if ($request && $request->{arg}) { @ARGV = @{ $request->{arg} }; } else { @ARGV = (); } - my $usage = "Usage: makeknownhosts [-r] [-V]\n makeknownhosts -h"; + my $usage = "Usage: makeknownhosts [-r|-d] [-V]\n makeknownhosts -h"; # print "argv=@ARGV\n"; if (!GetOptions( 'h|help' => \$::opt_h, 'V|verbose' => \$::opt_V, - 'r|remove' => \$::opt_r + 'r|remove' => \$::opt_r, + 'd|delete' => \$::opt_d )) { my $rsp = {}; @@ -81,23 +82,22 @@ sub process_request } # display the usage if -h - if ($::opt_h) - { + if ($::opt_h) { my $rsp = {}; $rsp->{data}->[0] = $usage; xCAT::MsgUtils->message("I", $rsp, $callback, 1); return 0; } - if ($nodes eq "") - { # no noderange + if ($nodes eq "") { + # no noderange my $rsp = {}; $rsp->{data}->[0] = "The Noderange is missing."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; } my $hostkey = "/etc/xcat/hostkeys/ssh_host_rsa_key.pub"; - if (!(-e $hostkey)) - { # the key is missing, cannot create known_hosts + if (!(-e $hostkey)) { + # the key is missing, cannot create known_hosts my $rsp = {}; $rsp->{data}->[0] = "The keyfile:$hostkey is missing. Cannot create the known_hosts file."; @@ -107,35 +107,28 @@ sub process_request # Backup the existing known_hosts file to known_hosts.backup $rc = backup_known_hosts_file($callback); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error backing up known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; - } # Remove the nodes from knownhosts file $rc = remove_nodes_from_knownhosts($callback, $nodes); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error backing up known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; - } # if -r flag is not specified, adding the nodes back to known_hosts file - if (!$::opt_r) - { + if (!($::opt_r or $::opt_d)) { my @nodelist = @$nodes; - foreach my $node (@nodelist) - { + foreach my $node (@nodelist) { $rc = add_known_host($node, $callback); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error building known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); @@ -153,8 +146,6 @@ sub process_request Backs up the old known_hosts file in roots .ssh directory, if it exists. - - =cut #------------------------------------------------------- diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 894d0518a..cbbea2188 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -372,8 +372,10 @@ sub donets # For Linux systems my @ip6table = split /\n/, `/sbin/ip -6 route`; my @rtable = split /\n/, `/bin/netstat -rn`; + my @mtable = split /\n/, `/bin/netstat -i`; splice @rtable, 0, 2; + splice @mtable, 0, 2; my %netgw = (); foreach my $rtent (@rtable) @@ -517,6 +519,15 @@ sub donets } } + # get mtu value + my $mtu; + my @rowm; + foreach (grep /\s*$mgtifname\b/, @mtable) + { + @rowm = split(/\s+/, $_); + $mtu = $rowm[1]; + } + if ($::DISPLAY) { push @{ $rsp->{data} }, "\n#From $host."; push @{ $rsp->{data} }, "$netname:"; @@ -528,12 +539,17 @@ sub donets push @{ $rsp->{data} }, " gateway=$gw"; } push @{ $rsp->{data} }, " mgtifname=$mgtifname"; + if ($mtu) + { + push @{ $rsp->{data} }, " mtu=$mtu"; + } } else { if (!$foundmatch) { - $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { 'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw }); + $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { 'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw, 'mtu' => $mtu }); } } + my $tent=$nethash{$netname}; unless ($tent and $tent->{tftpserver}) { my $netdev = $ent[7]; @@ -562,7 +578,7 @@ sub donets push @{ $rsp->{data} }, " tftpserver=$ipaddr"; } else { if (!$foundmatch) { - $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { tftpserver => $ipaddr }); + $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { tftpserver => "" }); } } last; diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index d9b9ada43..7188d8cc2 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -4,10 +4,8 @@ package xCAT_plugin::nodediscover; use xCAT::Table; use IO::Socket; use strict; - use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use Data::Dumper; use POSIX "WNOHANG"; use Storable qw(freeze thaw); use IO::Select; @@ -15,7 +13,7 @@ use IO::Handle; use xCAT::Utils; use Sys::Syslog; use Text::Balanced qw(extract_bracketed); - +use xCAT::data::switchinfo; use xCAT::DiscoveryUtils; @@ -175,6 +173,7 @@ sub process_request { } } + # save inventory info into the hwinv table if (defined($request->{cpucount}) or defined($request->{cputype}) or defined($request->{memory}) or defined($request->{disksize})) { my $basicdata; @@ -232,15 +231,32 @@ sub process_request { if ($rent and $rent->{'netboot'}) { $currboot = $rent->{'netboot'}; } + if ($request->{arch}->[0] =~ /x86/ and $currboot !~ /pxe/ and $currboot !~ /xnba/) { $nrtab->setNodeAttribs($node, { netboot => 'xnba' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) { $nrtab->setNodeAttribs($node, { netboot => 'petitboot' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /yaboot/) { $nrtab->setNodeAttribs($node, { netboot => 'yaboot' }); + } elsif($request->{arch}->[0] =~ /armv7l/ and $currboot !~ /onie/) { + #for onie switch, the netboot should be "onie" + $nrtab->setNodeAttribs($node, { netboot => 'onie' }); } } + if(defined $request->{nodetype} and $request->{nodetype}->[0] = 'switch' and $request->{_xcat_clientmac}->[0]){ + #for onie switch, lookup and set the switchtype via mac of mgt interface + my $switchestab = xCAT::Table->new('switches'); + if ($switchestab) { + my $switchtype=$xCAT::data::switchinfo::global_mac_identity{substr(lc($request->{_xcat_clientmac}->[0]),0,8)}; + if(defined $switchtype){ + $switchestab->setNodeAttribs($node,{ switchtype => $switchtype }); + } + $switchestab->close(); + } + } + + my $macstring = ""; if (defined($request->{mac})) { my $mactab = xCAT::Table->new("mac", -create => 1); @@ -252,9 +268,11 @@ sub process_request { my $forcenic = 0; #-1 is force skip, 0 is use default behavior, 1 is force to be declared even if hosttag is skipped to do so foreach (@{ $request->{mac} }) { @ifinfo = split /\|/; + if ($ifinfo[1] eq 'usb0') { #skip usb nic next; } + $bydriverindex{ $ifinfo[0] } += 1; if (scalar @discoverynics) { $forcenic = -1; #$forcenic defaults to explicitly skip nic @@ -295,7 +313,7 @@ sub process_request { push @hostnames_to_update, $hosttag; } } - print Dumper($hosttag) . "\n"; + #print Dumper($hosttag) . "\n"; if ($hosttag) { $usednames{$hosttag} = 1; unless ($usednames_for_net{$netn}) { diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index 94c2969f2..3dfb73b67 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -649,7 +649,10 @@ sub process_request_nmap { # get additional options from site table my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); - my $more_options = $nmap_options[0]; + my $more_options = ""; + if (defined($nmap_options[0])) { + $more_options = $nmap_options[0]; + } foreach my $ip6 (0, 1) { #first pass, ipv4, second pass ipv6 if ($ip6 and scalar(@ip6s)) { diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 17657824d..ec95782b5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -29,13 +29,24 @@ use xCAT::SvrUtils; use xCAT::GlobalDef; use xCAT_monitoring::monitorctrl; +$::VERBOSE = 0; +# String constants for rpower states +$::POWER_STATE_OFF="off"; +$::POWER_STATE_ON="on"; +$::POWER_STATE_POWERING_OFF="powering-off"; +$::POWER_STATE_POWERING_ON="powering-on"; +$::POWER_STATE_QUIESCED="quiesced"; +$::POWER_STATE_RESET="reset"; +$::UPLOAD_FILE=""; + +$::NO_ATTRIBUTES_RETURNED="No attributes returned from the BMC."; + sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { - xCAT::SvrUtils::sendmsg("Warning: Currently running development code, use at your own risk. Unset XCAT_OPENBMC_DEVEL to disable.", $callback); return; } else { - return ([ 1, "This openbmc related function is unsupported and disabled. To bypass, run the following: \n\texport XCAT_OPENBMC_DEVEL=YES" ]); + return ([ 1, "This openbmc related function is not yet supported. Please contact xCAT development team." ]); } } @@ -64,6 +75,18 @@ sub handled_commands { }; } +my $prefix = "xyz.openbmc_project"; + +my %sensor_units = ( + "$prefix.Sensor.Value.Unit.DegreesC" => "C", + "$prefix.Sensor.Value.Unit.RPMS" => "RPMS", + "$prefix.Sensor.Value.Unit.Volts" => "Volts", + "$prefix.Sensor.Value.Unit.Meters" => "Meters", + "$prefix.Sensor.Value.Unit.Amperes" => "Amps", + "$prefix.Sensor.Value.Unit.Watts" => "Watts", + "$prefix.Sensor.Value.Unit.Joules" => "Joules" +); + my $http_protocol="https"; my $openbmc_url = "/org/openbmc"; my $openbmc_project_url = "/xyz/openbmc_project"; @@ -98,6 +121,21 @@ my %status_info = ( process => \&reventlog_response, }, + RFLASH_LIST_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RFLASH_LIST_RESPONSE => { + process => \&rflash_response, + }, + RFLASH_FILE_UPLOAD_REQUEST => { + method => "PUT", + init_url => "$openbmc_project_url/upload/image/", + }, + RFLASH_FILE_UPLOAD_RESPONSE => { + process => \&rflash_response, + }, + RINV_REQUEST => { method => "GET", init_url => "$openbmc_project_url/inventory/enumerate", @@ -106,6 +144,14 @@ my %status_info = ( process => \&rinv_response, }, + RINV_FIRM_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RINV_FIRM_RESPONSE => { + process => \&rinv_response, + }, + RPOWER_ON_REQUEST => { method => "PUT", init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", @@ -180,6 +226,7 @@ my %status_info = ( $::RESPONSE_OK = "200 OK"; $::RESPONSE_SERVER_ERROR = "500 Internal Server Error"; $::RESPONSE_SERVICE_UNAVAILABLE = "503 Service Unavailable"; +$::RESPONSE_METHOD_NOT_ALLOWED = "405 Method Not Allowed"; #----------------------------- @@ -236,6 +283,8 @@ sub preprocess_request { if (ref($request->{environment}) eq 'ARRAY' and ref($request->{environment}->[0]->{XCAT_OPENBMC_DEVEL}) eq 'ARRAY') { $::OPENBMC_DEVEL = $request->{environment}->[0]->{XCAT_OPENBMC_DEVEL}->[0]; + } elsif (ref($request->{environment}) eq 'ARRAY') { + $::OPENBMC_DEVEL = $request->{environment}->[0]->{XCAT_OPENBMC_DEVEL}; } else { $::OPENBMC_DEVEL = $request->{environment}->{XCAT_OPENBMC_DEVEL}; } @@ -322,7 +371,7 @@ sub process_request { push @donargs, [ $node,$bmcip,$node_info{$node}{username}, $node_info{$node}{password}]; } else { $login_url = "$http_protocol://$bmcip/login"; - $content = '{"data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; + $content = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; $handle_id = xCAT::OPENBMC->new($async, $login_url, $content); $handle_id_node{$handle_id} = $node; $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; @@ -345,7 +394,7 @@ sub process_request { } } - $callback->({ errorcode => $check }) if ($check); + $callback->({ errorcode => [$check] }) if ($check); return; } @@ -363,35 +412,38 @@ sub parse_args { my $extrargs = shift; my $noderange = shift; my $check = undef; - - if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig/) { + + if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig|rflash/) { return ([ 1, "No option specified for $command" ]); } - if (scalar(@ARGV) > 1 and ($command =~ /rpower|rinv|rsetboot|rvitals/)) { + my $subcommand = undef; + if (scalar(@ARGV) > 2 and ($command =~ /rpower|rinv|rsetboot|rvitals/)) { return ([ 1, "Only one option is supported at the same time" ]); + } elsif (scalar(@ARGV) == 2) { + # Check if one is calling for Verbose output + foreach (@ARGV) { + if ($_ =~ /V|verbose/) { + $::VERBOSE=1; + } else { + $subcommand = $_ + } + } + } else { + $subcommand = $ARGV[0] } - my $subcommand = $ARGV[0]; if ($command eq "rpower") { - # - # disable function until fully tested - # - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "rinv") { - # - # disable function until fully tested - # - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) { + unless ($subcommand =~ /^model$|^serial$|^firm$|^cpu$|^dimm$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "getopenbmccons") { - #command for openbmc rcons + # command for openbmc rcons } elsif ($command eq "rsetboot") { # # disable function until fully tested @@ -437,11 +489,35 @@ sub parse_args { } } } elsif ($command eq "rvitals") { - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^leds$|^all$/) { + unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^altitude$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } + } elsif ($command eq "rflash") { + # + # disable function until fully tested + # + $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } + my $filename_passed = 0; + foreach my $opt (@$extrargs) { + # Only files ending on .tar are allowed + if ($opt =~ /.*\.tar$/i) { + $filename_passed = 1; + next; + } + if ($filename_passed) { + # Filename was passed, check flags allowed with file + if ($opt !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) { + return ([ 1, "Invalid option specified when a file is provided: $opt" ]); + } + } + else { + # Filename was not passed, check flags allowed without file + if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { + return ([ 1, "Invalid option specified: $opt" ]); + } + } + } } else { return ([ 1, "Command is not supported." ]); } @@ -464,6 +540,14 @@ sub parse_command_status { $next_status{LOGIN_REQUEST} = "LOGIN_RESPONSE"; + my $verbose = undef; + unless (GetOptions( + 'V|verbose' => \$verbose, + )) { + xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback); + return 1; + } + if ($command eq "rpower") { $subcommand = $ARGV[0]; @@ -496,9 +580,20 @@ sub parse_command_status { $subcommand = "all"; } - $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; - $next_status{RINV_REQUEST} = "RINV_RESPONSE"; - $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + if ($subcommand eq "firm") { + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } elsif ($subcommand eq "all") { + $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; + $next_status{RINV_REQUEST} = "RINV_RESPONSE"; + $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + $next_status{RINV_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } else { + $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; + $next_status{RINV_REQUEST} = "RINV_RESPONSE"; + $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + } } if ($command eq "rsetboot") { @@ -552,7 +647,7 @@ sub parse_command_status { if ($command eq "rspconfig") { my @options = (); foreach $subcommand (@ARGV) { - if ($subcommand =~ /^ip$|^netmask$|^gateway$/) { + if ($subcommand =~ /^ip$|^netmask$|^gateway$|^vlan$/) { $next_status{LOGIN_RESPONSE} = "RSPCONFIG_GET_REQUEST"; $next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE"; push @options, $subcommand; @@ -587,6 +682,77 @@ sub parse_command_status { $status_info{RVITALS_RESPONSE}{argv} = "$subcommand"; } + if ($command eq "rflash") { + my $check_version = 0; + my $list = 0; + my $delete = 0; + my $upload = 0; + unless (GetOptions( + 'c|check' => \$check_version, + 'l|list' => \$list, + 'd|delete' => \$delete, + 'u|upload' => \$upload, + )) { + xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback); + return 1; + } + + my $update_file = $ARGV[0]; + my $filename = undef; + my $file_id = undef; + my $grep_cmd = "/usr/bin/grep -a"; + my $version_tag = '"version=IBM"'; + my $purpose_tag = '"purpose="'; + if (defined $update_file) { + # Filename or file id was specified + if ($update_file =~ /.*\.tar$/) { + # Filename ending on .tar was specified + $filename = $update_file; + $::UPLOAD_FILE = $update_file; # Save filename to upload + # Verify file exists and is readable + unless (-r $filename) { + xCAT::SvrUtils::sendmsg([1,"Cannot access $filename"], $callback); + return 1; + } + if ($check_version) { + # Display firmware version of the specified .tar file + my $firmware_version_in_file = `$grep_cmd $version_tag $filename`; + my $purpose_version_in_file = `$grep_cmd $purpose_tag $filename`; + chomp($firmware_version_in_file); + chomp($purpose_version_in_file); + my ($purpose_string,$purpose_value) = split("=", $purpose_version_in_file); + my ($version_string,$version_value) = split("=", $firmware_version_in_file); + if ($purpose_value =~ /host/) { + $purpose_value = "Host"; + } + xCAT::SvrUtils::sendmsg("TAR $purpose_value Firmware Product Version\: $version_value", $callback); + } + } + else { + # TODO Process file id passed in + } + } + if ($check_version) { + # Display firmware version on BMC + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } + if ($list) { + # Display firmware update files uploaded to BMC + $next_status{LOGIN_RESPONSE} = "RFLASH_LIST_REQUEST"; + $next_status{RFLASH_LIST_REQUEST} = "RFLASH_LIST_RESPONSE"; + } + if ($delete) { + xCAT::SvrUtils::sendmsg("Delete option is not yet supported.", $callback); + return 1; + } + if ($upload) { + # Upload specified update file to BMC + $next_status{LOGIN_RESPONSE} = "RFLASH_FILE_UPLOAD_REQUEST"; + $next_status{"RFLASH_FILE_UPLOAD_REQUEST"} = "RFLASH_FILE_UPLOAD_RESPONSE"; + } + } + print Dumper(\%next_status) . "\n"; return; } @@ -704,7 +870,13 @@ sub gen_send_request { if ($method eq "GET") { $debug_info = "$node: DEBUG $method $request_url"; } else { - $debug_info = "$node: DEBUG $method $request_url -d $content"; + if ($::UPLOAD_FILE) { + # Slightly different debug message when doing a file upload + $debug_info = "$node: DEBUG $method $request_url -T " . $::UPLOAD_FILE; + } + else { + $debug_info = "$node: DEBUG $method $request_url -d $content"; + } } print "$debug_info\n"; @@ -735,7 +907,16 @@ sub deal_with_response { if ($response->status_line ne $::RESPONSE_OK) { my $error; if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) { - $error = "Service Unavailable"; + $error = $::RESPONSE_SERVICE_UNAVAILABLE; + } elsif ($response->status_line eq $::RESPONSE_METHOD_NOT_ALLOWED) { + # Special processing for file upload. At this point we do not know how to + # form a proper file upload request. It always fails with "Method not allowed" error. + # If that happens, just assume it worked. + # TODO remove this block when proper request can be generated + $status_info{ $node_info{$node}{cur_status} }->{process}->($node, $response); + + return; + } else { my $response_info = decode_json $response->content; if ($response->status_line eq $::RESPONSE_SERVER_ERROR) { @@ -806,21 +987,21 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); $new_status{$::STATUS_POWERING_ON} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_OFF_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); $new_status{$::STATUS_POWERING_OFF} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("reset", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_RESET", $callback, $node); $new_status{$::STATUS_POWERING_ON} = [$node]; } } @@ -829,9 +1010,26 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + # State is off, but check if it is transitioning + if ($response_info->{'data'}->{RequestedHostTransition} =~ /On$/) { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_ON", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); + } + } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_QUIESCED", $callback, $node); + } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Running$/) { + # State is on, but check if it is transitioning + if ($response_info->{'data'}->{RequestedHostTransition} =~ /Off$/) { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_OFF", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); + } } else { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; + xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); } } @@ -871,48 +1069,63 @@ sub rinv_response { my $response_info = decode_json $response->content; - my $grep_string = $status_info{RINV_RESPONSE}{argv}; + my $grep_string; + if ($node_info{$node}{cur_status} eq "RINV_FIRM_RESPONSE") { + $grep_string = "firm"; + } else { + $grep_string = $status_info{RINV_RESPONSE}{argv}; + } + my $src; my $content_info; + my @sorted_output; foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; - if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { - my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; - xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); - next if ($grep_string eq "model"); - } + if ($grep_string eq "firm") { + # This handles the data from the /xyz/openbmc_project/Software endpoint. + my $sw_id = (split(/\//, $key_url))[-1]; + if (defined($content{Version}) and $content{Version}) { + my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); + $purpose_value = "[$sw_id]$purpose_value"; + my $activation_value = (split(/\./, $content{Activation}))[-1]; + # + # For 'rinv firm', only print Active software, unless verbose is specified + # + if ($activation_value =~ "Active" or $::VERBOSE) { + # + # The space below between "Firmware Product Version:" and $content{Version} is intentional + # to cause the sorting of this line before any additional info lines + # + $content_info = "$purpose_value Firmware Product: $content{Version} ($activation_value)"; + push (@sorted_output, $content_info); + + if (defined($content{ExtendedVersion}) and $content{ExtendedVersion} ne "") { + # ExtendedVersion is going to be a comma separated list of additional software + my @versions = split(',', $content{ExtendedVersion}); + foreach my $ver (@versions) { + $content_info = "$purpose_value Firmware Product: -- additional info: $ver"; + push (@sorted_output, $content_info); + } + } + next; + } + } + } else { + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } - if (($grep_string eq "vpd" or $grep_string eq "serial") and $key_url =~ /\/motherboard$/) { - my $serialnumber = "BOARD Serial Number: " . "$content{SerialNumber}"; - xCAT::SvrUtils::sendmsg("$serialnumber", $callback, $node); - next if ($grep_string eq "serial"); - } + # SPECIAL CASE: If 'serial' or 'model' is specified, only return the system level information + if ($grep_string eq "serial" or $grep_string eq "model") { + if ($key_url ne "$openbmc_project_url/inventory/system") { + next; + } + } - if (($grep_string eq "vpd" or $grep_string eq "mprom")) { - # wait for interface - } - - if (($grep_string eq "vpd" or $grep_string eq "deviceid")) { - # wait for interface - } - - if ($grep_string eq "uuid") { - # wait for interface - } - - if ($grep_string eq "guid") { - # wait for interface - } - - if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) { - my $macaddress = "MAC: " . $content{MACAddress}; - xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); - next; - } - - if ($grep_string eq "all" or $key_url =~ /\/$grep_string/ or ($grep_string eq "firm" and defined($content{Name}) and $content{Name} eq "OpenPOWER Firmware")) { if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { $src = "$1 $2"; } else { @@ -920,11 +1133,32 @@ sub rinv_response { } foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and ((lc($key) !~ m/$grep_string/i) and ($key_url !~ m/$grep_string/i)) ) { + next; + } $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); + push (@sorted_output, $content_info); #Save output in array } } - } + } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + # sort alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + foreach (@sorted_output) { + # + # The firmware output requires the ID to be part of the string to sort correctly. + # Remove this ID from the output to the user + # + $_ =~ s/\[.*?\]//; + xCAT::SvrUtils::sendmsg("$_", $callback, $node); + } + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); + } if ($next_status{ $node_info{$node}{cur_status} }) { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; @@ -1017,7 +1251,7 @@ sub reventlog_response { my $response_info = decode_json $response->content; - if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_REQUEST") { + if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { xCAT::SvrUtils::sendmsg("clear", $callback, $node); } @@ -1136,19 +1370,61 @@ sub rvitals_response { my $grep_string = $status_info{RVITALS_RESPONSE}{argv}; my $src; my $content_info; - my $sensor_value; + my @sorted_output; - print "$node DEBUG Processing command: rvitals $grep_string \n"; - print Dumper(%{$response_info->{data}}) . "\n"; + print "$node: DEBUG Processing command: rvitals $grep_string \n"; + print Dumper(%{$response_info->{data}}); foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; - print Dumper(%content) . "\n"; - # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy - # For now display xxx/yyy as a label - my ($junk, $label) = split("/sensors/", $key_url); - $sensor_value = $label . " " . $content{Value}; - xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); + + # + # Skip over attributes that are not asked to be printed + # + if ($grep_string =~ "temp") { + unless ( $content{Unit} =~ "DegreesC") { next; } + } + if ($grep_string =~ "voltage") { + unless ( $content{Unit} =~ "Volts") { next; } + } + if ($grep_string =~ "wattage") { + unless ( $content{Unit} =~ "Watts") { next; } + } + if ($grep_string =~ "fanspeed") { + unless ( $content{Unit} =~ "RPMS") { next; } + } + if ($grep_string =~ "power") { + unless ( $content{Unit} =~ "Amperes" || $content{Unit} =~ "Joules" || $content{Unit} =~ "Watts" ) { next; } + } + if ($grep_string =~ "altitude") { + unless ( $content{Unit} =~ "Meters" ) { next; } + } + + my $label = (split(/\//, $key_url))[ -1 ]; + + # replace underscore with space, uppercase the first letter + $label =~ s/_/ /g; + $label =~ s/\b(\w)/\U$1/g; + + # + # Calculate the adjusted value based on the scale attribute + # + my $calc_value = $content{Value}; + if ( $content{Scale} != 0 ) { + $calc_value = ($content{Value} * (10 ** $content{Scale})); + } + + $content_info = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; + push (@sorted_output, $content_info); #Save output in array + } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + # Sort the output, alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } if ($next_status{ $node_info{$node}{cur_status} }) { @@ -1161,5 +1437,97 @@ sub rvitals_response { return; } +#------------------------------------------------------- +=head3 rflash_response + + Deal with response of rflash command + Input: + $node: nodename of current response + $response: Async return response + +=cut + +#------------------------------------------------------- +sub rflash_response { + my $node = shift; + my $response = shift; + + my $response_info = decode_json $response->content; + + print Dumper(%{$response_info->{data}}); + + my $update_id; + my $update_activation; + my $update_purpose; + my $update_version; + + if ($node_info{$node}{cur_status} eq "RFLASH_LIST_RESPONSE") { + # Display "list" option header and data + xCAT::SvrUtils::sendmsg("ID Purpose State Version", $callback, $node); + xCAT::SvrUtils::sendmsg("-" x 55, $callback, $node); + + foreach my $key_url (keys %{$response_info->{data}}) { + my %content = %{ ${ $response_info->{data} }{$key_url} }; + + $update_id = (split(/\//, $key_url))[ -1 ]; + if (defined($content{Version}) and $content{Version}) { + $update_version = $content{Version}; + } + if (defined($content{Activation}) and $content{Activation}) { + $update_activation = (split(/\./, $content{Activation}))[ -1 ]; + } + if (defined($content{Purpose}) and $content{Purpose}) { + $update_purpose = (split(/\./, $content{Purpose}))[ -1 ]; + } + xCAT::SvrUtils::sendmsg(sprintf("%-8s %-7s %-8s %s", $update_id, $update_purpose, $update_activation, $update_version), $callback, $node); + } + xCAT::SvrUtils::sendmsg("", $callback, $node); #Separate output in case more than 1 endpoint + } + if ($node_info{$node}{cur_status} eq "RFLASH_FILE_UPLOAD_RESPONSE") { + # Special processing for file upload. At this point we do not know how to + # form a proper file upload request. It always fails with "Method not allowed" error. + # If that happens, just call the curl commands for now. + # TODO remove this block when proper request can be generated + if ($::UPLOAD_FILE) { + my $request_url = "$http_protocol://" . $node_info{$node}{bmc}; + my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; + my $content_logout = '{ "data": [ ] }'; + + # curl commands + my $curl_login_cmd = "curl -c cjar -k -H 'Content-Type: application/json' -X POST $request_url/login -d '" . $content_login . "'"; + my $curl_logout_cmd = "curl -b cjar -k -H 'Content-Type: application/json' -X POST $request_url/logout -d '" . $content_logout . "'"; + my $curl_upload_cmd = "curl -b cjar -k -H 'Content-Type: application/octet-stream' -X PUT -T $::UPLOAD_FILE $request_url/upload/image/"; + + # Try to login + my $curl_login_result = `$curl_login_cmd`; + my $h = from_json($curl_login_result); # convert command output to hash + if ($h->{message} eq $::RESPONSE_OK) { + # Login successfull, upload the file + my $curl_upload_result = `$curl_upload_cmd`; + $h = from_json($curl_upload_result); # convert command output to hash + if ($h->{message} eq $::RESPONSE_OK) { + # Upload successfull + xCAT::SvrUtils::sendmsg("Update file $::UPLOAD_FILE successfully uploaded", $callback, $node); + # Try to logoff, no need to check result, as there is nothing else to do if failure + my $curl_logout_result = `$curl_logout_cmd`; + } + else { + xCAT::SvrUtils::sendmsg("Failed to upload update file $::UPLOAD_FILE :" . $h->{message} . " - " . $h->{data}->{description}, $callback, $node); + } + } + else { + xCAT::SvrUtils::sendmsg("Unable to login :" . $h->{message} . " - " . $h->{data}->{description}, $callback, $node); + } + } + } + + if ($next_status{ $node_info{$node}{cur_status} }) { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + gen_send_request($node); + } else { + $wait_node_num--; + } + return; +} 1; diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 9d54d92fc..e92a7dc0d 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -271,8 +271,6 @@ sub powerpduoutlet { my $value; my $statstr; - my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; - my $type = "INTEGER"; my $tmpnodestr = join(",", @$noderange); my $nodetab = xCAT::Table->new('pduoutlet'); @@ -289,11 +287,11 @@ sub powerpduoutlet { my ($pdu, $outlet) = split /:/, $pdu_outlet; my $session = connectTopdu($pdu,$callback); if (!$session) { - $callback->({ errorcode => [1],error => "Couldn't connect to $pdu"}); + $callback->({ errorcode => [1],error => "$node: Couldn't connect to $pdu"}); next; } if ($outlet > $pdunodes->{$pdu}->{outlet} ) { - $callback->({ errorcode => [1],error => "outlet number $outlet is invalid for $pdu"}); + $callback->({ error => "$node: $pdu outlet number $outlet is invalid"}); next; } my $cmd; @@ -316,7 +314,7 @@ sub powerpduoutlet { } if ($session->{ErrorStr}) { - $callback->({ errorcode => [1],error => "$session->{ErrorStr} for $pdu outlet $outlet"}); + $callback->({ errorcode => [1],error => "$node: $pdu outlet $outlet has error = $session->{ErrorStr}"}); } else { $output = "$pdu outlet $outlet is $statstr"; xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes); @@ -341,6 +339,10 @@ sub outletpower { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $type = "INTEGER"; + if ($session->{newmib}) { + $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; + } + my $varbind = new SNMP::Varbind([ $oid, $outlet, $value, $type ]); return $session->set($varbind); @@ -392,6 +394,9 @@ sub outletstat { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $output; my $statstr; + if ($session->{newmib}) { + $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; + } $output = $session->get("$oid.$outlet"); if ($output eq 1) { @@ -421,6 +426,7 @@ sub connectTopdu { my $community = "public"; my $session; my $msg = "connectTopdu"; + my $versionoid = ".1.3.6.1.4.1.2.6.223.7.3.0"; $session = new SNMP::Session( DestHost => $pdu, @@ -431,12 +437,22 @@ sub connectTopdu { unless ($session) { return; } + + my $varbind = new SNMP::Varbind([ $versionoid, '' ]); + my $pduversion = $session->get($varbind); + if ($session->{ErrorStr}) { + return; + } + + $session->{newmib} = 0; + if ($pduversion =~ /sLEN/) { + $session->{newmib} = 1; + } + return $session; } - - 1; diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index faa292721..04f7bcdf7 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -6,7 +6,7 @@ use Getopt::Long; use xCAT::Table; use Sys::Syslog; use xCAT::Scope; - +use xCAT::Usage; my $globaltftpdir = xCAT::TableUtils->getTftpDir(); my %usage = ( @@ -322,11 +322,14 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; } @@ -357,10 +360,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } @@ -484,9 +487,10 @@ sub process_request { my $inittime = 0; if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -494,8 +498,11 @@ sub process_request { arg => \@args, bootparams => \%bphash}, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } # Fix the bug 4611: PowerNV stateful CN provision will hang at reboot stage# if ($args[0] eq 'next') { diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 6b5d70f7b..421b4d71e 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -18,6 +18,7 @@ require xCAT::Utils; require xCAT::MsgUtils; use xCAT::NodeRange; use xCAT::Table; +use xCAT::Usage; use Data::Dumper; use Getopt::Long; @@ -96,6 +97,16 @@ sub rinstall { } if (($command =~ /rinstall/) or ($command =~ /winstall/)) { + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + my $rsp={}; + $rsp->{error}->[0] = $ret->[1]; + $rsp->{errorcode}->[0] = $ret->[0]; + xCAT::MsgUtils->message("E", $rsp, $callback); + &usage($command,$callback); + return; + } + my $state = $ARGV[0]; my $reststates; ($state, $reststates) = split(/,/, $state, 2); @@ -340,7 +351,9 @@ sub rinstall { # We got an error with the nodeset my @successnodes; my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if (($line =~ /: install/) or ($line =~ /: netboot/)) { my $successnode; @@ -364,9 +377,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'nodeset' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } @nodes = @successnodes; } @@ -401,7 +416,6 @@ sub rinstall { }, $subreq, -1, 1); - $rc = $::RUNCMD_RC; my $rsp = {}; if ($VERBOSE) { @@ -414,7 +428,9 @@ sub rinstall { # We got an error with the rnetboot my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if ($line =~ /: Success/) { my $successnode; @@ -430,9 +446,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rnetboot' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rnetboot' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } } else { @@ -476,7 +494,9 @@ sub rinstall { # We got an error with the rsetboot my @successnodes; my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if ($line =~ /: Network/) { my $successnode; @@ -493,9 +513,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rsetboot' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rsetboot' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } @nodes = @successnodes; } } @@ -533,7 +555,9 @@ sub rinstall { unless ($rc == 0) { # We got an error with the rpower my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if (($line =~ /: on reset/) or ($line =~ /: off on/)) { my $successnode; @@ -549,9 +573,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rpower' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rpower' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } } } @@ -596,8 +622,8 @@ sub usage { my $callback = shift; my $rsp = {}; $rsp->{data}->[0] = "Usage:"; - $rsp->{data}->[1] = " $command boot | shell | runcmd=bmcsetup [-c|--console] [-u|--uefimode] [-V|--verbose]"; - $rsp->{data}->[2] = " $command osimage= | -O [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]"; + $rsp->{data}->[1] = " $command [boot | shell | runcmd=bmcsetup] [runimage=] [-c|--console] [-u|--uefimode] [-V|--verbose]"; + $rsp->{data}->[2] = " $command [osimage= | ] [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]"; $rsp->{data}->[3] = " $command [-h|--help|-v|--version]"; xCAT::MsgUtils->message("I", $rsp, $callback); } diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 164e6d46c..f69689a1e 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1707,12 +1707,10 @@ erver, if so, stop it first and try again" ], sub using_dracut { my $rootimgdir = shift; - my $chkcmd = "chroot $rootimgdir/rootimg dracut --list-modules"; - my $rc = system($chkcmd); - if ($rc) { - return 0; - } else { + if ( -f "$rootimgdir/rootimg/etc/dracut.conf" ) { return 1; + } else { + return 0; } } diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index daed8b6e6..e6f2e5e2d 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -355,6 +355,11 @@ sub process_request { xCAT::Utils->runcmd("mkdir $rootimg_dir/.statebackup", 0, 1); } + #delete useless rootimg/tmp/dracut.* files + #fix copy many dracut.* files cost too much time in liteimg + $verbose && $callback->({ info => ["removing \"$rootimg_dir/tmp/dracut.*\""] }); + unlink glob "$rootimg_dir/tmp/dracut.*"; + # recovery the files in litefile.save if necessary foreach my $line (keys %hashSaved) { my @oldentry = split(/\s+/, $line); diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index ba3d1281f..61dbce696 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -293,15 +293,19 @@ sub process_request { #discovery working. Food for thought. return; } + my $discoverswitch = 0; + if (defined $req->{nodetype} and $req->{nodetype}->[0] eq 'switch') { + $discoverswitch = 1; + } my $firstpass = 1; if ($mac) { - $node = $macmap->find_mac($mac, $req->{cacheonly}->[0]); + $node = $macmap->find_mac($mac, $req->{cacheonly}->[0], $discoverswitch); $firstpass = 0; } if (not $node) { # and $req->{checkallmacs}->[0]) { foreach (@{ $req->{mac} }) { /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; - $node = $macmap->find_mac($1, $firstpass); + $node = $macmap->find_mac($1, $firstpass, $discoverswitch); $firstpass = 0; if ($node) { last; } } diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ebc6cb61b..70970480d 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -21,6 +21,7 @@ no strict; use Data::Dumper; use Socket; use Expect; +use xCAT::data::switchinfo; #global variables for this module my $community; @@ -33,31 +34,6 @@ my %global_scan_type = ( snmp => "snmp_scan" ); -my %global_mac_identity = ( - "a8:97:dc" => "BNT G8052 switch", - "6c:ae:8b" => "BNT G8264-T switch", - "fc:cf:62" => "BNT G8124 switch", - "7c:fe:90" => "Mellanox IB switch", - "8c:ea:1b" => "Edgecore Networks Switch" -); - -my %global_switch_type = ( - Juniper => "Juniper", - juniper => "Juniper", - Cisco => "Cisco", - cisco => "Cisco", - BNT => "BNT", - Blade => "BNT", - G8052 => "BNT", - RackSwitch => "BNT", - Mellanox => "Mellanox", - mellanox => "Mellanox", - MLNX => "Mellanox", - MELLAN => "Mellanox", - Edgecore => "onie" -); - - #------------------------------------------------------------------------------- =head1 xCAT_plugin:switchdiscover @@ -737,16 +713,16 @@ sub nmap_scan { } my $vendor = $addr->{vendor}; if ($vendor) { - my $search_string = join '|', keys(%global_switch_type); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); if ($vendor =~ /($search_string)/) { $found = 1; } } if ( ($found == 0) && ($type eq "mac") ) { - my $search_string = join '|', keys(%global_mac_identity); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_mac_identity); if ($mac =~ /($search_string)/i) { my $key = $1; - $vendor = $global_mac_identity{lc $key}; + $vendor = $xCAT::data::switchinfo::global_mac_identity{lc $key}; $found = 1; } @@ -840,7 +816,7 @@ sub nmap_osguess { last; } } - my $search_string = join '|', keys(%global_switch_type); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); if ($line =~ /Running/) { if ($line =~ /($search_string)/){ $vendor = $1; @@ -1169,10 +1145,10 @@ sub get_switchtype { my $vendor = shift; my $key = "Not support"; - my $search_string = join '|', keys(%global_switch_type); + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); if ($vendor =~ /($search_string)/) { $key = $1; - return $global_switch_type{$key}; + return $xCAT::data::switchinfo::global_switch_type{$key}; } else { return $key; } diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index eba36892d..dd8fe9d1c 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -11,6 +11,7 @@ use Getopt::Long; use xCAT::Utils; use xCAT::TableUtils; use xCAT::ServiceNodeUtils; +use xCAT::Usage; my $dhcpconf = "/etc/dhcpd.conf"; @@ -116,7 +117,7 @@ sub setstate { #Implement the kcmdline append here for #most generic, least code duplication -###hack start + ###hack start # This is my comment. There are many others like it, but this one is mine. # My comment is my best friend. It is my life. I must master it as I must master my life. # Without me, my comment is useless. Without my comment, I am useless. @@ -166,7 +167,7 @@ sub setstate { #$kern->{kcmdline} .= " ".$kern->{addkcmdline}; $kern->{kcmdline} .= " " . $kcmdlinehack; -###hack end + ###hack end } } @@ -242,7 +243,7 @@ sub setstate { if ($kern->{kernel} =~ /esxi[56]/) { #Make uefi boot provisions my $ucfg; open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); - if ($kern->{kcmdline} =~ / xcat\/netboot/) { + if ($kern->{kcmdline} =~ /xcat\/netboot/) { $kern->{kcmdline} =~ s/xcat\/netboot/\/tftpboot\/xcat\/netboot/; } print $ucfg "#!gpxe\n"; @@ -367,11 +368,14 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; } @@ -404,10 +408,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } sub process_request { @@ -541,9 +545,10 @@ sub process_request { my $inittime = 0; if (exists($::XNBA_request->{inittime})) { $inittime = $::XNBA_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -551,10 +556,12 @@ sub process_request { arg => \@args , bootparams => \%bphash}, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } - #Time to actually configure the nodes, first extract database data with the scalable calls my $chaintab = xCAT::Table->new('chain'); my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 8e8ac37c9..1b3c3ab7e 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -12,6 +12,7 @@ use File::Path; use Socket; use Getopt::Long; use xCAT::Table; +use xCAT::Usage; my %breaknetbootnodes; our %normalnodes; @@ -422,15 +423,18 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; - } - + } #Assume shared tftp directory for boring people, but for cool people, help sync up tftpdirectory contents when #if they specify no sharedtftp in site table diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 4327ff09d..51a3f1469 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -464,6 +464,10 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL || $::genCredentials) } +if ($::UPDATEINSTALL) { + upgrade_conserver(); +} + # more config needed after xcatd start if ($::INITIALINSTALL || $::FORCE) { @@ -2338,3 +2342,45 @@ sub startnamedonboot } } } + +#----------------------------------------------------------------------------- + +=head3 upgrade_conserver + + Update conserver configuration files while upgrading xcat + +=cut + +#----------------------------------------------------------------------------- +sub upgrade_conserver +{ + my $version = xCAT::Utils::get_conserver_version(); + if (!$version) { + return; + } + if (xCAT::Utils::calc_conserver_version($version) < xCAT::Utils::calc_conserver_version("8.1.19")) { + return; + } + my $cmd = "/bin/cat /etc/conserver.cf | grep sslauthority"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + return; + } + $cmd = "sed -i 's/sslauthority/sslcacertificatefile/1' /etc/conserver.cf"; + xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) { + return; + } + #restart conserver daemon + if (xCAT::Utils->isAIX()) { + $cmd = "stopsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "startsrc -s conserver"; + xCAT::Utils->runcmd($cmd, 0); + } else { + $cmd = "/etc/init.d/conserver stop"; + xCAT::Utils->runcmd($cmd, 0); + $cmd = "/etc/init.d/conserver start"; + xCAT::Utils->runcmd($cmd, 0); + } +} diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 2bc097027..99792c097 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -97,7 +97,7 @@ if ($inet6support) { if ($^O =~ /^linux/i) { # Is IPv6 enabled on the MN or SN at all? - my $ipv6enabled = `ip addr | grep inet6`; + my $ipv6enabled = `ip -6 -o a`; if (!$ipv6enabled) { $inet6support = 0; } @@ -221,6 +221,20 @@ my $cmdlog_alllog = "====================================================\n"; my $cmdlog_starttime=undef; # ----used for command log end--------- +my $enable_perf = $sitetab->getAttribs({'key'=>'enableperf'},'value'); +if($enable_perf) { + # Enabled by user, check whether nytperf library is enabled + if (!defined(&DB::disable_profile)) { + xCAT::MsgUtils->message("S", "Perf is enabled in sitetable, but can not load the library."); + $enable_perf = 0; + } else { + if ($enable_perf) { + xCAT::MsgUtils->perf_log_info("start profiling"); + DB::enable_profile(); + } + } +} + $sitetab->close; @@ -926,7 +940,9 @@ unless ($foreground) { } $dbmaster = xCAT::Table::init_dbworker; - +if ($enable_perf) { + xCAT::MsgUtils->perf_log_process( "db", undef, "dbprocess", $dbmaster ); +} # Make sure DB process is ready. wait_db_process(); my $CHILDPID = 0; # Global for reapers @@ -1026,7 +1042,9 @@ $SIG{TERM} = $SIG{INT} = sub { if ($cmdlog_svrpid) { kill 'INT', $cmdlog_svrpid; } - + if ($enable_perf) { +# DB::finish_profile(); + } # ----used for command log end--------- }; @@ -1525,6 +1543,10 @@ until ($quit) { if ($sslfudgefactor) { $sslfudgefactor -= 1; } $sslclients++; # THROTTLE $cnnection->close(); + if ($enable_perf) { + xCAT::MsgUtils->perf_log_info("stop profiling"); +# DB::disable_profile(); + } } if (open($mainpidfile, "<", "/var/run/xcat/mainservice.pid")) { my $pid = <$mainpidfile>; @@ -1949,6 +1971,9 @@ sub plugin_command { } } $$progname = $oldprogname; + if ($enable_perf) { + xCAT::MsgUtils->perf_log_process('plugin', $req, "modname:$modname"); + } $parent_fd = $org_parent_fd; if ($sock) { close($parent_fd); @@ -2689,6 +2714,9 @@ sub service_connection { $req = get_request($sock, $globalencode, $line); unless ($req) { last; } + if ($enable_perf) { + xCAT::MsgUtils->perf_log_process('immediate', $req); + } # ----used for command log start---------- $cmdlog_starttime = time(); my ($sec, $min, $hour, $mday, $mon, $year) = localtime($cmdlog_starttime); diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index fd4546c3c..631e7200a 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -125,7 +125,9 @@ if (grep /IPMI Version : 1.5/, @mcinfo) { $solcom = "isol"; $iface = "lan"; } elsif (grep /Manufacturer ID : 343/, @mcinfo && ! grep /Product ID : 117/,@mcinfo) { - $isintel = 1; + if (! grep /Product ID\s*:\s*64/,@mcinfo) { + $isintel = 1; + } } my $inteloption = ""; if ($isintel) { diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 311a7294d..fcc517565 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -141,19 +141,8 @@ if [ -z "$install_disk" ]; then disk_wwn=$(echo $output_for_wwn | $utolcmd) output_for_path=$(IFS= ;echo $disk_info | grep DEVPATH | cut -d "=" -f2) disk_path=$(echo $output_for_path | $utolcmd) - - # Work around the issue Pegas running on Power9 installation hang in anaconda - # with "TypeError: argument of type 'NoneType' is not iterable", - # after running of "udevadm info --attribute-walk --name=/dev/sda" in %pre section of kickstart - cpu_model=$(awk '/model/ { print $NF }' /proc/cpuinfo) - p9_bool=$(grep POWER9 /proc/cpuinfo|head -n 1|awk '{print $3}') - anaconda --version >/dev/null 2>&1 - if [ $? -eq 0 ] && [ "$cpu_model" = "0000000000000000" ] && [ "$p9_bool" = "POWER9" ]; then - disk_driver="" - else - disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'| + disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'| \head -n 1| sed -e 's/[^"]*"//' -e 's/"//' | $utolcmd) - fi echo "[get_install_disk]The disk $disk information: " echo "[get_install_disk] disk_wwn=$disk_wwn" diff --git a/xCAT-server/share/xcat/install/scripts/post.rh.common b/xCAT-server/share/xcat/install/scripts/post.rh.common index e3f570030..d9cd19a5a 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh.common +++ b/xCAT-server/share/xcat/install/scripts/post.rh.common @@ -39,12 +39,12 @@ elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-F fi #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') -IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') -if [ -z $IP ] +IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') +if [ -z "$IP" ] then dhclient $PRINIC #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') - IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') + IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') fi export HOSTNAME=$(host $IP 2>/dev/null | awk '{print $5}' | awk -F. '{print $1}') diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 index 3b36dfefe..f5c9de34e 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -9,11 +9,11 @@ for i in $(find /etc/sysconfig/network-scripts/ifcfg-*|egrep -v ifcfg-lo ) do nicname=$(echo $i|awk -F 'ifcfg-' '{print $2}') - if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1 + if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1; then if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then msgutil_r "$MASTER_IP" "info" "set NIC $nicname to be activated on system boot" "/var/log/xcat/xcat.log" fi - then sed -i 's/ONBOOT=no/ONBOOT=yes/' $i + sed -i 's/ONBOOT=no/ONBOOT=yes/' $i fi #remove the entry 'HWADDR' from ifcfg-ethx, this is used to skip the diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu.common b/xCAT-server/share/xcat/install/scripts/post.ubuntu.common index 7d1fa02a7..c937a7273 100755 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu.common +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu.common @@ -22,12 +22,12 @@ elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-F export PRINIC=`ip -o link|grep -i "$PRINIC" |awk '{print $2}'|sed s/://` fi #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') -IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') +IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') if [ -z $IP ] then dhclient $PRINIC #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') - IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') + IP=$(ip -4 -o a sh dev $PRINIC | awk '/inet/{print $4}' | head -n 1 | awk -F '/' '{print $1}') fi if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 84897d2ed..0f914415e 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -615,7 +615,7 @@ if ((-d "$rootimg_dir/usr/share/dracut") or (-d "$rootimg_dir/usr/lib/dracut")) $dracutmode = 1; # get dracut version - $dracutver = `rpm --root $rootimg_dir -qi dracut | grep Version | awk -F' ' '{print \$3}' `; + $dracutver = `chroot $rootimg_dir rpm -qi dracut | awk '/Version/{print \$3}' `; chomp($dracutver); if ($dracutver =~ /^\d\d\d$/) { if ($dracutver >= "033") { diff --git a/xCAT-server/share/xcat/scripts/configBNT b/xCAT-server/share/xcat/scripts/configBNT index 3b31b975b..c58c1c1f9 100755 --- a/xCAT-server/share/xcat/scripts/configBNT +++ b/xCAT-server/share/xcat/scripts/configBNT @@ -72,6 +72,12 @@ my $switchhash; my $passwdtab; my @passwd_ent; +#set community string for switch +my $community = "public"; +my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); +my $tmp = $snmpcs[0]; +if (defined($tmp)) { $community = $tmp } + if ($::SWITCH) { my @filternodes = xCAT::NodeRange::noderange( $::SWITCH ); if (nodesmissed) { @@ -80,7 +86,7 @@ if ($::SWITCH) { } # check switch attributes $switchestab = xCAT::Table->new('switches'); - $switchhash = $switchestab->getNodesAttribs(\@filternodes,['switchtype','sshusername','sshpassword','protocol']); + $switchhash = $switchestab->getNodesAttribs(\@filternodes,['switchtype','sshusername','sshpassword','protocol','password','snmpversion']); # get switch username and password from passwd $passwdtab = xCAT::Table->new('passwd'); @@ -98,6 +104,9 @@ if ($::SWITCH) { $switchhash->{$fsw}->[0]->{sshpassword} = $passwd_ent[0]->{password}; } } + if (!defined($switchhash->{$fsw}->[0]->{password})) { + $switchhash->{$fsw}->[0]->{password} = $community; + } push @nodes, $fsw; } else { xCAT::MsgUtils->message("E","The $fsw is not BNT switch, will not config"); @@ -117,12 +126,6 @@ if ($::SWITCH) { my $mactab = xCAT::Table->new("mac"); my $machash = $mactab->getNodesAttribs(\@nodes,['mac']); -#set community string for switch -my $community = "public"; -my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); -my $tmp = $snmpcs[0]; -if (defined($tmp)) { $community = $tmp } - my $switches = join(",",@nodes); my $cmd; my $vlan; @@ -330,12 +333,20 @@ sub config_snmp { my $username; my $passwd; my $protocol; + my $snmppass; + my $snmpversion; my $login_cmd; $username = $switchhash->{$switch}->[0]->{sshusername}; $passwd = $switchhash->{$switch}->[0]->{sshpassword}; $protocol = $switchhash->{$switch}->[0]->{protocol}; + if ($switchhash->{$switch}->[0]->{snmpversion} =~ /3/) { + $snmppass=$community; + } else { + $snmppass = $switchhash->{$switch}->[0]->{password}; + } + if ($protocol =~ /telnet/) { $login_cmd = "telnet $switch\r"; } else { @@ -343,7 +354,7 @@ sub config_snmp { } #get hostname on the switch in case hostname is different - my $ccmd = "snmpwalk -Os -v1 -c $community $switch 1.3.6.1.2.1.1.5"; + my $ccmd = "snmpwalk -Os -v1 -c $snmppass $switch 1.3.6.1.2.1.1.5"; my $result = xCAT::Utils->runcmd($ccmd, 0); my ($desc,$switchhost) = split /: /, $result; if (!$switchhost) { diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 2e6f1db34..43dc783b7 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -26,13 +26,13 @@ use xCAT::MsgUtils; Getopt::Long::Configure("bundling"); $Getopt::Long::ignorecase = 0; -#global variables +# global variables my @nodes; my @filternodes; #--------------------------------------------------------- -#Main +# Main # parse the options if ( @@ -43,9 +43,9 @@ if ( 'ip' => \$::IP, 'name' => \$::NAME, 'snmp' => \$::SNMP, - 'user=s' => \$::USER, - 'password=s' => \$::PASSWORD, - 'auth=s' => \$::AUTH, + 'vlan=s' => \$::VLAN, + 'port=s' => \$::PORT, + 'mode=s' => \$::MODE, 'all' => \$::ALL, ) ) @@ -93,6 +93,16 @@ my $user; my $cmd; my $rc; my $master; +my $vlan; +my $port; +my $mode; + +# set community string for switch +my $community = "public"; +my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); +my $tmp = $snmpcs[0]; +if (defined($tmp)) { $community = $tmp } + if (($::IP) || ($::ALL)) { config_ip(); @@ -102,8 +112,7 @@ if (($::NAME) || ($::ALL)) { config_hostname(); } -if (($::SNMP) || ($::ALL)) -{ +if (($::SNMP) || ($::ALL)) { config_snmp(); } @@ -111,6 +120,9 @@ if (($::CONFIG) || ($::ALL)) { run_rspconfig(); } +if ($::VLAN) { + config_vlan(); +} sub config_ip { my @config_switches; @@ -125,14 +137,13 @@ sub config_ip { @nets = $nettab->getAllAttribs('net','mask'); } foreach my $switch (@nodes) { - print "change $switch to static ip address\n"; my $dip= $nodehash->{$switch}->[0]->{otherinterfaces}; if (!$dip) { print "Add otherinterfaces attribute for discover ip: chdef $switch otherinterfaces=x.x.x.x\n"; next; } - #Validate if this IP is reachable + # Validate if this IP is reachable my $p = Net::Ping->new(); if (!$p->ping($dip)) { print "$dip is not reachable\n"; @@ -147,7 +158,7 @@ sub config_ip { next; } - #get hostname + # get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); # if hostnames are same, created different one for discovery name @@ -155,25 +166,38 @@ sub config_ip { $dswitch=""; } - #if not defined, need to create one for xdsh to use + # if not defined, need to create one for xdsh to use if (!$dswitch) { my $ip_str = $dip; $ip_str =~ s/\./\-/g; $dswitch = "switch-$ip_str"; } - $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin nodetype=switch"; + $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin password=admin mgt=switch nodetype=switch"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts $dswitch"; $rc= xCAT::Utils->runcmd($cmd, 0); + $cmd = "makedns $dswitch"; + $rc= xCAT::Utils->runcmd($cmd, 0); + + $cmd="rspconfig $dswitch sshcfg=enable"; + $rc= xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message("E"," Failed to config ssh passwordless for $dip"); + print "Failed to config ssh passwordless for $dswitch, $dip\n"; + push (@discover_switches, $dswitch); + next; + } # verify if xdsh works $cmd = "xdsh $dswitch -l admin --devicetype IBSwitch::Mellanox 'enable;configure terminal;exit' "; $rc= xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E","Couldn't communicate with $dswitch, $dip"); + xCAT::MsgUtils->message("E","Couldn't communicate with $dip"); + print "$cmd failed, Couldn't communicate with $dswitch, $dip\n"; + push (@discover_switches, $dswitch); next; } - #get netmask + # get netmask my $mask; foreach my $net (@nets) { if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $static_ip, $net->{'mask'}, 0)) { @@ -186,18 +210,23 @@ sub config_ip { push (@discover_switches, $dswitch); push (@config_switches, $switch); + print "$switch: Changing IP address to static IP $static_ip\n"; } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=ip_configed otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); + $cmd = "makehosts $csw"; + $rc= xCAT::Utils->runcmd($cmd, 0); } if (@discover_switches) { my $dsw = join(",",@discover_switches); - #remove discover switch from xCATdb and /etc/hosts + # remove discover switch from xCATdb and /etc/hosts + $cmd = "makedns -d $dsw"; + $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts -d $dsw"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "rmdef $dsw"; @@ -223,63 +252,58 @@ sub config_hostname { xCAT::MsgUtils->message("E","Failed to setup hostname for $switch"); next; } - push (@config_switches, $switch); + push (@config_switches, $switch); + print "$switch: Changing host name to $switch\n"; } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=hostname_configed" ; $rc= xCAT::Utils->runcmd($cmd, 0); } } -#setup secure SNMP v3 +# setup secure SNMP v3 sub config_snmp { my $snmp_user; my $snmp_passwd; my $snmp_auth; my $switchtab = xCAT::Table->new('switches'); - my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','username','password','auth']); + my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','username','password','auth','privacy']); foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; - $cmd = "chdef $switch username=admin"; - $rc= xCAT::Utils->runcmd($cmd, 0); + print "switch ssh username is not defined, use default one\n"; $user="admin"; } - if ($::USER) { - $snmp_user = $::USER; - } elsif ($switchhash->{$switch}->[0]->{username}) { - $snmp_user = $switchhash->{$switch}->[0]->{username}; - } else { - $snmp_user = "xcatadmin\r"; + $snmp_user = $switchhash->{$switch}->[0]->{username}; + if (!$snmp_user) { + print "No snmp user defined for switch $switch. Will not configure snmpv3\n"; + next; } - if ($::PASSWORD) { - $snmp_passwd = $::PASSWORD; - } elsif ($switchhash->{$switch}->[0]->{password}) { - $snmp_passwd = $switchhash->{$switch}->[0]->{password}; + $snmp_passwd = $switchhash->{$switch}->[0]->{password}; + $snmp_auth = $switchhash->{$switch}->[0]->{auth}; + my $snmp_privacy = $switchhash->{$switch}->[0]->{privacy}; + + my $cmd_prefix = "xdsh $switch -l $user --devicetype IBSwitch::Mellanox"; + my $cmd; + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "snmp-server user $snmp_user v3 enable\;"; + if ($snmp_privacy) { + $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd priv $snmp_privacy $snmp_passwd\;"; } else { - # Need a special character - $snmp_passwd = "passw0rd\r"; - } - if ($::AUTH) { - $snmp_auth = $::AUTH; - } elsif ($switchhash->{$switch}->[0]->{auth}) { - $snmp_auth = $switchhash->{$switch}->[0]->{auth}; - } else { - $snmp_auth = "sha\r"; + $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd\; no snmp-server user $snmp_user v3 require-privacy\;"; } - $cmd = "xdsh $switch -l $user --devicetype IBSwitch::Mellanox 'enable;configure terminal;snmp-server user $snmp_user v3 enable;snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd;no snmp-server user $snmp_user v3 require-privacy;configuration write;exit' "; - $rc= xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E","Failed to set snmpv3 for $switch"); - } else { - $cmd = "chdef $switch status=snmp_configed snmpversion=3 snmpauth=$snmp_auth snmpusername=$snmp_user snmppassword=$snmp_passwd"; - $rc= xCAT::Utils->runcmd($cmd, 0); - } + print "$switch: snmpv3 configured\n"; + + $cmd = $cmd . "configuration write\;exit\;"; + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; + + `$final_cmd` } } @@ -288,28 +312,27 @@ sub run_rspconfig { my $switchtab = xCAT::Table->new('switches'); my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername']); $master = `hostname -i`; - print "master=$master\n"; foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; - #call rspconfig command to setup switch - #enable ssh + # call rspconfig command to setup switch + # enable ssh $cmd=`rspconfig $switch sshcfg=enable`; - #enable snmp function on the switch + # enable snmp function on the switch $cmd=`rspconfig $switch snmpcfg=enable`; - #enable the snmp trap + # enable the snmp trap $cmd=`rspconfig $switch alert=enable`; - #Logging destination: + # Logging destination: $cmd=`rspconfig $switch logdest=$master`; - #config ntp + # config ntp $cmd = `xdsh $switch -l $user --devicetype IBSwitch::Mellanox "enable;configure terminal;ntp enable;ntpdate $master; ntp server $master;configuration write;show ntp" `; push (@config_switches, $switch); } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=switch_configed" ; $rc= xCAT::Utils->runcmd($cmd, 0); @@ -317,6 +340,87 @@ sub run_rspconfig { } +sub config_vlan { + my @ports; + my $port_input; + # checking for port number, switches is checked earlier + if ($::PORT) { + $port_input = $::PORT; + foreach my $num_str (split /,/, $port_input) { + if ($num_str =~ /-/) { + my ($min, $max) = split (/-/,$num_str); + while ($min <= $max) { + push (@ports,$min); + $min++; + } + } else { + push (@ports,$num_str); + } + } + } else { + xCAT::MsgUtils->message("E"," When configuring VLAN, a port must be provided."); + &usage; + exit(1); + } + + # will default to trunk mode + if ($::MODE) { + $mode = $::MODE; + if (!($mode =~ m/(access|trunk|hybrid|access-dcb|dot1q-tunnel)/) ) + { + xCAT::MsgUtils->message("E"," Please provided supported mode"); + &usage; + exit(1); + } + } else { + $mode = "access"; + } + + $vlan = $::VLAN; + + foreach my $switch (@nodes) { + my $devicetype; + + # check if it is ethernet switch or ib switch + my $ccmd = "snmpwalk -Os -v1 -c $community $switch 1.3.6.1.2.1.1.1"; + my $result = xCAT::Utils->runcmd($ccmd, 0); + + # only supports MSX1410 and MSX1400 for Mellanox Ethernet switch now + if ( $result =~ /MSX14/ ) { + $devicetype = "EthSwitch::Mellanox"; + }else { + xCAT::MsgUtils->message("E","Config IB switch VLAN is not support yet"); + $devicetype = "IBSwitch::Mellanox"; + next; + } + + print "Tagging VLAN=$vlan for $switch port $port_input\n"; + + # create vlan + my $vlan_cmd = `xdsh $switch --devicetype $devicetype "enable;configure terminal;vlan $vlan;exit;exit" `; + + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; + foreach my $port (@ports) { + my $cmd; + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "interface ethernet 1/$port\;"; + $cmd = $cmd . "switchport mode $mode\;"; + if ($mode =~ /access/) { + $cmd = $cmd . "switchport access vlan $vlan\;"; + } else { + $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + } + $cmd = $cmd . "exit\;exit\;exit\;"; + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; + + `$final_cmd` + } + } +} + + #--------------------------------------------------------- =head3 usage @@ -332,13 +436,24 @@ sub usage configMellanox -h│--help configMellanox --switches switchnames --ip configMellanox --switches switchnames --name - configMellanox --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--auth snmp_auth] + configMellanox --switches switchnames --snmp To set the ip address, hostname, config snmp and run rspconfig command: configMellanox --switches switchnames --all To run rspconfig command: configMellanox --switches switchnames --config + + To configure VLAN on a specified port (Mellanox Ethernet switch ONLY): + configMellanox --switches switchnames --port port --vlan vlan --mode mode + + The following mode are supported for switchport: + * access Only untagged ingress Ethernet packets are allowed + * trunk Only tagged ingress Ethernet packets are allowed + * hybrid Both tagged and untagged ingress Ethernet packets are allowed + * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + \n"; } diff --git a/xCAT-server/share/xcat/scripts/configonie b/xCAT-server/share/xcat/scripts/configonie index 68a9ab1a0..f3e49a59b 100755 --- a/xCAT-server/share/xcat/scripts/configonie +++ b/xCAT-server/share/xcat/scripts/configonie @@ -125,11 +125,28 @@ sub config_ssh { my $cmd; my @config_switches; + my $nodetab = xCAT::Table->new('hosts'); + my $nodehash = $nodetab->getNodesAttribs(\@nodes,['ip','otherinterfaces']); + foreach my $switch (@nodes) { #remove old host key from /root/.ssh/known_hosts $cmd = `ssh-keygen -R $switch`; - my ($exp, $errstr) = cumulus_connect($switch, $userid, $password, $timeout); + my $static_ip = $nodehash->{$switch}->[0]->{ip}; + my $discover_ip = $nodehash->{$switch}->[0]->{otherinterfaces}; + my $ssh_ip; + + my $p = Net::Ping->new(); + if ($p->ping($static_ip)) { + $ssh_ip = $static_ip; + } elsif ($p->ping($discover_ip)) { + $ssh_ip = $discover_ip; + } else { + print "$switch is not reachable\n"; + next; + } + + my ($exp, $errstr) = cumulus_connect($ssh_ip, $userid, $password, $timeout); if (!defined $exp) { print ("connect failed $errstr\n"); next; @@ -142,6 +159,10 @@ sub config_ssh { ($ret, $err) = cumulus_exec($exp, "chmod 700 /root/.ssh"); ($ret, $err) = cumulus_exec($exp, "echo \"$rootkey\" >/root/.ssh/authorized_keys"); ($ret, $err) = cumulus_exec($exp, "chmod 644 /root/.ssh/authorized_keys"); + #config dhcp ip address to static + if ($ssh_ip eq $discover_ip) { + ($ret, $err) = cumulus_exec($exp, "ifconfig eth0 $static_ip"); + } $exp->hard_close(); push (@config_switches, $switch); diff --git a/xCAT-server/share/xcat/tools/detect_dhcpd b/xCAT-server/share/xcat/tools/detect_dhcpd index 1769ba5f1..7003dc297 100755 --- a/xCAT-server/share/xcat/tools/detect_dhcpd +++ b/xCAT-server/share/xcat/tools/detect_dhcpd @@ -46,7 +46,7 @@ $start =~ s/(\d.*)\.(\d.*)/$1/; if (!$nic) { print "specify a nic\n"; print $::USAGE; exit 1; } #my $IP = `ifconfig $nic | grep "inet addr" | awk '{print \$2}' | awk -F: '{print \$2}'`; -my $IPADDRMASK = `ip addr show dev $nic | grep inet | grep -v inet6 | awk '{print \$2}' | head -n 1`; +my $IPADDRMASK = `ip -4 -o a show dev $nic | awk '/inet/{print \$4}' | head -n 1`; my ($IP, $MASK) = split(/\//, $IPADDRMASK); my $MAC; my $tmpMAC; diff --git a/xCAT-test/autotest/bundle/hdctrl_bmc.bundle b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle new file mode 100644 index 000000000..e8fcfd2fa --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_bmc.bundle @@ -0,0 +1,19 @@ +description:the cases in this bundle is to used to verify xCAT hardware control funtions on BMC managed servers. +#INCLUDE:hdctrl_general.bundle# +rinv_mprom +rinv_guid +rinv_dimm +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_leds +rsetboot_net_statcheck +rsetboot_cd_statcheck +rsetboot_default_statcheck +rsetboot_h +rsetboot_help +rsetboot_v +rsetboot_node_invalidnode +rsetboot_noderange_net +rsetboot_node_invalidaction +rsetboot_group_net diff --git a/xCAT-test/autotest/bundle/hdctrl_general.bundle b/xCAT-test/autotest/bundle/hdctrl_general.bundle new file mode 100644 index 000000000..e7020b1d6 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_general.bundle @@ -0,0 +1,30 @@ +description:the cases in this bundle is to verify xCAT hardware control functions. This is the basic bundle for all hardware types. +rpower_off +rpower_stat +rpower_status +rpower_state +rpower_boot +rpower_on +rpower_reset +rpower_noderange +rpower_noderange_nodeps +rpower_err_noderange +rinv_h +rinv_v +rinv_help +rinv_errorcommand +rinv_serial +rinv_model +rinv_firm +rinv_all +rvitals_h +rvitals_v +rvitals_errorcommand +rvitals_temp +rvitals_voltage +rvitals_all +rvitals_noderange_err +reventlog_null +reventlog_all +reventlog_clear +reventlog_numofentries diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle new file mode 100644 index 000000000..c44ce9d54 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_ipmi.bundle @@ -0,0 +1,11 @@ +description:the cases in this bundle is to verify xCAT hardware control functions on servers which are managed using IPMI. +#INCLUDE:hdctrl_general.bundle# +rinv_deviceid +rinv_uuid +rinv_guid +rinv_vpd +rinv_mprom +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_leds diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle new file mode 100644 index 000000000..42e3d05a2 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle @@ -0,0 +1,29 @@ +description:the cases in this bundle is to used to verify xCAT hardware control funtions on openpower servers which are mananged using openbmc. +#INCLUDE:hdctrl_general.bundle# +rinv_deviceid +rinv_uuid +rinv_vpd +rinv_cpu +rinv_dimm +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_leds +rsetboot_net_statcheck +rsetboot_cd_statcheck +rsetboot_default_statcheck +rsetboot_h +rsetboot_help +rsetboot_v +rsetboot_node_invalidnode +rsetboot_noderange_net +rsetboot_node_invalidaction +rsetboot_group_net +rspconfig_ip +rspconfig_ip_invalid +rspconfig_ip_null +rspconfig_netmask +rspconfig_netmask_invalid +rspconfig_gateway +rspconfig_gateway_invalid +rspconfig_node_invalid diff --git a/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle new file mode 100644 index 000000000..51a886de1 --- /dev/null +++ b/xCAT-test/autotest/bundle/hdctrl_ppc_hmc.bundle @@ -0,0 +1,7 @@ +description:the cases in this bundle is to used to verify xCAT hardware control funtions on HMC managed servers. +#INCLUDE:hdctrl_general.bundle# +rpower_softoff +rpower_onstandby +rinv_bus +rinv_config +rvitals_lcds diff --git a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle index c430a505f..c80880576 100644 --- a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle @@ -38,8 +38,18 @@ rspconfig_ip_invalid rspconfig_netmask rspconfig_netmask_invalid rspconfig_gateway -rspconfig_gateway_invalid +rspconfig_gateway_invalid rspconfig_node_invalid rspconfig_ip_null +rvitals_h +rvitals_v +rvitals_errorcommand +rvitals_noderange_err +rvitals_temp +rvitals_voltage +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_all reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat diff --git a/xCAT-test/autotest/perfcmds.lst b/xCAT-test/autotest/perfcmds.lst index e1cf7eb3c..d41d203c5 100644 --- a/xCAT-test/autotest/perfcmds.lst +++ b/xCAT-test/autotest/perfcmds.lst @@ -6,7 +6,7 @@ makedhcp #NODES# makeknownhosts #NODES# nodech #NODES# groups,=group1 nodels #NODES# noderes -nodeset #NODES# osimage=rhels7.3-GA-ppc64le-install-compute +nodeset #NODES# osimage=#OSIMAGE# chdef -t node -o #NODES# postscripts="fake" profile="install" netboot="grub2" rmdef -t node #PERFGRP# mkdef -z < #STANZ# diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 new file mode 100644 index 000000000..7800598c2 --- /dev/null +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -0,0 +1,473 @@ +start: confignetwork_s_installnic_diskful +description: this case is to test confignetwork -s could configure installnic successfully in diskful provision. +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +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:makeconservercf +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +cmd:sleep 20 +cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__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 +cmd:copycds $$ISO +check:rc==0 +cmd:chdef $$CN postscripts="confignetwork -s" +check:rc==0 +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:sleep 300 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done +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:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:chdef -m -t node $$CN postscripts="confignetwork -s" +check:rc==0 +end + +start:confignetwork_s_installnic_diskless +description: this case is to test confignetwork -s could configure installnic successfully in diskless provision. +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 +cmd:chdef -t node -o $$CN postbootscripts="confignetwork -s" +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf $$CN +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +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: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:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:sleep 180 +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 +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:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" +check:rc==0 +cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi +end + +start: confignetwork_secondarynic_diskless +description: this case is to test confignetwork -s could config installnic and secondarynic at the same time successfully in diskless provision. +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 +cmd:mkdef -t network -o 100_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=100.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=100_1_0_0-255_255_0_0 +check:rc==0 +cmd:chdef -t node -o $$CN postbootscripts="confignetwork -s" +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf $$CN +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +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: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:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:sleep 180 +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 +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:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~100.1.0.100 +check:output!~dhcp +cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" +check:rc==0 +cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi +cmd:xdsh $$CN "ip addr del 100.1.0.100/16 dev $$SECONDNIC" +cmd:rmdef -t network -o 100_1_0_0-255_255_0_0 +cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= +check:rc==0 +end + +start:confignetwork_s_installnic_secondarynic_updatenode +description: this case is to test confignetwork -s could configure installnic and secondarynic successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:updatenode $$CN -P "confignetwork -s" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +check:rc==0 +end + +start:confignetwork_secondarynic_updatenode +description: this case is to test confignetwork could configure secondarynic successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1496 +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep MTU /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~MTU=1496 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 +end + +start: confignetwork_secondarynic_nicaliases_updatenode +description: this case is to test confignetwork could config secondarynic nicaliases successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.bak +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1 aliases1-1-1|aliases1-2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC|-$$SECONDNIC-1" +check:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~aliases1-1 aliases1-1-1 +check:output=~aliases1-2 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:output=~12.1.0.100 +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 +end + +start:confignetwork_secondarynic_nicextraparams_updatenode +description: this case is to test confignetwork could configure secondarynic nicextraparams successfully with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.bak +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" +check:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~$$CN-$$SECONDNIC-1 +check:output=~$$CN-$$SECONDNIC-2 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +check:output!~dhcp +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:output=~12.1.0.100 +check:output=~CONNECTED_MODE=yes +check:output!~dhcp +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 +end + +start:confignetwork_secondarynic_nicnetworks_updatenode_false +description: this case is to test confignetwork could return error message when there is no not enough attributes when configing secondarynic with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC= +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc!=0 +#TODO check the error message +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start:confignetwork_secondarynic_nicips_updatenode_false +description: this case is to test confignetwork could return error message when there is no not enough attributes when configing secondarynic with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc!=0 +#TODO check the error message +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start:confignetwork_secondarynic_nictype_updatenode_false +description: this case is to test confignetwork could return error message when there is no not enough attributes when configing secondarynic with updatenode. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +#TODO check the error message +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start:confignetwork_disable_set_to_yes +description: this case is to test if confignetwork could work correctly when disable is set to yes in nics table +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:chtab node=$$CN nics.disable=yes +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output!~11.1.0.100 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start:confignetwork_disable_set_to_1 +description: this case is to test if confignetwork could work correctly when disable is set to 1 in nics table +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=100.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +check:rc==0 +cmd:chtab node=$$CN nics.disable=1 +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output!~11.1.0.100 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +check:rc==0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + +start:confignetwork_niccustomscripts +description: this case is to test confignetwork could config secondarynic and envoke scripts to execute. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:echo "echo hello > /tmp/confignetwork_niccustomscript" > /tmp/script1 +check:rc==0 +cmd:chmod a+x /tmp/script1 +check:rc==0 +cmd:cp /tmp/script1 /install/postscripts +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mut=1496 +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 niccustomscripts.$$SECONDNIC=script1 +check:rc==0 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:xdsh $$CN "cat /tmp/confignetwork_niccustomscript" +check:rc==0 +check:output=~hello +cmd:xdsh $$CN "rm -rf /tmp/confignetwork_niccustomscript" +check:rc==0 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:rm -rf /tmp/script1 /install/postscripts/script1 +end + +start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +description:this case is to verify if confignetwork could config serveral nics' multiple value at the same time. +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +check:rc==0 +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" +check:rc==0 +cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="13_1_0_0-255_255_0_0|14_1_0_0-255_255_0_0" nichostnamesuffixes.$$THIRDNIC="-$$THIRDNIC-1|-$$THIRDNIC-2" +check:rc==0 +cmd:cp /etc/hosts /etc/hosts.bak +cmd:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~$$CN-$$SECONDNIC-1 +check:output=~$$CN-$$SECONDNIC-2 +check:output=~$$CN-$$THIRDNIC-1 +check:output=~$$CN-$$THIRDNIC-2 +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:output=~12.1.0.100 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~13.1.0.100 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +check:output=~14.1.0.100 +cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 +cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 13.1.0.100/16 dev $$THIRDNIC" +cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index b2b5b0af1..b6f5e92e0 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -149,17 +149,17 @@ start:confignics_config_multiple_port_withnicaliases_multiple_value description:confignics cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi check:rc==0 -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 +cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501 +cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 +cmd:mkdef -t network -o 13_1_0_0-255_255_0_0 net=13.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1503 +cmd:mkdef -t network -o 14_1_0_0-255_255_0_0 net=14.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1|aliases1-2" +cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nicaliases.$$SECONDNIC="aliases1-1 aliases1-1-1|aliases1-2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC|-$$SECONDNIC-1" check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="13_1_0_0-255_255_0_0|14_1_0_0-255_255_0_0" nicaliases.$$THIRDNIC="aliases2-1|aliases2-2" +cmd:chdef $$CN nicips.$$THIRDNIC="13.1.0.100|14.1.0.100" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="13_1_0_0-255_255_0_0|14_1_0_0-255_255_0_0" nicaliases.$$THIRDNIC="aliases2-1|aliases2-2" nichostnamesuffixes.$$THIRDNIC="-$$THIRDNIC|-$$THIRDNIC-1" check:rc==0 cmd:makehosts $$CN check:rc==0 @@ -173,21 +173,23 @@ check:rc==0 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~11.1.0.100 check:output!~dhcp -output=~MTU=1501 cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$SECONDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi check:output=~12.1.0.100 check:output!~dhcp cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi check:output=~13.1.0.100 check:output!~dhcp -output=~MTU=1503 -cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi +cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN cat /etc/network/interfaces.d/$$THIRDNIC:1 ; elif [ "$$OS" = "rhels" ]; then xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1;else xdsh $$CN cat /etc/sysconfig/network*/ifcfg-$$THIRDNIC:1; fi check:output=~14.1.0.100 check:output!~dhcp cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 13.1.0.100/16 dev $$THIRDNIC" +cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$SECONDNIC:1; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$SECONDNIC:1; fi cmd:if [ "$$OS" = "ubuntu" ];then xdsh $$CN rm -rf /etc/network/interfaces.d/$$THIRDNIC; else xdsh $$CN rm -rf /etc/sysconfig/network*/ifcfg-$$THIRDNIC; fi diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index 977261ad0..f9fb966ea 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -6,6 +6,7 @@ cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 +cmd:cat /tmp/genesistestlog/* end start:nodeset_cmdline @@ -16,6 +17,7 @@ cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 +cmd:cat /tmp/genesistestlog/* end start:nodeset_runimg @@ -26,4 +28,5 @@ cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n check:rc==0 cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c check:rc==0 +cmd:cat /tmp/genesistestlog/* end diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 73c3bc3b4..f7b376049 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -1,11 +1,5 @@ #!/usr/bin/env perl # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -BEGIN -{ - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; -} -use lib "$::XCATROOT/lib/perl"; -use xCAT::Utils; use strict; use warnings; use Getopt::Long; @@ -71,7 +65,7 @@ if (!defined($noderange)) { print "$::USAGE"; exit 1; } -my $os = xCAT::Utils->osver("all"); +my $os = &get_os; if ($check_genesis_file) { send_msg(2, "[$$]:Check genesis file..............."); &check_genesis_file(&get_arch); @@ -81,8 +75,10 @@ if ($check_genesis_file) { send_msg(2, "genesis file available"); } } -my $master=xCAT::TableUtils->get_site_Master(); +my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`; if (!$master) { $master=hostname(); } +chomp($master); +print "master is $master\n"; #################################### ####nodesetshell test for genesis @@ -170,7 +166,7 @@ sub check_genesis_file { sub rungenesiscmd { my $runcmd_script = "/tmp/cmdtest"; my $result = "/tmp/testresult"; - my $genesis_base_dir = "$::XCATROOT/share/xcat/netboot/genesis"; + my $genesis_base_dir = "/opt/xcat/share/xcat/netboot/genesis"; my $genesis_bin_dir; my $value = 0; my $arch = shift; @@ -200,7 +196,7 @@ sub rungenesiscmd { } `rinstall $noderange "runcmd=cmdtest,shell"`; if ($?) { - send_msg(0, "rinstall noderange shell failed for runcmd test"); + send_msg(0, "rinstall noderange shell failed for runcmd test"); } return $value; } @@ -210,7 +206,7 @@ sub rungenesiscmd { sub rungenesisimg { my $runimg_script = "/tmp/imgtest"; my $result = "/tmp/testresult"; - my $genesis_base_dir = "$::XCATROOT/share/xcat/netboot/genesis"; + my $genesis_base_dir = "/opt/xcat/share/xcat/netboot/genesis"; my $genesis_bin_dir; my $value = 0; mkdir("/install/my_image"); @@ -262,10 +258,12 @@ sub testxdsh { $checkfile = "/proc/cmdline"; } if (($value == 1) || ($value == 2) || ($value == 3)) { - `xdsh $noderange -t 2 cat $checkfile |grep $checkstring`; + `xdsh $noderange -t 2 cat $checkfile 2>&1|grep $checkstring `; if ($?) { - foreach (1 .. 1500) { - `xdsh $noderange -t 2 cat $checkfile | grep $checkstring`; + foreach (1 .. 10) { + sleep 300; + send_msg(1,"try to run xdsh to check the results again"); + `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; last if ($? == 0); } } @@ -283,7 +281,7 @@ sub clearenv { my $runmetar = "/install/my_image/my_image.tgz"; my $runmetar_tmp = "/tmp/my_image.tgz"; my $runmedir = "/install/my_image"; - my $genesis_base_dir = "$::XCATROOT/share/xcat/netboot/genesis"; + my $genesis_base_dir = "/opt/xcat/share/xcat/netboot/genesis"; if (-e "$runimg_script") { unlink("$runme"); unlink("$runmetar_tmp"); @@ -311,6 +309,21 @@ sub clearenv { return 0; } #################################### +#get os +################################### +sub get_os { + my $os = "unknown"; + my $output = `cat /etc/*release* 2>&1`; + if ($output =~ /suse/i) { + $os = "sles"; + } elsif ($output =~ /Red Hat/i) { + $os = "redhat"; + } elsif ($output =~ /ubuntu/i) { + $os = "ubuntu"; + } + return $os; +} +#################################### #get arch ################################### sub get_arch { diff --git a/xCAT-test/autotest/testcase/installation/litefile_sles.csv b/xCAT-test/autotest/testcase/installation/litefile_sles.csv index b3ade0407..d4e7d90e7 100644 --- a/xCAT-test/autotest/testcase/installation/litefile_sles.csv +++ b/xCAT-test/autotest/testcase/installation/litefile_sles.csv @@ -4,6 +4,7 @@ "ALL","/etc/ntp.conf","tmpfs",, "ALL","/etc/ntp.conf.org","tmpfs",, "ALL","/etc/resolv.conf","tmpfs",, +"ALL","/etc/hostname","tmpfs",, "ALL","/etc/ssh/","tmpfs",, "ALL","/etc/sysconfig/","tmpfs",, "ALL","/etc/syslog-ng/","tmpfs",, diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 64f87a839..417f3f5a8 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -176,3 +176,32 @@ check:output!~$$CN cmd:makedhcp -a end +start:makedhcp_remote_network +descriptiion:This case is to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. +cmd:mkdef -t network -o testnetwork net=100.100.100.0 mask=255.255.255.0 mgtifname='!remote!eth0' gateway=100.100.100.1 +check:rc==0 +cmd:lsdef -t network +check:rc==0 +check:output=~testnetwork +check:rc==0 +cmd:mkdef -t node -o testnode ip=100.100.100.2 groups=all mac=42:3d:0a:05:27:0b +check:rc==0 +cmd: cp -f /etc/hosts /etc/hosts.bak +cmd:echo "100.100.100.2 testnode" >> /etc/hosts +check:rc==0 +cmd:makdhcp -d testnode +cmd:makedhcp testnode +check:rc==0 +cmd:makdhcp -q testnode +check:rc==0 +check:output=~testnode: ip-address = 100.100.100.2 +cmd:makdhcp -d testnode +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:noderm testnode +check:rc==0 +cmd:chtab -d netname=testnetwork networks +check:rc==0 +cmd:cp -f /etc/hosts.bak /etc/hosts +end diff --git a/xCAT-test/autotest/testcase/makeknownhosts/cases0 b/xCAT-test/autotest/testcase/makeknownhosts/cases0 index 3e7e2e512..afe1e371d 100644 --- a/xCAT-test/autotest/testcase/makeknownhosts/cases0 +++ b/xCAT-test/autotest/testcase/makeknownhosts/cases0 @@ -28,6 +28,18 @@ check:rc!=0 check:output!~$$CN end +start:makeknownhosts_node_d +description:delete known node entry from $ROOTHOME/.ssh +cmd:makeknownhosts $$CN +cmd:cat ~/.ssh/known_hosts|grep $$CN +check:output=~$$CN +cmd:makeknownhosts $$CN -d +check:rc==0 +cmd:cat ~/.ssh/known_hosts|grep $$CN +check:rc!=0 +check:output!~$$CN +end + start:makeknownhosts_node_v description:verbose cmd:makeknownhosts $$CN -V diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 6972152d3..84546a788 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -27,7 +27,6 @@ cmd:rmdef -t osimage -o "rhels7.5-ppc64-install-compute" cmd:noderm testnode1 end - start:nodeset_check_yaboot_yes os:rhels cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 @@ -173,27 +172,178 @@ check:output=~Warning: testnode1: petitboot might be invalid|testnode1 could not cmd:noderm testnode1 end -start:nodeset_addkcmdline -description: This case is to verify when netboot=xnba, addkcmdline is correctly supported. -cmd:mkdef -t node -o testnode1 arch=x86_64 cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm monserver=10.1.1.1 nameservers=10.1.1.1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 -os=__GETNODEATTR($$CN,os)__ +start:nodeset_xnba +description: Verify when xnba is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/xcat/xnba/nodes/testnode1 /tftpboot/xcat/xnba/nodes/testnode1.elilo +cmd:mkdef -t node -o testnode1 arch=x86_64 cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm profile=compute os=rhels6.99 +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.xcattestbak +cmd:echo "10.1.1.200 testnode1" >> /etc/hosts +check:rc==0 +cmd:chdef testnode1 netboot=xnba addkcmdline=debug +check:rc==0 +cmd:mkdef "rhels6.99-x86_64-install-compute" -u profile=compute provmethod=install osvers=rhels6.99 osarch=x86_64 +cmd:mkdir -p /install/rhels6.99/x86_64/images/pxeboot +cmd:echo blah >/install/rhels6.99/x86_64/images/pxeboot/vmlinuz +cmd:echo blah >/install/rhels6.99/x86_64/images/pxeboot/initrd.img +cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute +check:rc==0 +cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1 +check:rc==0 +cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1.elilo +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= +check:rc==0 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels6.99-x86_64-install-compute" +cmd:rm -rf /install/rhels6.99 +end + +start:nodeset_grub2 +description: Verify when grub2 is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/boot/grub2/{testnode1,grub.cfg-{01-e6-d4-d2-3a-ad-06,0[aA]0101[cC]8}} +cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc profile=compute os=rhels7.99 check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.xcattestbak cmd:echo "10.1.1.200 testnode1" >> /etc/hosts cmd:makedns -n check:rc==0 -cmd:chdef testnode1 netboot=xnba addkcmdline=rd.break=pre-pivot +cmd:chdef testnode1 netboot=grub2 addkcmdline=debug check:rc==0 -cmd: mkdef "__GETNODEATTR($$CN,os)__-x86_64-install-compute" -u profile=compute provmethod=install osvers=__GETNODEATTR($$CN,os)__ +cmd:mkdef "rhels7.99-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels7.99 osarch=ppc64 +cmd:mkdir -p /install/rhels7.99/ppc64/ppc/ppc64 +cmd:echo blah >/install/rhels7.99/ppc64/ppc/ppc64/vmlinuz +cmd:echo blah >/install/rhels7.99/ppc64/ppc/ppc64/initrd.img +cmd:nodeset testnode1 osimage=rhels7.99-ppc64-install-compute check:rc==0 -cmd:nodeset testnode1 osimage=__GETNODEATTR($$CN,os)__-x86_64-install-compute +cmd:grep "debug" /tftpboot/boot/grub2/testnode1 check:rc==0 -cmd:grep "rd.break=pre-pivot" /tftpboot/xcat/xnba/nodes/testnode1 +cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-01-e6-d4-d2-3a-ad-06 check:rc==0 -cmd:grep "rd.break=pre-pivot" /tftpboot/xcat/xnba/nodes/testnode1.elilo +cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-0[aA]0101[cC]8 +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/boot/grub2/testnode1 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:noderm testnode1 -cmd:rmdef -t osimage -o "__GETNODEATTR($$CN,os)__-x86_64-install-compute" cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels7.99-ppc64-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels7.99-ppc64-install-compute" +cmd:rm -rf /install/rhels7.99 end +start:nodeset_petitboot +description: Verify when petitboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/petitboot/testnode1 +cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99 +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.xcattestbak +cmd:echo "10.1.1.200 testnode1" >> /etc/hosts +cmd:makedns -n +check:rc==0 +cmd:chdef testnode1 netboot=petitboot addkcmdline=debug +check:rc==0 +cmd:mkdef "rhels7.99-ppc64le-install-compute" -u profile=compute provmethod=install osvers=rhels7.99 osarch=ppc64le +cmd:mkdir -p /install/rhels7.99/ppc64le +cmd:mkdir -p /install/rhels7.99/ppc64le/ppc/ppc64le +cmd:echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/vmlinuz +cmd:echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/initrd.img +cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute +check:rc==0 +cmd:grep "debug" /tftpboot/petitboot/testnode1 +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/petitboot/testnode1 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= +check:rc==0 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute" +cmd:rm -rf /install/rhels7.99 +end + +start:nodeset_yaboot +description: Verify when yaboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently +cmd:rmdef testnode1 +cmd:rm -f /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06 +cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc profile=compute os=rhels6.99 +check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.xcattestbak +cmd:echo "10.1.1.200 testnode1" >> /etc/hosts +cmd:makedns -n +check:rc==0 +cmd:chdef testnode1 netboot=yaboot addkcmdline=debug +check:rc==0 +cmd:mkdef "rhels6.99-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels6.99 osarch=ppc64 +cmd:mkdir -p /install/rhels6.99/ppc64/ppc/{chrp,ppc64} +cmd:echo blah >/install/rhels6.99/ppc64/ppc/ppc64/vmlinuz +cmd:echo blah >/install/rhels6.99/ppc64/ppc/ppc64/initrd.img +cmd:echo blah >/install/rhels6.99/ppc64/ppc/chrp/yaboot +cmd:nodeset testnode1 osimage=rhels6.99-ppc64-install-compute +check:rc==0 +cmd:grep "debug" /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06 +check:rc==0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc==0 +cmd:nodeset testnode1 offline +check:rc==0 +cmd:grep "debug" /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06 +check:rc!=0 +#cmd:makedhcp -q testnode1 | grep ^testnode1: +#check:rc!=0 +cmd:chdef -t node -o testnode1 ip= +check:rc==0 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:getent hosts testnode1 | grep testnode1 +check:rc!=0 +cmd:nodeset testnode1 osimage=rhels6.99-ppc64-install-compute +check:rc!=0 +cmd:noderm testnode1 +cmd:rmdef -t osimage -o "rhels6.99-ppc64-install-compute" +cmd:rm -rf /install/rhels6.99 +end + +start:nodeset_errorcommand +description:This testcase is to very nodeset osimage errorcommand could give right output +Attribute: $$CN-The operation object of nodeset command +cmd:nodeset $$CN osimage= __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==1 +check:output=~Error: Invalid argument: +check:output=~Usage: nodeset +end diff --git a/xCAT-test/autotest/testcase/performance/case0 b/xCAT-test/autotest/testcase/performance/case0 new file mode 100644 index 000000000..6ed131c19 --- /dev/null +++ b/xCAT-test/autotest/testcase/performance/case0 @@ -0,0 +1,18 @@ +start:perftest_5000 +description:Default performance testing on 5000 fake nodes +os:Linux +cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils +cmd:copycds $$ISO +check:rc==0 +cmd:xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +check:rc==0 +end + +start:perftest_5000_without_conf +description:Default performance testing on 5000 fake nodes without extra configuraiton on MN +os:Linux +cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils +check:rc==0 +cmd:xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/rinv/cases0 b/xCAT-test/autotest/testcase/rinv/cases0 index 5b61937df..466b95bf2 100644 --- a/xCAT-test/autotest/testcase/rinv/cases0 +++ b/xCAT-test/autotest/testcase/rinv/cases0 @@ -4,14 +4,30 @@ #check:rc!=0 #check:output=~Usage #end +start:rinv_h +description:show help information for rinv +cmd:rinv -h +check:rc==0 +check:output=~Usage +check:output=~rinv +end +start:rinv_v +description:show version for Version +cmd:rinv -v +check:rc==0 +check:output=~Version +end + start:rinv_bus -arch:ppc +description:rinv list all buses for each I/O slot +Attribute: $$CN-The operation object of rinv command cmd:rinv $$CN bus check:rc==0 check:output=~I/O Bus Information end start:rinv_config -arch:ppc +description:Retrieves number of processors, speed, total memory, and DIMM locations. +Attribute: $$CN-The operation object of rinv command cmd:rinv $$CN config check:rc==0 check:output=~Machine Configuration Info @@ -19,38 +35,86 @@ check:output=~Number of Processors:\s*\d+ check:output=~Total Memory \(\w+\):\s*\d+ end start:rinv_serial -arch:ppc -cmd:rinv $$CN serial +description:Retrieves serial number. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN serial check:rc==0 -check:output=~Serial Number:\s*\w{7} end start:rinv_model -arch:ppc -cmd:rinv $$CN model +description:Retrieves serial number. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN model check:rc==0 -check:output=~Machine Type/Model\s*:\s*\w{4}-\w{3} end start:rinv_firm -arch:ppc -cmd:rinv $$CN firm +description:Retrieves firmware versions. +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN firm check:rc==0 -check:output=~Release Level\s*:\s*\w+ end start:rinv_all -arch:ppc -cmd:rinv $$CN all +description:get serial,model +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN all check:rc==0 -check:output=~I/O Bus Information -check:output=~Machine Configuration Info -check:output=~Number of Processors:\s*\d+ -check:output=~Total Memory \(\w+\):\s*\d+ -check:output=~Serial Number:\s*\w{7} -check:output=~Machine Type/Model\s*:\s*\w{4}-\w{3} -check:output=~Release Level\s*:\s*\w+ end +start:rinv_cpu +description:get cpu information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN cpu +check:rc==0 +end +start:rinv_dimm +description:get dimm information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN dimm +check:rc==0 +end +start:rinv_uuid +description:get uuid information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN uuid +check:rc==0 +end +start:rinv_vpd +description:get vpd information +Attribute: $$CN-The operation object of rinv command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rinv $$CN vpd +check:rc==0 +end + start:rinv_noderange_err cmd:rinv testnode check:rc!=0 check:output=~Error end - +start:rinv_mixnode +description:get mixnode information,one is invalid node +Attribute: $$CN-The operation object of rinv command +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ +check:rc==0 +cmd:chdef -p -t node -o $$CN groups="test" +check:rc==0 +cmd:rinv test all +check:rc==1 +check:output=~$$CN: SYSTEM +cmd:chdef -m -t node -o $$CN groups="test" +check:rc==0 +cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi +check:rc==0 +end +start:rinv_wrongbmcpasswd +description:get right return if bmc's passwd wrong +Attribute: $$CN-The operation object of rinv command +cmd:lsdef -l $$CN -z >/tmp/testnode.stanza +check:rc==0 +cmd:chdef $$CN bmcpassword=test +check:rc==0 +cmd:rinv $$CN all +check:rc==1 +check:output=~$$CN: Error: Invalid username or password +cmd:cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/rinv/cases1 b/xCAT-test/autotest/testcase/rinv/cases1 deleted file mode 100644 index 292e9b915..000000000 --- a/xCAT-test/autotest/testcase/rinv/cases1 +++ /dev/null @@ -1,70 +0,0 @@ -start:rinv_serial -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN serial -check:rc==0 -check:output=~NODE 1 Chassis Serial Number:\s*\w{7} -end - -start:rinv_model -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN model -check:rc==0 -check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} -end - -start:rinv_firm -arch:ppc64le -hcp:ipmi -cmd:rinv $$CN firm -check:rc==0 -check:output=~BMC Firmware\s*:\s*\w+.\w+ -end - -start:rinv_deviceid -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN deviceid -check:rc==0 -check:output=~Device ID:\s*\w+ -check:output=~Product ID:\s*\w+ -check:output=~Manufacturer ID:\s*\w+ -end - - -start:rinv_vpd -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN vpd -check:rc==0 -check:output=~Manufacturer ID:\s*\w+ -check:output=~Device ID:\s*\w+ -check:output=~BMC Firmware:\s*\w+.\w+ -check:output=~NODE 1 Chassis Serial Number:\s*\w{7} -check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} -end - - -start:rinv_all -hcp:ipmi -arch:ppc64le -cmd:rinv $$CN all -check:rc==0 -check:output=~BMC Firmware:\s*\w+.\w+ -check:output=~BMCCARD Board Part Number:\s*\w{7} -check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ -check:output=~Product ID:\s*\d+ -check:output=~Manufacturer ID:\s*\d+ -check:output=~Device ID:\s*\d+ -check:output=~BMCCARD Board Serial Number:\s*\w+ -end - -start:rinv_noderange_err -hcp:ipmi -arch:ppc64le -cmd:rinv testnode -check:rc!=0 -check:output=~Error -end - diff --git a/xCAT-test/autotest/testcase/rinv/cases2 b/xCAT-test/autotest/testcase/rinv/cases2 new file mode 100644 index 000000000..388ae6ce5 --- /dev/null +++ b/xCAT-test/autotest/testcase/rinv/cases2 @@ -0,0 +1,29 @@ +start:rinv_mprom +description:this case is to test mprom option for rinv on x86_64 servers. +hcp:ipmi +arch:x86_64 +cmd:rinv $$CN mprom +check:rc==0 +check:output=~BMC Firmware:\s*\w+.\w+ +end + +start:rinv_guid +description:this case is to test guid option for rinv on x86_64 servers. +hcp:ipmi +arch:x86_64 +cmd:rinv $$CN guid +check:rc==0 +check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ +end + +start:rinv_dimm +description:this case is to test dimm option for rinv on x86_64 servers. +hcp:ipmi +arch:x86_64 +cmd:rinv $$CN dimm +check:rc==0 +check:output=~DIMM 1 :\s*\w+ +check:output=~DIMM 1 Manufacture Date:\s*\w+ +check:output=~DIMM 1 Manufacture Location:\s*\d+ +check:output=~DIMM 1 Model:\s*\w+-\w+ +end diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index ee6974eac..09f619fe0 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -1,4 +1,6 @@ start:rpower_off +description:This case is to test off option could remote power off nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done check:ouptut=~Running|on @@ -10,6 +12,8 @@ check:output=~Not Activated|off end 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 cmd:rpower $$CN on 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 @@ -29,6 +33,8 @@ check:output=~Not Activated|off end start:rpower_boot +description:This case is to test boot option could power on the nodes if nodes in off state. Or could hard reset the nodes if they are on. +Attribute: $$CN-The operation object of rpower command 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 @@ -41,7 +47,8 @@ check:output=~Running|on end start:rpower_status -description:checkout rpower node status could get node's stauts +description:This case is to test status option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN status|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN status @@ -54,7 +61,8 @@ check:output=~Running|on end start:rpower_state -description:checkout rpower node status could get node's stauts +description:This case is to test state option could show the power status of nodes +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN off cmd:a=0;while ! `rpower $$CN state|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done cmd:rpower $$CN state @@ -67,6 +75,8 @@ check:output=~Running|on end start:rpower_on +description:This case is to test on option could remote power on nodes +Attribute: $$CN-The operation object of rpower command 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 @@ -79,6 +89,8 @@ check:output=~Running|on end start:rpower_reset +description:This case is to test reset option could hard reset nodes when nodes are in on state. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN on 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 @@ -91,19 +103,52 @@ check:output=~Running|on end start:rpower_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN check:rc!=0 check:output=~Unsupported|Usage end start:rpower_noderange_nodeps +description:This case is to test rpower could process error usage and return help information. +Attribute: $$CN-The operation object of rpower command cmd:rpower $$CN --nodeps check:rc!=0 check:output=~Unsupported|Usage end start:rpower_err_noderange +description:This case is to test rpower could process error usage and return help information. +Attribute:N/A cmd:rpower testnode stat check:rc!=0 check:output=~Error end + +start:rpower_softoff +description:This case is to test softoff option could remote shutdown nodes +Attribute: $$CN-The operation object of rpower command +cmd:rpower $$CN on +cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +check:ouptut=~Running|on +cmd:rpower $$CN softoff +check:rc==0 +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 +end + +start:rpower_onstandby +description:This case is to test onstandby option could bring server to standby state +Attribute: $$CN-The operation object of rpower command +arch:ppc64 +cmd:rpower $$CN off +check:rc==0 +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 onstandby +cmd:a=0;while ! `rpower $$CN stat|grep "standby\|Standby" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +check:ouptut=~standby|Standby +end diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 055317a88..4a40f6b5c 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -1,40 +1,118 @@ +start:rvitals_h +description:get rvitals's usage +Attribute: $$CN-The operation object of rvitals command +cmd:rvitals -h +check:rc==0 +check:output=~Usage: +check:output=~rvitals +end + +start:rvitals_v +description:get rvitals's version +Attribute: $$CN-The operation object of rvitals command +cmd:rvitals -v +check:rc==0 +check:output=~Version +end + start:rvitals_temp -cmd:rvitals $$CN temp +description:Retrieves temperatures +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN temp check:rc==0 -check:output=~System Temperature end + +start:rvitals_disktemp +description:Retrieves disk temperatures +Attribute: $$CN-The operation object of rvitals command +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN disktemp +check:rc==0 +check:output=~Ambient Temp +end + +start:rvitals_cputemp +description:Retrieves cpu temperatures +Attribute: $$CN-The operation object of rvitals command +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN cputemp +check:rc==0 +check:output=~Ambient Temp +end + start:rvitals_voltage -hcp:hmc,ivm,fsp,ipmi -cmd:rvitals $$CN voltage +description:Retrieves power supply and VRM voltage readings +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN voltage check:rc==0 -check:output=~Frame Voltages end + start:rvitals_power -cmd:rvitals $$CN power +description:Retrieves power status +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN power check:rc==0 -check:output=~Current Power Status:\s*(on|off) end + start:rvitals_state +description:Retrieves the system state. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN state check:rc==0 check:output=~System State: end + start:rvitals_lcds +description:Retrieves LCDs status +Attribute: $$CN-The operation object of rvitals command hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN lcds check:rc==0 check:output=~Current LCD end + start:rvitals_all -cmd:rvitals $$CN all +description:Retrieves all status +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN all +check:rc==0 +end + +start:rvitals_leds +description:Retrieves leds status +Attribute: $$CN-The operation object of rvitals command +cmd:rvitals $$CN leds +check:rc==0 +check:output=~LED +end + +start:rvitals_fanspeed +description:Retrieves fan speeds. +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN fanspeed +check:rc==0 +end +start:rvitals_wattage +description:Retrieves wattage readings. +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN wattage +check:rc==0 +end +start:rvitals_altitude +description:Retrieves altitude readings. +Attribute: $$CN-The operation object of rvitals command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN altitude check:rc==0 -check:output=~System Temperature -check:output=~Frame Voltages -check:output=~Current Power Status:\s*(on|off) -check:output=~System State: end start:rvitals_noderange_err -cmd:rvitals testnode +description:using not defined node +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals testnode +check:rc!=0 +end +start:rvitals_errorcommand +description:using wrong command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rvitals/openbmctest.sh rvitals $$CN errorcommand check:rc!=0 -check:output=~Error end diff --git a/xCAT-test/autotest/testcase/rvitals/cases1 b/xCAT-test/autotest/testcase/rvitals/cases1 deleted file mode 100644 index 8a43aedb6..000000000 --- a/xCAT-test/autotest/testcase/rvitals/cases1 +++ /dev/null @@ -1,61 +0,0 @@ -start:rvitals_temp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN temp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_disktemp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN disktemp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_cputemp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN cputemp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_fanspeed -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN fanspeed -check:rc==0 -check:output=~Fan\s*\d:\s*\w+\s*RPM -end - -start:rvitals_voltage -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN voltage -check:rc==0 -check:output=~CPU VDD Volt -end - -start:rvitals_all -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN all -check:rc==0 -check:output=~Power Status -check:output=~Power Overload -check:output=~Power Interlock -check:output=~Power Fault -check:output=~Power Control Fault -check:output=~Power Restore Policy -check:output=~Ambient Temp -end - -start:rvitals_noderange_err -arch:ppc64le -hcp:ipmi -cmd:rvitals testnode -check:rc!=0 -check:output=~Error -end diff --git a/xCAT-test/autotest/testcase/rvitals/openbmctest.sh b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh new file mode 100755 index 000000000..c28e9fbfd --- /dev/null +++ b/xCAT-test/autotest/testcase/rvitals/openbmctest.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +function test_openbmccommand() +{ +node_number=0; +number=0; +if [[ $1 ]]&&[[ $2 ]]&&[[ $3 ]];then + `$1 $2 $3 >/tmp/openbmccommand.test`; + if [[ $? -eq 0 ]];then + echo right command; + number=`awk 'END{print NR}' /tmp/openbmccommand.test` + echo number is $number + `cat /tmp/openbmccommand.test |awk -F : '{print $1}' > /tmp/openbmccommand.test1` + for i in `cat /tmp/openbmccommand.test1` + do + echo $i + if [[ $i == $2 ]];then + node_number=1; + else + echo no than more node checked + node_number=2; + fi + done + if [[ $node_number -eq 1 ]];then + `cat /tmp/openbmccommand.test |awk -F : '{print $2}'> /tmp/openbmccommand.test2` + if [[ $number -eq 1 ]]&&[[ `awk -F "" '{for(i=1;i<=NF;++i) if($i==":") ++sum}END{print sum}' /tmp/openbmccommand.test` -eq 1 ]];then + if [[ `cat /tmp/openbmccommand.test` =~ "No attributes returned from the BMC" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No mprom information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No deviceid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No uuid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No guid information is available" ]];then + echo "No attributes" + return 0; + else + return 1; + fi + else + if [[ `cat /tmp/openbmccommand.test2` =~ "No attributes returned from the BMC" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No mprom information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No deviceid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No uuid information is available" ]]||[[ `cat /tmp/openbmccommand.test` =~ "No guid information is available" ]];then + echo "wrong return" + return 1; + else + echo "right return" + return 0 + fi + fi + else + if [[ $node_number -eq 2 ]];then + return 0; + fi + fi + else + return 1; + fi +else + return 1; +fi +} +test_openbmccommand $1 $2 $3 +if [[ $? -eq 0 ]];then + exit 0; +else + exit 1; +fi diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator new file mode 100644 index 000000000..03c442fd9 --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -0,0 +1,23 @@ +start:clear_openbmc_simulator +description:clear evironment +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_100 +description:clear evironment that simulate 100 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 100 +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_1000 +description:clear evironment that simulate 1000 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 1000 +check:rc==0 +end + +start:clear_openbmc_simulator_multiple_5000 +description:clear evironment that simulate 5000 OpenBMCs +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -c $$MN $$CN $$bmcusername $$bmcpasswd 5000 +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/simulator/config_simulator.sh b/xCAT-test/autotest/testcase/simulator/config_simulator.sh new file mode 100755 index 000000000..fc4013fdd --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/config_simulator.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +flag=$1 # -s:setup simulator -c:clear simulator env +mnhn=$2 # MN hostname +cnhn=$3 # CN hostname +username=$4 # bmcusername +password=$5 # bmcpassword +nodes=$6 # number of IPs want to config + +if [ $nodes -gt 10000 ]; then + echo "Unsupported number of nodes: $nodes" + exit 1 +fi + +mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` +if [ $nodes ]; then + nic=`ip -4 -o a | grep $mnip | awk -F ' ' '{print $2}'` + + ((a=$nodes/100)) + ((b=$nodes%100)) + if [ $b -eq 0 ]; then + b=100 + fi + range=`for((i=1;i<=$a;i++)); do for((m=1;m<=$b;m++)); do echo -n "10.100.$i.$m ";done; done` +fi + +if [ $flag = "-s" ]; then + os=`cat /etc/*release*` + if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git -y + if [ $? != 0 ]; then + echo "Install git Failed" + exit 1 + fi + elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git -y + if [ $? != 0 ]; then + echo "Install git Failed" + exit 1 + fi + fi + + cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git + + if [ $nodes ]; then + lsdef $cnhn -z > /tmp/$cnhn.stanza + rmdef $cnhn + + /root/openbmc_simulator/simulator -n $nic -r $range + if [ $? != 0 ]; then + echo "Start simulator Failed" + exit 1 + fi + + node_end=$[nodes-1] + chdef -t group $cnhn mgt=openbmc bmc="|\D+(\d+)$|10.100.(1+((\$1)/100)).((\$1)%100+1)|" bmcusername=$username bmcpassword=$password + chdef simulator_test_[0-$node_end] groups=$cnhn # use CN hostname as group, so when run command against CN will rpower against all nodes added here + else + cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` + echo $cnip > "/tmp/simulator" + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` + chdef $cnhn bmc=$mnip + /root/openbmc_simulator/simulator + fi +elif [ $flag = "-c" ]; then + if [ $nodes ]; then + /root/openbmc_simulator/simulator -c -n $nic -r $range + rmdef $cnhn + cat /tmp/$cnhn.stanza | mkdef -z + else + /root/openbmc_simulator/simulator -c + cnip=`cat /tmp/simulator` + chdef $cnhn bmc=$cnip + fi + + rm -rf /root/openbmc_simulator +fi +exit $? diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator new file mode 100644 index 000000000..8ab412829 --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -0,0 +1,23 @@ +start:setup_openbmc_simulator +description:install dependent packaages, setup and start openbmc simulator +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_100 +description:install dependent packaages, setup and start 100 openbmc simulator +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 100 +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_1000 +description:install dependent packaages, setup and start 1000 openbmc simulator +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 1000 +check:rc==0 +end + +start:setup_openbmc_simulator_multiple_5000 +description:install dependent packaages, setup and start 5000 openbmc simulator +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/config_simulator.sh -s $$MN $$CN $$bmcusername $$bmcpasswd 5000 +check:rc==0 +end diff --git a/xCAT-test/bin/xcatperftest b/xCAT-test/bin/xcatperftest index e68e6b8f4..1ec36c963 100755 --- a/xCAT-test/bin/xcatperftest +++ b/xCAT-test/bin/xcatperftest @@ -26,6 +26,17 @@ isNumber() expr $1 + 0 &>/dev/null } +# Used for prerequiste checking +preChecking() +{ + local val="" + for cmd in brctl ifconfig; do + which $cmd > /dev/null 2>&1 + [ $? -ne 0 ] && val="$cmd,$val" + done + echo $val | sed s/,$// +} + # Give a simple usage if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "[PERF_DRYRUN=y] [PERF_NOCREATE=y] $0 [command-list-file]" @@ -45,6 +56,12 @@ if [ -z $XCATROOT ]; then fi fi +pass=$(preChecking) +if [ ! -z "$pass" ]; then + echo "Error: Missing required tools: $pass" + [ -z $PERF_DRYRUN ] && exit -1 +fi + # Mandatory, to specify the number of total fake nodes which will be created for testing FAKE_NODE_TOTAL=$1 @@ -73,6 +90,18 @@ if [ -z $FAKE_NETWORK_BMC ]; then FAKE_NETWORK_BMC='192.169' fi +# Optional, The network mask for the fake network object. +# By default, it is '255.255.0.0' but it could be changed when you set environment variable `FAKE_NETWORK_MASK` +if [ -z $FAKE_NETWORK_MASK ]; then + FAKE_NETWORK_MASK='255.255.0.0' +fi + +# Optional, The bridge device name for the temporary interface which is required on MN as nodeset/makedhcp will check if the MN and CN in same subnet. +# By default, it is 'perfvirbr0' but it could be changed when you set environment variable `FAKE_NETWORK_INTF` +if [ -z $FAKE_NETWORK_INTF ]; then + FAKE_NETWORK_INTF='perfvirbr0' +fi + # Optional, The node template name used for generating fake nodes. # By default, it is '-template' but it could be changed when you set environment variable `FAKE_NODE_GROUP` if [ -z $PERF_NODETEMPL ]; then @@ -81,11 +110,14 @@ fi # IP address assinged to node will be in [1-250] NODE_PER_ROW=250 +MYSUFFIX=`date +"%Y%m%d%H%M%S"` -PERFORMANCE_DIR=/tmp/xcat-performance -PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/node.tmpl -PERFORMANCE_REPORT=$PERFORMANCE_DIR/report-$FAKE_NODE_TOTAL.$$ -PERFORMANCE_STANZ=$PERFORMANCE_DIR/stanz-$FAKE_NODE_TOTAL.$$ +if [ -z $PERFORMANCE_DIR ]; then + PERFORMANCE_DIR=$XCATROOT/share/xcat/tools/autotest/result +fi +PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/perf-node.tmpl +PERFORMANCE_REPORT=$PERFORMANCE_DIR/perfreport-$FAKE_NODE_TOTAL.log.$MYSUFFIX +PERFORMANCE_STANZ=$PERFORMANCE_DIR/perfstanz-$FAKE_NODE_TOTAL.$MYSUFFIX # If the command list file is not specified, the tool will only create the stanz file for fake nodes. # If it is specified but not exists, the tool will exit with error. @@ -135,6 +167,45 @@ fakeNode() # bmc=$FAKE_NETWORK_BMC.$2.$3 bmcpassword=fake bmcusername=fake groups=all,performance > /dev/null 2>&1 } +# Create a fake xCAT network definition +fakeNetwork() +{ + lsdef -t network -o net-$FAKE_NODE_PREFIX > /dev/null 2>&1 + if [ 0 != $? ]; then + mkdef -t network net-$FAKE_NODE_PREFIX net=$FAKE_NETWORK_PRO.0.0 mask=$FAKE_NETWORK_MASK > /dev/null + else + chdef -t network -o net-$FAKE_NODE_PREFIX net=$FAKE_NETWORK_PRO.0.0 mask=$FAKE_NETWORK_MASK > /dev/null + fi +} + +# Create a fake xCAT network definition +fakeInterface() +{ + result=`ifconfig $1 2>/dev/null` + if [ -z "$2" ]; then + [ -z "$result" ] && brctl addbr $1 + ifconfig $1 $FAKE_NETWORK_PRO.251.254 netmask $FAKE_NETWORK_MASK || echo "$1 is not configured successfully" + elif [ ! -z "$result" ]; then + ifconfig $1 down + brctl delbr $1 || echo "$1 is not removed successfully, you may need to clean up manually." + fi +} + +getOSimage() +{ + # The OS image name used in nodeset to replace the MACRO Variable `#OSIMAGE#`. + # By default, it could be detectd automatically according to the arch + if [ -z $PERF_OSIMAGE ]; then + + # covert it to an array + osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|grep 'install'|awk '/compute/ {print $1}')) + index=`expr $RANDOM % ${#osimage_array[@]} 2>/dev/null` + echo ${osimage_array[$index]} + else + echo $PERF_OSIMAGE + fi +} + # Create batch fake nodes stanz file for testing bootstrap() { @@ -164,6 +235,7 @@ runTest() { cmd=$1 + [ -z $osimage ] || cmd="${cmd/\#OSIMAGE\#/$osimage}" if [[ $cmd =~ '#STANZ#' ]]; then #mkdef -z execCmd "${cmd/\#STANZ\#/$PERFORMANCE_STANZ}" "$FAKE_NODE_TOTAL" @@ -179,7 +251,7 @@ runTest() do isNumber $num || continue if [[ $num -le $FAKE_NODE_TOTAL ]]; then - cmd=$1 + #cmd=$1 execCmd "${cmd/\#NODES\#/$FAKE_NODE_PREFIX[1-$num]}" "$num" fi done @@ -195,10 +267,11 @@ runTest() # Output performance result for each command. printResult() { - cmd=`echo "$1" | awk '{print $1}'` + #TODO, more clear short desc for this command + desc=`echo "$1" | awk '{print $1}'` result=$([[ $4 = 0 ]] && echo "SUCESS" || echo "FAIL") # TOTAL, CMD, NODERANGE, TIME, SUCESS, FULL COMMAND - echo "$FAKE_NODE_TOTAL", "$cmd", "$2", "$3", $result, \"$1\" >> $PERFORMANCE_REPORT + echo "$FAKE_NODE_TOTAL; $desc; $2; $3; $result; \"$1\"" | tee -a $PERFORMANCE_REPORT } # Executing each command and print the result to report file @@ -222,19 +295,21 @@ execCmd() ################################################# # Main Loop of the performance baseline testing # ################################################# -lsxcatd -a +version=`lsxcatd -a 2>/dev/null | grep Version` if [ 0 != $? ]; then - echo "ERROR: xCAT daemon is not running" - #exit 99 + echo "ERROR: xCAT daemon is not running. Start 'xcatd' and rerun this tool." + exit 99 fi -mkdir -p /tmp/xcat-performance +mkdir -p $PERFORMANCE_DIR lsdef -t node --template $PERF_NODETEMPL > $PERFORMANCE_NODE_TMPL 2>/dev/null if [ 0 != $? ]; then - echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun the script." + echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun this tool." exit 99 fi +#Get available OS image, it will be used for nodeset if possible +osimage=$(getOSimage) rack=$(expr $FAKE_NODE_TOTAL / $NODE_PER_ROW) @@ -257,13 +332,24 @@ if [ -z $RUN_CMD_LIST ]; then fi echo "Continue the performance testing for commands in $RUN_CMD_LIST " +if [ -z "$osimage" ]; then + echo "WARN: Cannot determine the OS image, the commands which defined with #OSIMAGE# will be failed." +fi + +echo $version | tee $PERFORMANCE_REPORT echo "==================================================" # Initial Populate the fake nodes into DB if [ -z $PERF_NOCREATE ]; then + #create fake network for makedns, makedhcp etc... + fakeNetwork execCmd "mkdef -z -f < $PERFORMANCE_STANZ" "$FAKE_NODE_TOTAL" fi +# fake interface is required for topology with service nodes as it will determine if then Mn/Sn are +# in the same subnet with CNs +fakeInterface $FAKE_NETWORK_INTF + series=`grep '^#SERIES#' $RUN_CMD_LIST | awk '{print $2}'` if [ ! -z $series ]; then series=${series//,/ } @@ -287,6 +373,7 @@ IFS_BAK= rm -f $PERFORMANCE_NODE_TMPL rm -f $PERFORMANCE_STANZ +fakeInterface $FAKE_NETWORK_INTF del if [ -z $PERF_DRYRUN ]; then echo diff --git a/xCAT-test/debian/rules b/xCAT-test/debian/rules index ad419b385..d7863c5c1 100755 --- a/xCAT-test/debian/rules +++ b/xCAT-test/debian/rules @@ -15,6 +15,8 @@ build: mkdir -p share/doc/man1 pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1 pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html + pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1 + pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html pwd clean: diff --git a/xCAT-test/xCAT-test.spec b/xCAT-test/xCAT-test.spec index 0625e5de9..e5f3d0fb5 100644 --- a/xCAT-test/xCAT-test.spec +++ b/xCAT-test/xCAT-test.spec @@ -28,7 +28,9 @@ Provides automated test tool and buckets to help test xCAT commands automaticall mkdir -p share/man/man1 mkdir -p share/doc/man1 pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1 +pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1 pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html +pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html %install # The install phase puts all of the files in the paths they should be in when the rpm is diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 30e940801..00133e425 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -14,292 +14,650 @@ BEGIN $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; -my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; -my $needhelp = 0; -my $configinfo = undef; -my $configfile = undef; -my $casedir = "$rootdir/testcase"; -my $bundledir = "$rootdir/bundle"; -my $resultdir = "$rootdir/result"; -my $bundlelist = undef; -my $caselist = undef; -my $cmdlist = undef; -my $showbundlesorcommands = undef; -my $needshow = 0; -my $restore = 0; -my $ret = 0; -my $string1 = undef; -my $showbundlefiles = 0; -my $showcommandslist = 0; -my $stop_to_keep_env = 0; -#----------------------------------- -=head1 - System label usage: - In order to make install xCAT to be the first case for automation daily regression, "System" label is used in this xcattest command. - xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_rhels_sles - xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_ubuntu - System label means only the [System] aspect will be loaded and no other inital action will be done. -=cut +#--------------global attributes---------------- +my $prpgram_path = dirname(File::Spec->rel2abs(__FILE__)); +my $program_name = basename($0); +my $rootdir = "$prpgram_path/../share/xcat/tools/autotest"; +my $casedir = "$rootdir/testcase/"; +my $bundledir = "$rootdir/bundle/"; +my $resultdir = "$rootdir/result/"; +my $rst = 0; +my $setup_env_by_config_file = 1; +my $stop_to_keep_env = 0; -#----------------------------------- -my $initallabel = undef; -my $loadsysteminfo = "System"; +#Array to save all cases planed to handle +#these cases can be passed by option -b/-t/-c +#if without value passed by option -b/-t/-c, for "show information" function, +#the search scope is the all cases shipped by xcat_test package +my @cases_to_be_run = (); -#Create result directory -mkdir $resultdir unless -d $resultdir; - -# create a log for xcattest -my $timestamp = `date +"%Y%m%d%H%M%S"`; -open(LOG, ">$resultdir/xcattest.log.$timestamp") - or die "Can't open logfile for writing: $!"; - -if ( - !GetOptions("h|?" => \$needhelp, - "f=s" => \$configinfo, - "b=s" => \$bundlelist, - "t=s" => \$caselist, - "c=s" => \$cmdlist, - "s=s" => \$showbundlesorcommands, - "l" => \$needshow, - "restore" => \$restore) - ) -{ - &usage; - exit 1; -} - -if ($needhelp) -{ - &usage; - exit 0; -} - - -if (&checkoptions) -{ - &usage; - exit 1; -} - -#show bundle files under $bundledir with .bundle as file suffix -my %bundlefilesinfo = (); -if ($showbundlefiles) -{ - &listbundlefiles; - exit 0; -} - -#show commands, which is the folder name $casedir, with case* files and test cases -if ($showcommandslist) -{ - &listcommands; - exit 0; -} - -#load case to $cases -# key type -#$cases[x](x>0): hash -# name string -# os:AIX/Linux string -# arch:ppc64/x386 string -# hcp:hmc/mm/bmc/fsp string -# cmd: array -# check: array - -my @cases = (); -if ($needshow) { - &loadcase; - exit 0; -} - - -# create a log for run test cases -&log_this("xCAT automated test started at " . scalar(localtime())); -open(LOG_ERR, ">$resultdir/failedcases.$timestamp") - or die "Can't open error logfile for writing: $!"; - -#read config file -log_this("******************************"); -log_this("Reading Configure"); -log_this("******************************"); +#A hash to save the contect of config file +#The structure of %config #config{object}{type}{name}{attr} #config{table}{name}{entry}{key} #config{script_prev}->[] #config{script_post}->[] #config{var}{varname} my %config = (); -$ret = &getConfig; -if ($ret != 0) { - goto EXIT; + +#Array of hash, to save the information of case +my @cases = (); +my %case_name_index_map; + +#when loading cases, NORUN means just load case without attribute replacement. +#this is used for "show information" function +my $NORUN = 0; +my $RUN = 1; + +#----------global logs attributes--------------- +my $running_log_fd = undef +my $running_log_name = undef; +my $failed_log_name = undef; +my $performance_log_name = undef; + +#--------------command line attrbutes-------------- +my $needhelp = 0; +my $configfile = undef; +my $bundlelist = undef; +my $caselist = undef; +my $cmdlist = undef; +my $list = undef; +my $restore = 0; +my $quiet = 0; + +#-------------usage-------------------- +$::USAGE = "Usage: +To get help: + $program_name -h + +To list the information about all cases shipped by xcat test package + $program_name -l {caselist|caseinfo|casenum} +To list the information about all bunldes shipped by xcat test package + $program_name -l bundleinfo +To list the information about cases in specific bundles + $program_name -l {caselist|caseinfo|casenum} -b +To list the information about cases related to specific commands + $program_name -l {caselist|caseinfo|casenum} -c +To list the information about specific cases + $program_name -l {caselist|caseinfo|casenum} -t + +To run test cases in specific bundles + $program_name [-f {configure_file|configure_file:System}] -b [-r] [-q] +To run specific test cases + $program_name [-f {configure_file|configure_file:System}] -t [-r] [-q] +To run all cases related to specific commands + $program_name [-f {configure_file|configure_file:System}] -c [-r] [-q] + +Options: + -h : Get $program_name usage information. + -l : list specific information. The valid options are caselist,caseinfo,casenum,bundleinfo + -f : specify the configuration file. If 'System' tag is used, only [System] section in the configuration file will be used. If 'System' is not used all other sections of the configuration file will be used, like [Table], [Object], etc. + -c : Comma separated list of command names to test. + -t : Comma separated list of test case names to test. + -b : Comma separated list of bundle names to test. If a bundle name is specified without an absolute path, bundles under $bundledir will be searched + -r : Back up the original environment settings before running test, and restore them after running test. + -q : Just record all the output of $program_name into log file under $resultdir, not print to STDOUT. Print to STDOUT by default. +"; + +#============================================================================================== +# main process +#============================================================================================== +$rst = pro_init(); +if ($rst) { + print "Program $program_name initialization failed to exit.\n"; + to_exit(1); } -#if not only load System aspects from config file, then init test enviroment -if (!defined($initallabel)){ - log_this("******************************"); - log_this("Initialize xCAT test evironment"); - log_this("******************************"); - $ret = &init; - if ($ret != 0) { - goto EXIT; +if ( + !GetOptions("h" => \$needhelp, + "f=s" => \$configfile, + "b=s" => \$bundlelist, + "t=s" => \$caselist, + "c=s" => \$cmdlist, + "l=s" => \$list, + "q" => \$quiet, + "r" => \$restore) + ) +{ + log_this($running_log_fd, "$::USAGE"); + to_exit(1); +} + +if ($needhelp) { + log_this($running_log_fd, "$::USAGE"); + to_exit(0); +} + +my $error; +$rst = check_option_validity(\$error); +if ($rst) { + log_this($running_log_fd, "$error", "$::USAGE"); + to_exit(1); +} + +$rst = calculate_cases_to_be_run(\@cases_to_be_run, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} + +#print "----case to be run-----------------\n"; +#print Dumper \@cases_to_be_run; + +if ($list) { + if ($list eq "caselist") { + if (@cases_to_be_run) { + + #list the cases indicated by option -b,-c,-t + foreach (@cases_to_be_run) { + log_this($running_log_fd, "$_"); + } + } else { + + #list the cases shipped by xcat test package + $rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $NORUN); + if ($rst) { + log_this($running_log_fd, "$error"); + } + foreach my $case (@cases) { + log_this($running_log_fd, "$case->{name}"); + } + } + } elsif ($list eq "caseinfo") { + $rst = show_case_info(\@cases_to_be_run, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } + } elsif ($list eq "casenum") { + if (@cases_to_be_run) { + + #list the case number indicated by option -b,-c,-t + my $casenum = @cases_to_be_run; + log_this($running_log_fd, "$casenum"); + } else { + + #list the case number shipped by xcat test package + $rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $NORUN); + if ($rst) { + log_this($running_log_fd, "$error"); + } + my $casenum = @cases; + log_this($running_log_fd, "$casenum"); + } + } elsif ($list eq "bundleinfo") { + + #list the bundle information shipped by xcat test package + $rst = show_bundle_info(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } + } + to_exit(0); +} + +unless (@cases_to_be_run) { + log_this($running_log_fd, "Please indicate the cases to run by option -b,-c,-t"); + to_exit(1); +} + +if (defined($configfile) && ($configfile =~ /(.*):(System)/)) { + $configfile = $1; + $setup_env_by_config_file = 0; +} + +log_this($running_log_fd, "xCAT automated test started at " . scalar(localtime())); +if (defined($configfile)) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "loading Configure file"); + log_this($running_log_fd, "******************************"); + $rst = load_config_file($configfile, \%config, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } +} else { + $setup_env_by_config_file = 0; +} + +if ($restore) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "Backup current xCAT database"); + log_this($running_log_fd, "******************************"); + $rst = bakup_current_env(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); } } -my @filespath = (); -#loading and check cases -log_this("******************************"); -log_this("loading test cases"); -log_this("******************************"); -$ret = &loadcase; -if ($ret != 0) { - goto EXIT; +if ($setup_env_by_config_file) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "Initialize xCAT test environment by definition in configure file"); + log_this($running_log_fd, "******************************"); + $rst = setup_env_by_configure_file(\%config, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } } -#run case -log_this("******************************"); -log_this("Start to run test cases"); -log_this("******************************"); -&reordercases if (defined($bundlelist) || defined($caselist)); -&runcase; +log_this($running_log_fd, "******************************"); +log_this($running_log_fd, "loading test cases"); +log_this($running_log_fd, "******************************"); +$rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $RUN); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} + +#print "======Dumper loaded cases=======\n"; +#print Dumper \@cases; +#print "=====Dumper case_name_index_map=======================\n"; +#print Dumper \%case_name_index_map; + +log_this($running_log_fd, "******************************"); +log_this($running_log_fd, "Start to run test cases"); +log_this($running_log_fd, "******************************"); +$rst = run_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} -EXIT: -log_this("******************************"); -log_this("un-initialize xCAT test evironment"); -log_this("******************************"); if ($restore) { - &uninit; + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "restore xCAT test evironment"); + log_this($running_log_fd, "******************************"); + $rst = restore_current_env(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } } -&log_this("\nxCAT automated test finished at " . scalar(localtime())); -&log_this("Please check results in the $resultdir, \nand see $resultdir/failedcases.$timestamp file for failed cases.\nsee $resultdir/performance.report.$timestamp file for time consumption"); -close(LOG); -close(LOG_ERR); -my $reportfile = "$resultdir/performance.report.$timestamp"; -my $tmpreport = "$resultdir/xcattest.log.$timestamp"; -&getreport($tmpreport, $reportfile); +log_this($running_log_fd, "xCAT automated test finished at" . scalar(localtime())); +log_this($running_log_fd, "Please check results in the $resultdir, \nand see $failed_log_name file for failed cases."); + +#To generate performance report +$rst = generate_performance_report($running_log_name, $performance_log_name, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} +log_this($running_log_fd, "see $performance_log_name file for time consumption"); if ($stop_to_keep_env) { - exit 1; + to_exit(1); } else { - exit 0; + to_exit(0); } -# end main -# -# logger -# +#============================================================================================== +# sub function implementation +#============================================================================================== -sub log_this -{ - print LOG join("\n", @_), "\n"; +#-------------------------------------------------------- +# Fuction name: log_this +# Description: print message to log file and STDOUT. +# Set '-q' option in command line, just print message to log file +# Atrributes: $logdf: the file description of openning log file +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub log_this { + my $logdf = shift; my $msg = join("\n", @_); - if ($msg =~ /\[Pass\]/) { - print color("green"), "$msg\n", color("reset"); - } elsif ($msg =~ /\[Failed\]/) { - print color("red"), "$msg\n", color("reset"); - } else { - print "$msg\n"; - } -} -sub log_error -{ - print LOG_ERR join("\n", @_), "\n"; -} - -sub include_file -{ - my $file = shift; - my $idir = shift; - my @text = (); - unless ($file =~ /^\//) { - $file = $idir . "/" . $file; - } - open(INCLUDE, $file) || return "#INCLUDEBAD:cannot open $file#"; - while () { - chomp($_); - s/\s+$//; #remove trailing spaces - next if /^\s*$/; #-- skip empty lines - push(@text, $_); - } - close(INCLUDE); - return join(",", @text); -} - -sub sort_caserange -{ - my @caserange = @_; - my $bundletext = join(',', @caserange); - #handle the #INLCUDE# tag recursively - my $idir = "$rootdir/bundle"; - my $doneincludes = 0; - while (not $doneincludes) { - $doneincludes = 1; - if ($bundletext =~ /#INCLUDE:[^#^\n]+#/) { - $doneincludes = 0; - $bundletext =~ s/#INCLUDE:([^#^\n]+)#/include_file($1,$idir)/eg; + #print message to STDOUT + if (!$quiet) { + if ($msg =~ /\[Pass\]/) { + print color("green"), "$msg\n", color("reset"); + } elsif ($msg =~ /\[Failed\]/) { + print color("red"), "$msg\n", color("reset"); + } else { + print "$msg\n"; } } - @caserange=split(",",$bundletext); - my @diff; - foreach my $case (@caserange) { - unless (grep { $_ eq $case } @diff) { - push @diff, $case; - } - } - my %index; - my @same = grep($index{$_}++, @caserange); - my @error =grep /INCLUDEBAD/, @caserange; - return (\@diff, \@same, \@error); + + #record message to log file + print $logdf "$msg\n"; + + return 0; } -sub getConfig -{ - my $type = undef; #Script_Prev,Script_Post,Table,Object,System,Custom - my $sub_type = undef; # The string after $type_ - # Script--> - # Script_Prev - # Script_Post - # Table---> - # Table_xxxxx - # Object--> - # Object_xxxx - # System----> - # Custom----> +#-------------------------------------------------------- +# Fuction name: pro_init +# Description: Do program initialization +# Atrributes: +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub pro_init { + mkpath("$resultdir") unless (-d "$resultdir"); - my $name = undef; - my $attr = undef; - my $value = undef; - my $c = 0; - my $cmd = undef; - my $mgt_name = undef; - - if (!open(FILE, "$configfile")) { - log_this("Error: can't open xCAT config file: $configfile"); - return 1; - } - - #Only load System information - if (defined($initallabel) && ($initallabel eq $loadsysteminfo)) { - while (my $line = ) { - $line = &trim($line); - next if (length($line) == 0); + my $timestamp = `date +"%Y%m%d%H%M%S"`; + chomp($timestamp); + $running_log_name = "$resultdir/xcattest.log.$timestamp"; + if (!open($running_log_fd, ">$running_log_name")) { + print "Failed to generate running log file for $program_name: $!\n"; + return 1; + } - #Only read System variable - if ($line =~ /\[System\]/) { - $type = "Varible"; - } - if (defined($type) && ($type eq "Varible")) { - if ($line =~ /(\w+)\s*=\s*([\w\.\-\+\/:]+)/) { - $config{var}{$1} = $2; + $failed_log_name = "$resultdir/failedcases.$timestamp"; + $performance_log_name = "$resultdir/performance.report.$timestamp"; + return 0; +} + +#-------------------------------------------------------- +# Fuction name: calculate_cases_to_be_run +# Description: calculate the case scope to be handle depending on option -b,-c,-t +# Atrributes: +# $cases_to_be_run_ref (output attribe) +# The reference of array to save the cases to be handled +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#------------------------------------------------------- +sub calculate_cases_to_be_run { + my $cases_to_be_run_ref = shift; + my $error_ref = shift; + + my $fd = undef; + my @cases = (); + + $$error_ref = ""; + if ($bundlelist) { + my @bundles = split(",", $bundlelist); + foreach my $bundle (@bundles) { + + #if $bundle doesn't include path information, find $bundle under $bundledir by default + my $bundlepath = dirname($bundle); + if ($bundlepath eq ".") { + $bundle = "$bundledir/$bundle"; + } + if (!-e "$bundle") { + $$error_ref = "There isn't file $bundle\n"; + last; + } + if (!open($fd, "$bundle")) { + $$error_ref = "Can't open file $bundle:$!\n"; + last; + } + while (my $line = <$fd>) { + chomp($line); + $line =~ s/#.+//g if ($line =~ "#" && $line !~ "^#INCLUDE"); + $line =~ s/^\s+|\s+$//g; + next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); + push(@cases, $line); + } + close($fd); + } + + return 1 if (length($$error_ref) != 0); + + #to handle "#INCLUDE:XXXXXXX#" line + my $casetxt = join(',', @cases); + for (; ;) { + if ($casetxt =~ /#INCLUDE:[^#^\n]+#/) { + $casetxt =~ s/#INCLUDE:([^#^\n]+)#/expend_include_file($1)/eg; + } else { + last; + } + } + @cases = split(",", $casetxt); + + my @error = grep /INCLUDEBAD/, @cases; + if (@error) { + $$error_ref = join("\n", @error); + return 1; + } + @{$cases_to_be_run_ref} = @cases; + } elsif ($caselist) { + @cases_to_be_run = split(",", $caselist); + } elsif ($cmdlist) { + my @cmds = split /,/, $cmdlist; + my @files = (); + my @cmdfiles = (); + get_files_recursive("$casedir", \@files); + for (my $countfile = 0 ; $countfile < @files ; $countfile++) { + for (my $countcmd = 0 ; $countcmd < @cmds ; $countcmd++) { + if ($files[$countfile] =~ m/\/$cmds[$countcmd]\/case/) { + push(@cmdfiles, glob("$files[$countfile]")); } - } - } - }else{ - #Load all config files information - while (my $line = ) { - $line = &trim($line); + } + } + + my $fd = undef; + foreach my $file (@cmdfiles) { + if (!open($fd, "<$file")) { + $$error_ref = "can't open $file:$!"; + return 1; + } + while (my $line = <$fd>) { + $line =~ s/^\s+|#[^!].+|\s+$//g; + + #skip blank and comment lines + next if (length($line) == 0 || ($line =~ /^\s*#/)); + if ($line =~ /^start\s*:\s*(.*)/) { + push @{$cases_to_be_run_ref}, $1; + } + } + close($fd); + } + } + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: expend_include_file +# Description: To support '#INCLUDE" label in bundle file, to expend the include file +# Atrributes: $bundle (input attribute): the name of bundle +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub expend_include_file { + my $bundle = shift; + + my $fd = undef; + my $bundlepath = dirname($bundle); + my @cases = (); + + if ($bundlepath eq ".") { + $bundle = "$bundledir/$bundle"; + } + if (!-e "$bundle") { + return "#INCLUDEBAD:cannot find $bundle#"; + } + if (!open($fd, "<$bundle")) { + return "#INCLUDEBAD:cannot open $bundle $!#"; + } + while (my $line = <$fd>) { + chomp($line); + $line =~ s/#.+//g if ($line =~ "#" && $line !~ "^#INCLUDE"); + $line =~ s/^\s+|\s+$//g; + next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); + push(@cases, $line); + } + close($fd); + return join(",", @cases); +} + +#-------------------------------------------------------- +# Fuction name: to_exit +# Description: customize exit function, include clean up environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub to_exit { + my $exit_code = shift; + close($running_log_fd) if (defined $running_log_fd); + &runcmd("rm -rf /tmp/xCATdbbackup") if (-d "/tmp/xCATdbbackup"); + exit $exit_code; +} + + +#-------------------------------------------------------- +# Fuction name: check_option_validity +# Description: check the validity of command line +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub check_option_validity { + my $error_ref = shift; + + if ($list) { + my @vaild_list_method = (); + if ($bundlelist || $caselist || $cmdlist) { + @vaild_list_method = ("caselist", "caseinfo", "casenum"); + } else { + @vaild_list_method = ("caselist", "caseinfo", "casenum", "bundleinfo"); + } + if (!(grep { /^$list$/ } @vaild_list_method)) { + $$error_ref = "Unsupport list method for option l"; + return 1; + } + } + + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: show_case_info +# Description: to show case name and description +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub show_case_info { + my $cases_to_be_run_ref = shift; + my $error_ref = shift; + + my @cases = (); + my %case_name_index_map; + my $rst = load_case($cases_to_be_run_ref, \@cases, \%case_name_index_map, $error_ref, $NORUN); + if ($rst) { + return 1; + } + + #print Dumper \@cases; + my %caseinfo; + my $case_num = @{$cases_to_be_run_ref}; + if ($case_num) { + foreach my $case (@{$cases_to_be_run_ref}) { + my $casedes = "without description"; + $casedes = $cases[ $case_name_index_map{$case} ]->{description} if ($cases[ $case_name_index_map{$case} ]->{description}); + $caseinfo{$case} = $casedes; + } + } else { + foreach my $case (@cases) { + my $casedes = "without description"; + $casedes = $case->{description} if ($case->{description}); + $caseinfo{ $case->{name} } = $casedes; + } + } + print_table(\%caseinfo); + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: show_bundle_info +# Description: show bundle name and description +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub show_bundle_info { + my $error_ref = shift; + + my %bundleinfo; + my $dd = undef; + my @bundlefiles = (); + if (!opendir(DIR, $bundledir)) { + $$error_ref = "Can't open directory $bundledir: $!"; + return 1; + } + my @files = readdir(DIR); + foreach my $file (@files) { + next if (-d $file); + next if ($file =~ /^\./); + push(@bundlefiles, $file); + } + closedir(DIR); + + foreach my $bundlefile (@bundlefiles) { + $bundleinfo{$bundlefile} = "without description"; + } + my $fd = undef; + foreach my $bundlefile (@bundlefiles) { + if (!open($fd, "< $bundledir$bundlefile")) { + $$error_ref = "Can't open bundle file $bundledir$bundlefile $!"; + return 1; + } + while (my $line = <$fd>) { + $line =~ s/^\s+|#.+|\s+$//g; + if ($line =~ /^description\s*:\s*(.*)/) { + $bundleinfo{$bundlefile} = $1; + last; + } + } + close($fd); + } + + print_table(\%bundleinfo); + return 0; +} + +#-------------------------------------------------------- +# Fuction name: load_config_file +# Description: load config file indicated by option -f +# Atrributes: +# $configfile (input attribute) +# The config file name +# $config_ref (output attribute) +# The reference of a hash to save the contect of config file +# The hash %config is a global attribute. +# The structure of %config: +# config{object}{type}{name}{attr} +# config{table}{name}{entry}{key} +# config{script_prev}->[] +# config{script_post}->[] +# config{var}{varname} +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub load_config_file { + my $configfile = shift; + my $config_ref = shift; + my $error_ref = shift; + + my $type = undef; + my $sub_type = undef; + my $name = undef; + my $attr = undef; + my $value = undef; + my $c = 0; + my $cmd = undef; + my $mgt_name = undef; + my $fd = undef; + + if (!open($fd, "$configfile")) { + $$error_ref = "Error: can't open xCAT config file $configfile: $!"; + return 1; + } + + while (my $line = <$fd>) { + $line =~ s/^\s+|#.+|\s+$//g; next if (length($line) == 0); #Table name can not contain "_" @@ -315,11 +673,11 @@ sub getConfig if ($line =~ /(\w+)\s*=\s*([\w\.\-]+)/) { $attr = $1; $value = $2; - if ($name && ($config{table}{$sub_type}{$name}{__KEY__} ne $attr)) { - $config{table}{$sub_type}{$name}{$attr} = $value; + if ($name && ($$config_ref{table}{$sub_type}{$name}{__KEY__} ne $attr)) { + $$config_ref{table}{$sub_type}{$name}{$attr} = $value; } else { $name = $value; - $config{table}{$sub_type}{$name}{__KEY__} = $attr; + $$config_ref{table}{$sub_type}{$name}{__KEY__} = $attr; } } } elsif ($type eq "Object") { @@ -330,644 +688,559 @@ sub getConfig if ($attr eq "Name") { $name = $value; } elsif (!defined($name)) { - print "Please give name for Object\n"; - close FILE; + $$error = "Please give name for Object section"; + close($fd); return 1; } else { - $config{object}{$sub_type}{$name}{$attr} = $value; + $$config_ref{object}{$sub_type}{$name}{$attr} = $value; } } } elsif ($type eq "Script") { ##SCRIPT_BLOCK## if ($sub_type eq "Prev") { - $config{script_prev}->[$c] = $line; + $$config_ref{script_prev}->[$c] = $line; $c = $c + 1; } elsif ($sub_type eq "Post") { - $config{script_post}->[$c] = $line; + $$config_ref{script_post}->[$c] = $line; $c = $c + 1; } } elsif ($type eq "Varible") { ##NODE_BLOCK## if ($line =~ /(\w+)\s*=\s*([\w\.\-\+\/:]+)/) { - $config{var}{$1} = $2; + $$config_ref{var}{$1} = $2; } } } -} - if (exists $config{object}) { - foreach my $type (keys %{ $config{object} }) { - foreach my $name (keys %{ $config{object}{$type} }) { - log_this("OBJECT:$name,TYPE:$type"); - foreach my $attr (keys %{ $config{object}{$type}{$name} }) { - log_this(" $attr = $config{object}{$type}{$name}{$attr};"); + if (exists $$config_ref{object}) { + foreach my $type (keys %{ $$config_ref{object} }) { + foreach my $name (keys %{ $$config_ref{object}{$type} }) { + log_this($running_log_fd, "OBJECT:$name,TYPE:$type"); + foreach my $attr (keys %{ $$config_ref{object}{$type}{$name} }) { + log_this($running_log_fd, " $attr = $$config_ref{object}{$type}{$name}{$attr};"); } } } } - if (exists $config{table}) { - foreach my $type (keys %{ $config{table} }) { - log_this("TABLE:$type"); - foreach my $name (keys %{ $config{table}{$type} }) { - log_this(" $config{table}{$type}{$name}{__KEY__} = $name"); - foreach my $attr (keys %{ $config{table}{$type}{$name} }) { + if (exists $$config_ref{table}) { + foreach my $type (keys %{ $$config_ref{table} }) { + log_this($running_log_fd, "TABLE:$type"); + foreach my $name (keys %{ $$config_ref{table}{$type} }) { + log_this($running_log_fd, " $$config_ref{table}{$type}{$name}{__KEY__} = $name"); + foreach my $attr (keys %{ $$config_ref{table}{$type}{$name} }) { if ($attr ne '__KEY__') { - log_this(" $attr = $config{table}{$type}{$name}{$attr}"); + log_this($running_log_fd, " $attr = $$config_ref{table}{$type}{$name}{$attr}"); } } - log_this("\n"); } } } - if (exists $config{script_prev}) { - log_this("Script_Prev:"); - foreach $cmd (@{ $config{script_prev} }) { - log_this(" $cmd"); + if (exists $$config_ref{script_prev}) { + log_this($running_log_fd, "Script_Prev:"); + foreach $cmd (@{ $$config_ref{script_prev} }) { + log_this($running_log_fd, " $cmd"); } } - if (exists $config{script_post}) { - log_this("Script_Post:"); - foreach $cmd (@{ $config{script_post} }) { - log_this(" $cmd"); + if (exists $$config_ref{script_post}) { + log_this($running_log_fd, "Script_Post:"); + foreach $cmd (@{ $$config_ref{script_post} }) { + log_this($running_log_fd, " $cmd"); } } - if (exists $config{var}) { - log_this("Varible:"); - foreach my $varname (keys %{ $config{var} }) { - log_this(" $varname = $config{var}{$varname}"); + if (exists $$config_ref{var}) { + log_this($running_log_fd, "Varible:"); + foreach my $varname (keys %{ $$config_ref{var} }) { + log_this($running_log_fd, " $varname = $$config_ref{var}{$varname}"); } } - close FILE; + close($fd); return 0; } -sub init -{ - if ($restore) { - log_this("******************************"); - log_this("Backup current xCAT database"); - log_this("******************************"); - &runcmd("mkdir -p /tmp/xCATdbbackup"); - &runcmd("dumpxCATdb -p /tmp/xCATdbbackup"); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to backup xCAT database"); - &runcmd("rm -rf /tmp/xCATdbbackup"); - $restore = 0; +#-------------------------------------------------------- +# Fuction name: load_case +# Description: load test case +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $case_ref (input attribe) +# The reference of a array of hash to save the contect of case +# The array @cases is a global attribute. +# The struture of @cases are: +# $cases[index]->{name} +# $cases[index]->{os} +# $cases[index]->{arch} +# $cases[index]->{hcp} +# $cases[index]->{type} +# $cases[index]->{stop} +# $cases[index]->{description} +# $cases[index]->{attribute} +# $cases[index]->{cmd}->[index][index] +# $cases[index]->{check}->[index][index] +# $cases[index]->{cmdcheck}->[index][index] +# $case_name_index_map_ref (input attribute) +# The reference of a hash to save the mapping of test name ane its index in @cases +# Due to there maybe is more than one implementation for one case +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# $run_case_flag (input attribute) +# The flag of whether run these case nex. +# 0 means no, just load case basic information, used by "searching informaiotn funtion of xcattest" +# 1 means yes, load case basic information and parse the attribure at the sametime. used by "run case funtion of xcattest" +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub load_case { + my $cases_to_be_run_ref = shift; + my $case_ref = shift; + my $case_name_index_map_ref = shift; + my $error_ref = shift; + my $run_case_flag = shift; + + #if @{$cases_to_be_run_ref} is empty, that means not indicate test case scope by command line option -b,-t,-c + #load all cases shipped by xcat test package + my $load_all_case_flag = 0; + my $case_num = @{$cases_to_be_run_ref}; + $load_all_case_flag = 1 if ($case_num == 0); + + my @files = (); + get_files_recursive("$casedir", \@files); + + my $line; + my $i = 0; + my $j = -1; + my $z = 0; + my $m = 0; + my $newcmdstart = 0; + my $skip = 0; + my $fd = undef; + + my %invalidcases; + my %case_name_index_map_bak; + foreach my $file (@files) { + if (!open($fd, "<$file")) { + $$error_ref = "Can't open $file: $!"; return 1; } - } - my $cmd = undef; - foreach $cmd (@{ $config{script_prev} }) { - log_this("$cmd"); - &runcmd($cmd); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to run $cmd"); - return 1; - } - } - if (exists $config{object}) { - foreach my $type (keys %{ $config{object} }) { - foreach my $name (keys %{ $config{object}{$type} }) { - $cmd = "chdef -t $type -o $name"; - foreach my $attr (keys %{ $config{object}{$type}{$name} }) { - $cmd = $cmd . " $attr=$config{object}{$type}{$name}{$attr}"; - } - log_this($cmd); - runcmd($cmd); - if ($::RUNCMD_RC != 0) { - log_this("Fail to run $cmd"); - return 1; - } - } - } - } - if (exists $config{table}) { - foreach my $type (keys %{ $config{table} }) { - foreach my $name (keys %{ $config{table}{$type} }) { - $cmd = "chtab $config{table}{$type}{$name}{__KEY__}=$name"; - foreach my $attr (keys %{ $config{table}{$type}{$name} }) { - if ($attr ne '__KEY__') { - $cmd = $cmd . " $type.$attr=$config{table}{$type}{$name}{$attr}"; + while ($line = <$fd>) { + $line =~ s/^\s+|#[^!].+|\s+$//g; + + #skip blank and comment lines + next if (length($line) == 0 || ($line =~ /^\s*#/)); + + if ($line =~ /^start\s*:\s*(.*)/) { + my $name = $1; + if ($load_all_case_flag) { + if (is_valid_case_name($name)) { + $skip = 0; + $j = -1; + $case_ref->[$i] = {}; + $case_ref->[$i]->{name} = $name; + $case_ref->[$i]->{filename} = $file; + if(exists($$case_name_index_map_ref{"$name"})){ + $case_name_index_map_bak{"$name"}=$$case_name_index_map_ref{"$name"}; + } + $$case_name_index_map_ref{"$name"} = $i; + $newcmdstart = 0; + } else { + $skip = 1; + push @{ $invalidcases{"invalidcasename"} }, $name; + } + } else { + if (!(grep { /^$name$/ } @{$cases_to_be_run_ref})) { + $skip = 1; + next; + } else { + if (is_valid_case_name($name)) { + $skip = 0; + $j = -1; + $case_ref->[$i] = {}; + $case_ref->[$i]->{name} = $name; + $case_ref->[$i]->{filename} = $file; + if(exists($$case_name_index_map_ref{"$name"})){ + $case_name_index_map_bak{"$name"}=$$case_name_index_map_ref{"$name"}; + } + $$case_name_index_map_ref{"$name"} = $i; + $newcmdstart = 0; + } else { + $skip = 1; + push @{ $invalidcases{"invalidcasename"} }, $name; + } } } - log_this($cmd); - &runcmd($cmd); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to run $cmd"); - return 1; + } elsif ($line =~ /^os\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{os} = $1; + + if ($run_case_flag) { + + #To judge whether need to skip the current case + my @validoslist = split(",", $case_ref->[$i]->{os}); + my @newvalidoslist = (); + foreach my $validos (@validoslist) { + if ($validos =~ /linux/i) { + push(@newvalidoslist, ("rhel", "sles", "ubuntu")); + } else { + push(@newvalidoslist, $validos); + } + } + + my $currentos = get_current_os(); + my $valid = 0; + foreach my $os (@newvalidoslist) { + if ($currentos =~ /$os/i) { + $valid = 1; + last; + } + } + unless ($valid) { + #$skip = 1; + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } + $newcmdstart = 0; + } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{arch} = $1; + + if ($run_case_flag) { + #To judge whether need to skip the current case + my $case_arch = $case_ref->[$i]->{arch}; + if($case_arch =~ /ppc/i && $case_arch !~ /le|el/i){ + $case_arch="ppc"; + }elsif($case_arch =~ /ppc/i && $case_arch =~ /le|el/i){ + $case_arch="ppc64le"; + }elsif($case_arch =~ /x86/i){ + $case_arch="x86"; + } + + my $env_arch = $config{var}{ARCH}; + if($env_arch =~ /ppc/i && $env_arch !~ /le|el/i){ + $env_arch="ppc"; + }elsif($env_arch =~ /ppc/i && $env_arch =~ /le|el/i){ + $env_arch="ppc64le"; + }elsif($env_arch =~ /x86/i){ + $env_arch="x86"; + } + + my $valid = 0; + if ($case_arch eq $env_arch) { + $valid = 1; + } + unless ($valid) { + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } + $newcmdstart = 0; + } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{hcp} = $1; + if ($run_case_flag) { + #To judge whether need to skip the current case + my $valid = 0; + if ($case_ref->[$i]->{hcp} =~ /$config{var}{HCP}/i) { + $valid = 1; + } + unless ($valid) { + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } + $newcmdstart = 0; + } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { + next if $skip; + $case_ref->[$i]->{type} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^stop\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{stop} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^description\s*:\s*(.+)/) { + next if $skip; + $case_ref->[$i]->{description} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^attribute\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{attribute} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^cmd\s*:\s*([\#\/\$\w].+)/) { + next if $skip; + $newcmdstart = 0; + $j = $j + 1; + $z = 0; + $m = 0; + if ($run_case_flag) { + $case_ref->[$i]->{cmd}->[$j][$m] = getvar($1, \%config); + if ($case_ref->[$i]->{cmd}->[$j][$m] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{cmd}->[$j][$m]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{cmd}->[$j][$m] = $1; + } + $newcmdstart = 1; + } elsif ($line =~ /^check\s*:\s*(\w.+)/) { + next if $skip; + if ($run_case_flag) { + $case_ref->[$i]->{check}->[$j][$z] = getvar($1, \%config); + if ($case_ref->[$i]->{check}->[$j][$z] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{check}->[$j][$z]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{check}->[$j][$z] = $1; + } + $z = $z + 1; + $newcmdstart = 0; + } elsif ($line =~ /^cmdcheck\s*:\s*(\w.+)/) { + next if $skip; + if ($run_case_flag) { + $case_ref->[$i]->{cmdcheck}->[$j][$z] = getvar($1, \%config); + if ($case_ref->[$i]->{cmdcheck}->[$j][$z] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{cmdcheck}->[$j][$z]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{cmdcheck}->[$j][$z] = $1; + } + $z = $z + 1; + $newcmdstart = 0; + } elsif ($line =~ /^end/) { + next if $skip; + $i = $i + 1; + $newcmdstart = 0; + } elsif ($newcmdstart) { + ++$m; + $case_ref->[$i]->{cmd}->[$j][$m] = $line; + } + } + close($fd); + } + + my @wrong_cases = (); + my $caseerror = 0; + if ($invalidcases{"invalidcasename"}) { + + #log_this($running_log_fd, "Case name invalid:", @{ $invalidcases{"invalidcasename"} }); + $$error_ref = "Case name invalid: " . join(",", @{ $invalidcases{"invalidcasename"} }); + push @wrong_cases, @{ $invalidcases{"invalidcasename"} }; + $caseerror = 1; + } + + if ($run_case_flag) { + if ($invalidcases{"missattr"}) { + + #log_this($running_log_fd, "Miss attribute:", @{$invalidcases{"missattr"}}); + $$error_ref = "Miss attribute: " . join(",", @{ $invalidcases{"missattr"} }); + foreach my $line (@{ $invalidcases{"missattr"} }) { + my @name = split(" ", $line); + if (!(grep /$name[0]/, @wrong_cases)) { + push @wrong_cases, $name[0]; } } + $caseerror = 1; } - } - if (!exists $config{var}{OS}) { - my @output = runcmd("uname"); - $config{var}{OS} = $output[0]; - log_this("Detecting: OS = $config{var}{OS}"); - } else { - $config{var}{OS} = lc($config{var}{OS}); - } + if ($invalidcases{"noruncases"}) { + log_this($running_log_fd, "Not to run:", @{ $invalidcases{"noruncases"} }); + push @wrong_cases, @{ $invalidcases{"noruncases"} }; + } - if (!exists $config{var}{ARCH}) { - if (!exists $config{var}{CN}) { - $config{var}{ARCH} = "Unknown"; - log_this("Error: No compute node defined, can't get ARCH of compute node"); - } else { - $config{var}{ARCH} = getnodeattr($config{var}{CN}, "arch"); - if ($config{var}{ARCH} =~ /ppc/) { - $config{var}{ARCH} = 'ppc'; - } elsif ($config{var}{ARCH} =~ /86/) { - $config{var}{ARCH} = 'x86'; + unless ($caseerror) { + my @new_cases_to_be_run = (); + foreach my $c (@{$cases_to_be_run_ref}) { + if (!(grep { /^$c$/ } @wrong_cases)) { + push @new_cases_to_be_run, $c; + } } - log_this("Detecting: ARCH = $config{var}{ARCH}"); + log_this($running_log_fd, "To run:", @new_cases_to_be_run); + #@{$cases_to_be_run_ref} = @new_cases_to_be_run; } } - if (!exists $config{var}{HCP}) { - if (!exists $config{var}{CN}) { - $config{var}{HCP} = "Unknown"; - log_this("Error: No compute node defined, can't get HCP TYPE of compute node"); - } else { - $config{var}{HCP} = getnodeattr($config{var}{CN}, "mgt"); - log_this("Detecting: HCP = $config{var}{HCP}"); - } + return $caseerror; +} +#-------------------------------------------------------- +# Fuction name: bakup_current_env +# Description: back up the xcat db +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub bakup_current_env { + my $error_ref = shift; + &runcmd("mkdir -p /tmp/xCATdbbackup"); + &runcmd("dumpxCATdb -p /tmp/xCATdbbackup"); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to backup xCAT database"; + &runcmd("rm -rf /tmp/xCATdbbackup"); + return 1; } return 0; } -sub uninit -{ - my $cmd = undef; - - # if(exists $config{object}){ - # foreach my $type (keys %{$config{object}}){ - # foreach my $name (keys %{$config{object}{$type}}){ - # $cmd = "rmdef -t $type -o $name"; - # log_this($cmd); - # runcmd($cmd); - # if($::RUNCMD_RC != 0){ - # log_this("Fail to run $cmd"); - # return 1; - # } - # } - # } - # } - # if(exists $config{table}){ - # foreach my $type (keys %{$config{table}}){ - # foreach my $name (keys %{$config{table}{$type}}){ - # $cmd = "chtab -d $config{table}{$type}{$name}{__KEY__}=$name $type"; - # log_this($cmd); - # runcmd($cmd); - # if($::RUNCMD_RC != 0){ - # log_this("Fail to run $cmd"); - # return 1; - # } - # } - # } - # } - foreach $cmd (@{ $config{script_post} }) { - log_this($cmd); - runcmd($cmd); - if ($::RUNCMD_RC != 0) { - log_this("Error: Fail to run $cmd"); - return 1; - } - } - +#-------------------------------------------------------- +# Fuction name: restore_current_env +# Description: restore the xcat db +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub restore_current_env { + my $error_ref = shift; &runcmd("restorexCATdb -p /tmp/xCATdbbackup"); &runcmd("rm -rf /tmp/xCATdbbackup"); return 0; } -sub Get_Files_Recursive -{ - my $dir = $_[0]; - foreach $dir (@_) - { - opendir(my $d, $dir); - for (; ;) - { - my $direntry = readdir($d); - last unless defined $direntry; - next if $direntry =~ m/^\.\w*/; - next if $direntry eq '..'; - if (-d $dir . "/" . $direntry) - { - Get_Files_Recursive($dir . "/" . $direntry); - } - else - { my $dirpath = $dir . '/' . $direntry . "\n"; - #print $dirpath; +#-------------------------------------------------------- +# Fuction name: run_case +# Description: +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $case_ref (input attribe) +# The reference of a array of hash to save the contect of case +# The array @cases is a global attribute. +# Please refer load_case function's comment to get the struture of @cases +# $case_name_index_map_ref (input attribute) +# The reference of a hash to save the mapping of test name ane its index in @cases +# Due to there maybe is more than one implementation for one case +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub run_case { + my $cases_to_be_run_ref = shift; + my $cases_ref = shift; + my $case_name_index_map_ref = shift; + my $error_ref = shift; - #print $dir."\n"; - push(@filespath, glob("$dirpath")); - - } - } - closedir($d); - } -} - -sub loadcase -{ - my @files = (); - - #if($cmdlist){ - # my @cmds = split /,/,$cmdlist; - # for my $cmd (@cmds){ - # push (@files, glob("$casedir/$cmd/*")); - # } - #} else { - # @files = glob("$casedir/*/*"); - #} - Get_Files_Recursive("$casedir"); - for (my $countfile = 0 ; $countfile < @filespath ; $countfile++) - { - #TODO:if commands are not right, no action or message now - if ($cmdlist) { - my @cmds = split /,/, $cmdlist; - for (my $countcmd = 0 ; $countcmd < @cmds ; $countcmd++) { - if ($filespath[$countfile] =~ m/\/$cmds[$countcmd]\/case/) { - push(@files, glob("$filespath[$countfile]")); - } - } - } else { - push(@files, glob("$filespath[$countfile]")); - } - } - - - my $file; - my $line; - my $i = 0; - my $j = -1; - my $z = 0; - my $skip = 0; - - my @caserange = (); - my @rightcase = (); - my @notrightcase = (); - my @wrongnamecase= (); - my @samecase = (); - my @errorcase = (); - if ($bundlelist) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles) { - if (!open(FILE, "<$bundledir/$bundle")) { - log_this("can't open $bundledir/$bundle"); - return 1; - } - while ($line = ) { - chomp($line); - next if (length($line) == 0); - push(@caserange, $line); - } - close(FILE); - my @refs=sort_caserange(@caserange); - @caserange=@{$refs[0]}; - @samecase=@{$refs[1]}; - @errorcase=@{$refs[2]}; - } - } - - #TODO:if cases are not existed, no action or message. - if ($caselist) { - @caserange = split /,/, $caselist; - } - - foreach $file (@files) { - if (!open(FILE, "<$file")) { - log_this("can't open $file"); - return 1; - } - while ($line = ) { - $line = &trim($line); - next if (length($line) == 0); - - #skip comment lines - next if ($line =~ /^\s*#/); - - #TODO: description and attribute line is treated as a comment line for now - next if ($line =~ /^description\s*:/); - next if ($line =~ /^attribute\s*:/); - - if ($line =~ /^start\s*:\s*(.*)/) { - my $name =$1; - if ($name =~ /[^a-zA-Z0-9_-]/) { - $skip = 1; - push(@wrongnamecase, $name); - next; - }else { - $skip = 0; - if ($caserange[0] && !(grep { /^$name$/ } @caserange)) { - $skip = 1; - next; - } - $j = -1; - $cases[$i] = {}; - $cases[$i]->{name} = $name; - $cases[$i]->{filename} = $file; - if (!$needshow) { - $cases[$i]->{cmd} = []; - $cases[$i]->{check} = []; - $cases[$i]->{cmdcheck} = []; - push(@rightcase, $name); - } else { - $skip = 1; - $i = $i + 1; - } - } - } elsif ($line =~ /^os\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $string1 = $1; - if ($string1 =~ /^rhels\s*/ && -f "/etc/redhat-release") { - $cases[$i]->{os} = "rhels"; - } elsif ($string1 =~ /^sles\s*/ && -f "/etc/SuSE-release") { - $cases[$i]->{os} = "sles"; - } elsif ($string1 =~ /^ubuntu\s*/ && -f "/etc/lsb-release") { - $cases[$i]->{os} = "ubuntu"; - } - else { - $cases[$i]->{os} = $string1; - - } - - chomp($cases[$i]->{os}); - chomp($config{var}{OS}); - if ($cases[$i]->{os} !~ /$config{var}{OS}/) { - if ((($config{var}{OS} =~ /^Linux\s*/i) && ($cases[$i]->{os} =~ /^aix\s*/i)) || (($config{var}{OS} =~ /^aix\s*/i) && ($cases[$i]->{os} !~ /^aix\s*/i)) || (($config{var}{OS} =~ /^rhels\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i)) || (($config{var}{OS} =~ /^sles\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i)) || (($config{var}{OS} =~ /^ubuntu\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i))) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } - - } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{arch} = $1; - if ($cases[$i]->{arch} !~ /$config{var}{ARCH}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{hcp} = $1; - if ($cases[$i]->{hcp} !~ /$config{var}{HCP}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { - next if $skip; - $cases[$i]->{type} = $1; - if ($cases[$i]->{type} !~ /$config{var}{TYPE}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^stop\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{stop} = $1; - } elsif ($line =~ /^cmd\s*:\s*([\/\$\w].+)/) { - next if $skip; - $j = $j + 1; - $z = 0; - $cases[$i]->{cmd}->[$j] = &getvar($1); - if ($cases[$i]->{cmd}->[$j] eq '') { - close(FILE); - return 1; - } - } elsif ($line =~ /^check\s*:\s*(\w.+)/) { - next if $skip; - $cases[$i]->{check}->[$j][$z] = &getvar($1); - if ($cases[$i]->{check}->[$j][$z] eq '') { - close(FILE); - return 1; - } - $z = $z + 1; - } elsif ($line =~ /^cmdcheck\s*:\s*(\w.+)/) { - next if $skip; - $cases[$i]->{cmdcheck}->[$j][$z] = &getvar($1); - if ($cases[$i]->{cmdcheck}->[$j][$z] eq '') { - close(FILE); - return 1; - } - $z = $z + 1; - } elsif ($line =~ /^end/) { - next if $skip; - $i = $i + 1; - } - } - - close(FILE); - } - - if ($needshow) { - if (@cases) { - foreach my $case (@cases) { - log_this("$case->{name}"); - } - }else { - log_this("Error: Please check the case name or command name"); - } - log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); - return 0; - } - - if (@rightcase) { - log_this("To run:", @rightcase); - }else { - log_this("Error: No case to run, please check the case name or command name"); - } - log_this("Not to run:", @notrightcase) if (@notrightcase); - log_this("Duplicated case:", @samecase) if (@samecase); - log_this("INCLUDEBAD case:", @errorcase) if (@errorcase); - log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); - return 0; -} -sub getnodeattr -{ - my ($node, $attr) = @_; - my @output = runcmd("lsdef -t node -o $node -i $attr"); - my $t; - if ($::RUNCMD_RC) { - - # return "Unknown"; - foreach $t (1 .. 40) { - log_this("Error: could not get node attr $attr "); - @output = runcmd("lsdef -t node -o $node -i $attr"); - last if ($::RUNCMD_RC == 0); - } - - } - if ($::RUNCMD_RC == 0) { - foreach my $output1 (@output) { - if ($output1 =~ /$attr=(\w.+)/) { - log_this("$attr is $1"); - return $1; - } - } - } - return "Unknown"; -} - -sub gettablevalue -{ - my ($keyname, $key, $colname, $table) = @_; - my @output = runcmd("gettab $keyname=$key $table\.$colname"); - return $output[0]; -} - -#to remove space and comment -sub trim -{ - my $str = shift @_; - if ($str) { - - # $str =~ s/\#/__wellnumber__/g; - $str =~ s/^\s+|#.+|\s+$//g; - - # $str =~ s/__wellnumber__/#/g; - } - return $str; -} - -sub getvar -{ - my $str = shift @_; - while ($str =~ /\$\$(\w+)/) { - my $varname = $1; - if (exists($config{var}{$varname})) { - $str =~ s/\$\$$varname/$config{var}{$varname}/g; - } else { - log_this("Error: can't get varible $varname"); - return ''; - } - } - return $str; -} - -sub getfunc -{ - my $str = shift @_; - my $func = undef; - my @para = (); - my $parameter = undef; - my $value = undef; - while ($str =~ /__(\w+)\(([\s\,\w\$]*)\)__/) { - $func = $1; - $parameter = $2; - log_this("parameter is $parameter,fun is $func"); - @para = split /\s*,\s*/, trim($parameter); - if ($func eq "GETNODEATTR") { - $value = getnodeattr(@para); - log_this("value is $value"); - if ($value eq "Unknown") { - $value = ''; - } - } elsif ($func eq "INC") { - $value = $para[0] + 1; - } elsif ($func eq "GETTABLEVALUE") { - $value = gettablevalue(@para); - } - $str =~ s/__$func\($parameter\)__/$value/g; - } - return $str; -} - -sub runcase -{ - my @output = (); - my $rc = 0; - my $j = 0; - my $z = 0; - my $lvalue = undef; - my $rvalue = undef; - my $op = undef; - my $failed = 0; my $total = 0; my $failnum = 0; - foreach my $case (@cases) { - my @record = (); - $failed = 0; - $j = 0; - $total = $total + 1; - my $now1 = timelocal(localtime()); - my $time1 = scalar(localtime()); - log_this("------START:$$case{name}::Time:$time1------"); - push @record, "------START:$$case{name}::Time:$time1------"; - push @record, "FILENAME:$$case{filename}"; - foreach my $cmd (@{ $$case{cmd} }) { - $cmd = getfunc($cmd); + my $failed_log_fd = undef; + if (!open($failed_log_fd, ">$failed_log_name")) { + $error_ref = "Failed to generate failed log file for $program_name: $!"; + return 1; + } - #by - my $runstart = timelocal(localtime()); + foreach my $case (@{$cases_to_be_run_ref}) { + my @caselog = (); + + my $failflag = 0; + my $j = 0; + ++$total; + + my $case_start_time = timelocal(localtime()); + my $case_start_time_str = scalar(localtime()); + + log_this($running_log_fd, "------START::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); + push @caselog, "------START::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; + push @caselog, "FILENAME:$cases_ref->[$case_name_index_map_ref->{$case}]->{filename}\n"; + + foreach my $cmd (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmd} }) { + + my $runstart = timelocal(localtime()); my $runstartstr = scalar(localtime()); - log_this("\nRUN:$cmd [$runstartstr]"); - push(@record, "\nRUN:$cmd [$runstartstr]"); - @output = &runcmd($cmd); - $rc = $::RUNCMD_RC; + my $cmdlen = @{$cmd}; + my @output = (); + my $rc = 0; + if ($cmdlen == 1) { + + #to run single line command + + $cmd->[0] = getfunc($cmd->[0]); + @output = &runcmd($cmd->[0]); + $rc = $::RUNCMD_RC; + log_this($running_log_fd, "RUN:$cmd->[0] [$runstartstr]"); + push(@caselog, "RUN:$cmd->[0] [$runstartstr]"); + } else { + + #to run multiple lines command + + @output = runscript($cmd); + $rc = $::RUNCMD_RC; + log_this($running_log_fd, "RUN: [$runstartstr]", @{$cmd}); + push(@caselog, ("RUN: [$runstartstr]", @{$cmd})); + } - #by my $runstop = timelocal(localtime()); my $diffduration = $runstop - $runstart; - log_this("\n[$cmd] Running Time:$diffduration sec"); - push(@record, ("\n[$cmd] Running Time:$diffduration sec")); + log_this($running_log_fd, ("ElapsedTime:$diffduration sec", "RETURN rc = $rc", "OUTPUT:", @output)); + push(@caselog, ("ElapsedTime:$diffduration sec", "RETURN rc = $rc", "OUTPUT:", @output)); - log_this("RETURN: rc = $rc", "OUTPUT:", @output); - push(@record, ("RETURN rc = $rc", "OUTPUT:", @output)); + foreach my $check (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{check}->[$j] }) { + last if ($failflag); - - foreach my $check (@{ $$case{check}->[$j] }) { - if ($failed) { - last; - } if ($check =~ /rc\s*([=!]+)\s*(\d+)/) { - $lvalue = $rc; - $op = $1; - $rvalue = $2; + my $lvalue = $rc; + my $op = $1; + my $rvalue = $2; if ((($op eq '!=') && ($lvalue == $rvalue)) || (($op eq '==') && ($lvalue != $rvalue))) { - $failed = 1; + $failflag = 1; } - if ($failed) { - log_this("CHECK:rc $op $rvalue\t[Failed]"); - push(@record, "CHECK:rc $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:rc $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:rc $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:rc $op $rvalue\t[Pass]"); - push(@record, "CHECK:rc $op $rvalue\t[Pass]"); + log_this($running_log_fd, "CHECK:rc $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:rc $op $rvalue\t[Pass]"); } } elsif ($check =~ /output\s*([=!~]+)\s*(\S.*)/ && $check !~ /output\s*([=!~])\1/) { - $lvalue = join("\n", @output); - $op = $1; - $rvalue = $2; + my $lvalue = join("\n", @output); + my $op = $1; + my $rvalue = $2; + $rvalue = getfunc($rvalue); if ((($op eq '=~') && ($lvalue !~ /$rvalue/)) || (($op eq '!~') && ($lvalue =~ /$rvalue/)) || (($op eq '==') && ($lvalue ne $rvalue)) || (($op eq '!=') && ($lvalue eq $rvalue))) { - $failed = 1; + $failflag = 1; } - if ($failed) { - log_this("CHECK:output $op $rvalue\t[Failed]"); - push(@record, "CHECK:output $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:output $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:output $op $rvalue\t[Pass]"); - push(@record, "CHECK:output $op $rvalue\t[Pass]"); + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:output $op $rvalue\t[Pass]"); } } elsif ($check =~ /output\s*~~\s*(\S.*)/) { - $op = "~~"; - $failed = 1; - $rvalue = $1; + my $op = "~~"; + + #my $failflag = 1; + my $rvalue = $1; + $rvalue = getfunc($rvalue); my $num; if ($rvalue =~ /(\d+)/) { @@ -982,7 +1255,7 @@ sub runcase my $min = $num * 0.9; $line =~ /.*:.*: (\d+) /; if ($1 < $max && $1 > $min) { - $failed = 0; + $failflag = 0; last; } } else { @@ -990,54 +1263,167 @@ sub runcase } } } - if ($failed) { - log_this("CHECK:output $op $rvalue $num\t[Failed]"); - push(@record, "CHECK:output $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:output $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:output $op $rvalue $num\t[Pass]"); - push(@record, "CHECK:output $op $rvalue\t[Pass]"); - } - } - } - foreach my $cmdcheck (@{ $$case{cmdcheck}->[$j] }) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:output $op $rvalue\t[Pass]"); + } } } + foreach my $cmdcheck (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmdcheck}->[$j] }) { if ($cmdcheck) { &runcmd($cmdcheck); $rc = $::RUNCMD_RC; - if ($rc == 1) { - log_this("CMDCHECK:output $cmdcheck\t[Failed]"); - push(@record, "CHECK:output $cmdcheck\t[Failed]"); + if ($rc != 0 ) { + $failflag = 1; + log_this($running_log_fd, "CHECK:output $cmdcheck\t[Failed]"); + push(@caselog, "CHECK:output $cmdcheck\t[Failed]"); } elsif ($rc == 0) { - log_this("CMDCHECK:output $cmdcheck\t[Pass]"); - push(@record, "CHECK:output $cmdcheck\t[Pass]"); + log_this($running_log_fd, "CHECK:output $cmdcheck\t[Pass]"); + push(@caselog, "CHECK:output $cmdcheck\t[Pass]"); } } } $j = $j + 1; + log_this($running_log_fd, " "); + push(@caselog, " "); } - my $now2 = timelocal(localtime()); - my $time2 = scalar(localtime()); - my $diff = $now2 - $now1; - if ($failed) { - log_this("------END::$$case{name}::Failed::Time:$time2 ::Duration::$diff sec------"); - push(@record, "------END::$$case{name}::Failed::Time:$time2 ::Duration::$diff sec------"); + my $case_end_time = timelocal(localtime()); + my $case_end_time_str = scalar(localtime()); + my $diff = $case_end_time - $case_start_time; + + if ($failflag) { + log_this($running_log_fd, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Failed::Time:$case_end_time_str ::Duration::$diff sec------"); + push(@caselog, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Failed::Time:$case_end_time_str ::Duration::$diff sec------"); } else { - log_this("------END::$$case{name}::Passed::Time:$time2 ::Duration::$diff sec------"); - push(@record, "------END::$$case{name}::Passed::Time:$time2 ::Duration::$diff sec------"); + log_this($running_log_fd, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Passed::Time:$case_end_time_str ::Duration::$diff sec------"); + push(@caselog, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Passed::Time:$case_end_time_str ::Duration::$diff sec------"); } - if ($failed) { - $failnum = $failnum + 1; - log_error(@record); - if (defined($$case{stop}) && ($$case{stop} =~ /^yes$/)) { + + if ($failflag) { + ++$failnum; + print $failed_log_fd (join("\n", @caselog), "\n"); + if (defined($cases_ref->[ $case_name_index_map_ref->{$case} ]->{stop}) && ($cases_ref->[ $case_name_index_map_ref->{$case} ]->{stop} =~ /^yes$/)) { $stop_to_keep_env = 1; last; } } } - log_this("\n\n"); - log_this("------Total: $total , Failed: $failnum------"); + + log_this($running_log_fd, "------Total: $total , Failed: $failnum------\n"); + close($failed_log_fd); + return 0; } +#-------------------------------------------------------- +# Fuction name: setup_env_by_configure_file +# Description: set up environment by the settings in config file +# Atrributes: +# $config_ref (input attribute) +# The reference of global hash %config. +# The structure of %config please refer to the comment of function load_config_file +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub setup_env_by_configure_file { + my $config_ref = shift; + my $error_ref = shift; + + my $cmd = undef; + foreach $cmd (@{ $$config_ref{script_prev} }) { + log_this($running_log_fd, "$cmd"); + &runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + + if (exists $$config_ref{object}) { + foreach my $type (keys %{ $$config_ref{object} }) { + foreach my $name (keys %{ $$config_ref{object}{$type} }) { + $cmd = "chdef -t $type -o $name"; + foreach my $attr (keys %{ $$config_ref{object}{$type}{$name} }) { + $cmd = $cmd . " $attr=$$config_ref{object}{$type}{$name}{$attr}"; + } + log_this($running_log_fd, "$cmd"); + runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + } + } + + if (exists $$config_ref{table}) { + foreach my $type (keys %{ $$config_ref{table} }) { + foreach my $name (keys %{ $$config_ref{table}{$type} }) { + $cmd = "chtab $$config_ref{table}{$type}{$name}{__KEY__}=$name"; + foreach my $attr (keys %{ $$config_ref{table}{$type}{$name} }) { + if ($attr ne '__KEY__') { + $cmd = $cmd . " $type.$attr=$$config_ref{table}{$type}{$name}{$attr}"; + } + } + log_this($running_log_fd, "$cmd"); + &runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + } + } + + if (!exists $$config_ref{var}{OS}) { + my @output = runcmd("uname"); + $$config_ref{var}{OS} = $output[0]; + log_this($running_log_fd, "Detecting: OS = $$config_ref{var}{OS}"); + } else { + $$config_ref{var}{OS} = lc($$config_ref{var}{OS}); + } + + if (!exists $$config_ref{var}{ARCH}) { + if (!exists $$config_ref{var}{CN}) { + $$config_ref{var}{ARCH} = "Unknown"; + log_this($running_log_fd, "Warning: No compute node defined, can't get ARCH of compute node"); + } else { + $$config_ref{var}{ARCH} = getnodeattr($$config_ref{var}{CN}, "arch"); + if ($$config_ref{var}{ARCH} =~ /le|el/) { + $$config_ref{var}{ARCH} = 'ppc64le'; + } elsif ($$config_ref{var}{ARCH} =~ /ppc/) { + $$config_ref{var}{ARCH} = 'ppc'; + } elsif ($$config_ref{var}{ARCH} =~ /86/) { + $$config_ref{var}{ARCH} = 'x86'; + } + log_this($running_log_fd, "Detecting: ARCH = $$config_ref{var}{ARCH}"); + } + } + + if (!exists $$config_ref{var}{HCP}) { + if (!exists $$config_ref{var}{CN}) { + $$config_ref{var}{HCP} = "Unknown"; + log_this($running_log_fd, "Warning: No compute node defined, can't get HCP TYPE of compute node"); + } else { + $$config_ref{var}{HCP} = getnodeattr($$config_ref{var}{CN}, "mgt"); + log_this($running_log_fd, "Detecting: HCP = $$config_ref{var}{HCP}"); + } + + } + + return 0; +} + +#-------------------------------------------------------- +# Fuction name: runcmd +# Description: run a command after 'cmd' label in one case +# Atrributes: +# Retrun code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- sub runcmd { my ($cmd) = @_; @@ -1056,91 +1442,269 @@ sub runcmd } -sub usage -{ - log_this("Usage:Run xcat test cases:"); - log_this(" xcattest [-?|-h]"); - log_this(" xcattest [-f configure file] [-b case bundle files]"); - log_this(" xcattest [-f configure file] [-t cases list]"); - log_this(" xcattest [-f configure file] [-c cmds list]"); - log_this("Show xcat test cases, bundle files, commands lists:"); - log_this(" xcattest [-b case bundle files] [-l]"); - log_this(" xcattest [-t cases list] [-l]"); - log_this(" xcattest [-c cmds list] [-l]"); - log_this("Show all bundle files, all commands:"); - log_this(" xcattest [-s command|bundle]"); - log_this(""); - return; + +#-------------------------------------------------------- +# Fuction name: runscript +# Description: run a script after 'cmd' label in one case +# Atrributes: +# $script_ref (input attribute) +# the reference of array where save every line of script +# Retrun code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- +sub runscript { + my $script_ref = shift; + my $time = time(); + my $tmpdir = "/tmp/xCATautotest$time/"; + my $tmpfile = "$tmpdir/script"; + my $rf; + mkpath("$tmpdir"); + open($rf, ">$tmpfile"); + foreach my $line (@$script_ref) { + $line = getfunc($line); + print $rf "$line\n"; + } + close($rf); + chmod 0755, "$tmpfile"; + my @output = runcmd("$tmpfile"); + + unlink("$tmpfile"); + rmdir("$tmpdir"); + return @output; } -sub listbundlefiles -{ - my @bundlefiles = (); - - #get all .bundle files from /opt/xcat/share/xcat/tools/autotest/bundle/ - opendir(DIR, $bundledir); - my @files = readdir(DIR); - foreach my $file (@files){ - next if (-d $file); - if ($file =~ /\.bundle$/){ - push(@bundlefiles, $file); - } - } - closedir(DIR); - - #read all .bundle files, get descriptions for each file. - my $skip =0; - my $line; - foreach my $bundlefile (@bundlefiles) { - if (!open(FILE, "<$bundledir/$bundlefile")) { - log_this("Error: Can't open bundle file: $bundlefile"); - log_this("Use 'xcattest -s bundle' to list out available bundles"); - return 1; - } - $skip = 0; - while ($line = ) { - $line = &trim($line); - next if (length($line) == 0); - - #description line is treated as a comment line for now - if ($line =~ /^description\s*:\s*(.*)/){ - if (length($1) != 0) { - $bundlefilesinfo{$bundlefile} = $1; - $skip=1; - last; - } +#-------------------------------------------------------- +# Fuction name: getnodeattr +# Description: get the value of node attribute form current environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getnodeattr { + my $node = shift; + my $attr = shift; + my $maxtry = 40; + foreach my $try (0 .. $maxtry) { + my @output = runcmd("lsdef -t node -o $node -i $attr"); + if ($::RUNCMD_RC == 0) { + foreach my $line (@output) { + if ($line =~ /$attr=(\w.+)/) { + return $1; + } } - } - close(FILE); - if (!$skip){ - $bundlefilesinfo{$bundlefile} = "No description, add with \"description: details\" in bundle file"; - } - } - &listformatbundleinfo(%bundlefilesinfo); - + } + } + return "Unknown"; +} + +#-------------------------------------------------------- +# Fuction name: get_files_recursive +# Description: Search all file in one directory recursively +# Atrributes: +# $dir (input attribute) +# The target scan directory +# $files_path_ref (output attribute) +# the reference of array where save all vaild files under $dir +# Retrun code: +#-------------------------------------------------------- +sub get_files_recursive +{ + my $dir = shift; + my $files_path_ref = shift; + + my $fd = undef; + opendir($fd, $dir); + for (; ;) + { + my $direntry = readdir($fd); + last unless (defined($direntry)); + next if ($direntry =~ m/^\.\w*/); + next if ($direntry eq '..'); + my $target = "$dir/$direntry"; + if (-d $target) { + get_files_recursive($target, $files_path_ref); + } else { + push(@{$files_path_ref}, glob("$target\n")); + } + } + closedir($fd); +} + + +#-------------------------------------------------------- +# Fuction name: is_valid_case_name +# Description: to check if a case name is valid +# Atrributes: $casename (input atrribute): the target case name +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub is_valid_case_name { + my $casename = shift; + if ($casename =~ /[^a-zA-Z0-9_-]/) { + return 0; + } else { + return 1; + } +} + +#------------------------------------------------------- +# Fuction name: get_current_os +# Description: +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub get_current_os { + if (-f "/etc/redhat-release") { + return "rhels"; + } elsif (-f "/etc/SuSE-release") { + return "sles"; + } elsif (-f "/etc/lsb-release") { + return "ubuntu"; + } else { + return "aix"; + } +} + + +#-------------------------------------------------------- +# Fuction name: generate_performance_report +# Description: +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub generate_performance_report { + my $runninglog = shift; + my $performancelog = shift; + my $error_ref = shift; + + my $performance_log_fd = undef; + + if (!open($performance_log_fd, ">$performancelog")) { + $$error_ref = "Failed to create performance log $performancelog: $!"; + return 1; + } + + print $performance_log_fd "Testcase Duration\n"; + print $performance_log_fd "------------------------------------------------------------------------------\n"; + + my @output = runcmd("cat $runninglog"); + my $cmdlineflag = 0; + my $line; + foreach my $line (@output) { + if ($line =~ /^------START:/) { + $line =~ s/------//g; + print $performance_log_fd "$line\n"; + } elsif ($line =~ /^RUN:/) { + $cmdlineflag = 1; + print $performance_log_fd "$line;\n"; + } elsif ($line =~ /^ElapsedTime:/) { + $cmdlineflag = 0; + print $performance_log_fd "$line\n"; + } elsif ($cmdlineflag) { + print $performance_log_fd "$line\n"; + } elsif ($line =~ /^------END:/) { + $line =~ s/------//g; + print $performance_log_fd "$line\n\n"; + } + } + close($performance_log_fd); return 0; } -sub listformatbundleinfo +#-------------------------------------------------------- +# Fuction name: getvar +# Description: replace specific attribute in case definition by the value set in config file +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getvar { - my $maxlen = 0; - foreach my $filename (keys %bundlefilesinfo) { - $maxlen = length($filename) if (length($filename) > $maxlen); + my $str = shift; + my $config_ref = shift; + + while ($str =~ /\$\$(\w+)/) { + my $varname = $1; + if (exists($$config_ref{var}{$varname})) { + $str =~ s/\$\$$varname/$$config_ref{var}{$varname}/g; + } else { + return "miss attribute $varname"; + } } - $maxlen += 4; + return $str; +} + +#-------------------------------------------------------- +# Fuction name: getfunc +# Description: replace specific funciton in case definition +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getfunc +{ + my $str = shift; + + while ($str =~ /__(\w+)\(([\s\,\w\$]*)\)__/) { + my $func = $1; + my $parameter = $2; + my $value = undef; + my @para = (); + + #log_this("parameter is $parameter,fun is $func"); + chomp($parameter); + @para = split /\s*,\s*/, $parameter; + if ($func eq "GETNODEATTR") { + $value = getnodeattr($para[0], $para[1]); + if ($value eq "Unknown") { + $value = ''; + } + } elsif ($func eq "INC") { + $value = $para[0] + 1; + } elsif ($func eq "GETTABLEVALUE") { + $value = gettablevalue(@para); + } + $str =~ s/__$func\($parameter\)__/$value/g; + } + return $str; +} + +#-------------------------------------------------------- +# Fuction name: gettablevalue +# Description: get specific table value from current environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub gettablevalue +{ + my ($keyname, $key, $colname, $table) = @_; + my @output = runcmd("gettab $keyname=$key $table\.$colname"); + return $output[0]; +} + +#-------------------------------------------------------- +# Fuction name: print_table +# Description: print a hash table in good format +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub print_table { + my $msg_ref = shift; my $desiredwidth = 120; my $screenwidth = (`tput cols` + 0); my $finallen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth); - print "bundle files and descriptions:\n"; - - foreach my $filename (sort { $a cmp $b } keys %bundlefilesinfo ) { - my @desc = split(" ", $bundlefilesinfo{$filename}); + my $maxkeylen = 0; + foreach my $key (keys %{$msg_ref}) { + my $keylen = length($key); + $maxkeylen = $keylen if ($keylen > $maxkeylen); + } + $maxkeylen += 4; + + foreach my $key (sort { $a cmp $b } keys %{$msg_ref}) { + my @desc = split(" ", $msg_ref->{$key}); my $str = ""; my @formatdesc = (); foreach my $word (@desc) { - if (length($str) + length($word) > $finallen - $maxlen) { + if (length($str) + length($word) > $finallen - $maxkeylen) { $str =~ s/([^\s]+)\s$/$1/g; push @formatdesc, $str; $str = ""; @@ -1150,162 +1714,16 @@ sub listformatbundleinfo $str =~ s/([^\s]+)\s$/$1/g; push @formatdesc, $str; - print "$filename"; + print color("green"), "$key", color("reset"); - my $space = " " x ($maxlen - length($filename)); + my $space = " " x ($maxkeylen - length($key)); print "$space$formatdesc[0]\n"; delete $formatdesc[0]; - $space = " " x $maxlen; + $space = " " x $maxkeylen; foreach my $line (@formatdesc) { print "$space$line\n" if (length($line)); } } -} - -sub listcommands -{ - my @files = (); - - Get_Files_Recursive("$casedir"); - for (my $countfile = 0 ; $countfile < @ filespath ; $countfile++) - { - if ($filespath[$countfile] =~ /testcase\/(.*)\/case/) { - log_this("$1"); - } - } -} - -sub getreport -{ - open(INDOC, ">$_[1]") || die("open STDOUT failed"); - print INDOC "Testcase Duration\n"; - print INDOC "------------------------------------------------------------------------------\n"; - close(INDOC); - open(STDOUT, ">>$_[1]") || die("open STDOUT failed"); - open FD, "<$_[0]" or die "$?"; - while () { - if (/Time/) { - s/------//g; - $_ .= "\n" if /END/; - print STDOUT $_; - } - } - - close(FD); - close(STDOUT); -} - - -sub reordercases -{ - my @caserange = (); - my $line; - if ($bundlelist) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles) { - if (!open(FILE, "<$bundledir/$bundle")){ - log_this("Error: Can't open bundle file: $bundle"); - return 1; - } - while ($line = ) { - chomp($line); - next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); - push(@caserange, $line); - } - close(FILE); - my @refs=sort_caserange(@caserange); - @caserange=@{$refs[0]}; - } - } - if ($caselist) { - @caserange = split /,/, $caselist; - } - - my @tmpcases = (); - foreach my $case (@caserange) { - my $i = 0; - my $hit = 0; - foreach my $runcase (@cases) { - if ($runcase->{name} eq $case) { - $hit = 1; - last; - } - $i++; - next; - } - push(@tmpcases, $cases[$i]) if ($hit); - } - @cases = @tmpcases; -} - -sub checkoptions -{ - #-b,-c,-t,-s should be defined at least one - if (!defined($bundlelist) && !defined($caselist) && !defined($cmdlist) && !defined($showbundlesorcommands)) { - log_this("Error: please define options correctly, see below usage information:"); - return 1; - }elsif ((defined($bundlelist) || defined($caselist) || defined($cmdlist)) && (! $needshow) && !defined($configinfo)) { - #config file must be defined if the using -c,-b,-t to run test cases - log_this("Error: To run test cases, please define the config file with -f option"); - log_this(" To show test cases, please use the -l option"); - return 1; - }elsif (defined($showbundlesorcommands) && (defined($bundlelist) || defined($caselist) || defined($cmdlist))) { - #-s can't be used together with -c,-b,-t - log_this("Error: -b,-c or -t can't be used together with -s"); - return 1; - }elsif (defined($showbundlesorcommands) && $needshow) { - log_this("Error: -s, -l can't be used together"); - return 1; - } - - #check the -s option, the value should be bundle or command - if (defined($showbundlesorcommands)) { - if (($showbundlesorcommands ne "bundle") && ($showbundlesorcommands ne "command")) { - log_this("Error: please use \"bundle\" or \"command\" as the \-s value"); - return 1; - }elsif ($showbundlesorcommands eq "bundle") { - $showbundlefiles = 1; - }else { - } - $showcommandslist= 1; - } - - #get and check config file and System label - #this System label means only the [System] variable will be loaded - if (defined($configinfo)) { - if ($configinfo =~ /(.*):(.*)/) { - $configfile = $1; - $initallabel = $2; - if ($initallabel ne $loadsysteminfo) { - log_this("Error: $initallabel is not supported!"); - return 1; - } - }else { - $configfile = $configinfo; - } - if (!(-e $configfile)) { - log_this("Error: Can't open config file: $configfile"); - return 1; - } - } - - #check bundle files - if (defined($bundlelist)) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles){ - if ("$bundledir/$bundle" !~ /\.bundle$/) { - log_this("Error: please input the .bundle file"); - log_this("Use 'xcattest -s bundle' to list all bundle files"); - return 1; - } - if (!(-e "$bundledir/$bundle")) { - log_this("Error: Can't open bundle file: $bundle"); - log_this("Use 'xcattest -s bundle' to list all bundle files"); - return 1; - } - } - } - return 0; } diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 51631a977..fd53c5dc9 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -6,6 +6,7 @@ if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then str_dir_name=`dirname $0` . $str_dir_name/xcatlib.sh + . $str_dir_name/nicutils.sh fi function configipv4(){ @@ -354,16 +355,16 @@ fi logger -t xcat -p local4.err "configeth: os type: $str_os_type" -echo "configeth on $NODE: os type: $str_os_type" +log_info "configeth on $NODE: os type: $str_os_type" if [ "$1" = "-r" ];then if [ $# -ne 2 ];then logger -t xcat -p local4.err "configeth: remove nic, but the nic name is missed" - echo "configeth on $NODE: remove nic, but the nic name is missed" + log_error "configeth on $NODE: remove nic, but the nic name is missed" exit 1 fi str_nic_name=$2 logger -t xcat -p local4.err "configeth: remove nic $str_nic_name" - echo "configeth on $NODE: remove nic $str_nic_name" + log_info "configeth on $NODE: remove nic $str_nic_name" if [ "$str_os_type" = "aix" ];then old_ifs=$IFS @@ -392,7 +393,7 @@ if [ "$1" = "-r" ];then fi done logger -t xcat -p local4.err "configeth run command: chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down" - echo "configeth on $NODE run command: chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down" + log_info "configeth on $NODE run command: chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down" chdev -l $str_nic_name -a netaddr='' -a netmask='' -a netaddr6='' -a prefixlen='' -a state=down else #shut down the nic if it is on @@ -412,7 +413,7 @@ if [ "$1" = "-r" ];then elif [ "$1" = "-s" ];then if [ $# -lt 2 ];then logger -t xcat -p local4.err "configeth: config install nic, but the nic name is missed" - echo "configeth on $NODE: config install nic, but the nic name is missed" + log_error "configeth on $NODE: config install nic, but the nic name is missed" exit 1 fi str_inst_nic=$2 @@ -423,8 +424,8 @@ elif [ "$1" = "-s" ];then if [ "$str_os_type" = "aix" ];then logger -t xcat -p local4.err "configeth: aix does not support -s flag" - echo "configeth on $NODE: aix does not support -s flag" - exit 0 + log_error "configeth on $NODE: aix does not support -s flag" + exit 1 elif [ -f "/etc/debian_version" ];then str_lease_file="/var/lib/dhcp/dhclient."$str_inst_nic".leases" if [ -e "$str_lease_file" ];then @@ -502,7 +503,7 @@ elif [ "$1" = "-s" ];then if [ -z "$str_inst_ip" -o -z "$str_inst_mask" ];then logger -t xcat -p local4.err "configeth: config install nic, can not find the information from lease file, return." - echo "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." + log_info "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." exit 0 fi @@ -648,7 +649,7 @@ fi #3. on linux modify the configuration files if [ $# -ne 3 ];then logger -t xcat -p local4.err "configeth: paramters error currently is $@" - echo "configeth on $NODE: paramters error currently is $@" + log_error "configeth on $NODE: paramters error currently is $@" exit 1 fi str_nic_name=$1 @@ -706,7 +707,7 @@ while [ $num_index -le $NETWORKS_LINES ];do done logger -t xcat -p local4.err "configeth: new configuration" -echo "configeth on $NODE: new configuration" +log_info "configeth on $NODE: new configuration" num_index=0 str_ipv6_gateway='' while [ $num_index -lt ${#array_nic_ips[*]} ];do @@ -715,7 +716,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do str_netname=${array_nic_networks[$num_index]} if [ ! $str_netname ];then logger -t xcat -p local4.err "configeth: Network name is not defined on $str_nic_name for $str_ip." - echo "configeth on $NODE: Network name is not defined on $str_nic_name for $str_ip." + log_error "configeth on $NODE: Network name is not defined on $str_nic_name for $str_ip." num_index=$((num_index+1)) continue fi @@ -724,7 +725,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do str_line=${array_nic_network_config[$num_index]} if [ ! $str_line ];then logger -t xcat -p local4.err "configeth: Network object $str_netname is not defined." - echo "configeth on $NODE: Network object $str_netname is not defined." + log_error "configeth on $NODE: Network object $str_netname is not defined." num_index=$((num_index+1)) continue fi @@ -737,7 +738,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do if [ ! $str_subnet -o ! $str_netmask ];then logger -t xcat -p local4.err "configeth: subnet or netmask is not defined in network object $str_netname." - echo "configeth on $NODE: subnet or netmask is not defined in network object $str_netname." + log_error "configeth on $NODE: subnet or netmask is not defined in network object $str_netname." num_index=$((num_index+1)) continue fi @@ -768,7 +769,7 @@ while [ $num_index -lt ${#array_nic_ips[*]} ];do str_ip_mask_pair=$str_ip_mask_pair"${str_ip}_${str_netmask} " else logger -t xcat -p local4.err "configeth: the ipaddress( $str_ip ) for $str_nic_name is invalid." - echo "configeth on $NODE: the ipaddress( $str_ip ) for $str_nic_name is invalid." + log_error "configeth on $NODE: the ipaddress( $str_ip ) for $str_nic_name is invalid." fi num_index=$((num_index+1)) done @@ -788,7 +789,7 @@ if [ "$str_os_type" = "aix" ];then else chdev -l $str_nic_name -a netaddr='' -a netmask='' logger -t xcat -p local4.err "configeth: delete undefined ip address $str_old_ip" - echo "configeth on $NODE: delete undefined ip address $str_old_ip" + log_error "configeth on $NODE: delete undefined ip address $str_old_ip" fi fi @@ -856,7 +857,7 @@ if [ "$str_os_type" = "aix" ];then str_ip_status=$(hashget hash_new_config $str_new_ip) if [ "$str_ip_status" = "new" ];then logger -t xcat -p local4.err "configeth: add $str_new_ip for $str_nic_name temporary." - echo "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." + log_info "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." add_ip_temporary $str_new_ip $str_nic_name fi done @@ -891,7 +892,7 @@ else else bool_modify_flag=1 logger -t xcat -p local4.err "configeth: delete $str_old_ip for $str_nic_name temporary." - echo "configeth on $NODE: delete $str_old_ip for $str_nic_name temporary." + log_info "configeth on $NODE: delete $str_old_ip for $str_nic_name temporary." str_old_ip=`echo $str_old_ip | tr '_' '/'` ip addr del $str_old_ip dev $str_nic_name fi @@ -929,7 +930,7 @@ else bool_modify_flag=1 if [ $bool_restart_flag -eq 0 ];then logger -t xcat -p local4.err "configeth: add $str_new_ip for $str_nic_name temporary." - echo "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." + log_info "configeth on $NODE: add $str_new_ip for $str_nic_name temporary." add_ip_temporary $str_new_ip $str_nic_name fi fi @@ -940,7 +941,7 @@ else ip -6 route | grep default | grep $str_ipv6_gateway if [ $? -ne 0 ];then logger -t xcat -p local4.err "configeth: the default ipv6 route changes to $str_ipv6_gateway." - echo "configeth on $NODE: the default ipv6 route changes to $str_ipv6_gateway." + log_info "configeth on $NODE: the default ipv6 route changes to $str_ipv6_gateway." ip -6 route del default ip -6 route add default $str_ipv6_gateway dev $str_dev_name fi @@ -963,7 +964,7 @@ else done fi logger -t xcat -p local4.err "configeth: $str_nic_name changed, modify the configuration files" - echo "configeth on $NODE: $str_nic_name changed, modify the configuration files" + log_info "configeth on $NODE: $str_nic_name changed, modify the configuration files" num_ipv4_index=0 num_ipv6_index=0 num_index=0 @@ -1020,7 +1021,7 @@ else done else logger -t xcat -p local4.err "configeth: $str_nic_name no changed, return directly." - echo "configeth on $NODE: $str_nic_name no changed, return directly." + log_warn "configeth on $NODE: $str_nic_name no changed, return directly." fi #restart the nic diff --git a/xCAT/postscripts/configinterface b/xCAT/postscripts/configinterface index 40deeb269..53d9c720a 100755 --- a/xCAT/postscripts/configinterface +++ b/xCAT/postscripts/configinterface @@ -9,6 +9,11 @@ fi xcat_intf="/etc/network/interfaces.d/xCAT.intf" +if [ -f $xcat_intf ] && grep -w '#This is sample interface file provided by xCAT' $xcat_intf ; then + echo "The switch data ports and default brige have been configured. Do nothing..." + exit 0 +fi + echo "#This is sample interface file provided by xCAT" > $xcat_intf echo "# bridge-vlan-aware: set to yes to indicate that the bridge is VLAN-aware. " >> $xcat_intf echo "# bridge-access: declares the access port. " >> $xcat_intf diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 702fd5b2d..bb0a90cec 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -1,12 +1,16 @@ -#!/bin/bash +#!/bin/bash #------------------------------------------------------------------------------- # confignetwork -# Used on Redhat only. Configure bond/vlan/linux bridge/ on the nodes +# Configure Ethernet nic/bond/vlan/bridge/ on the nodes +# Configure Ethernet nic support redhat sles and ubuntu OS, confignetwork use configeth to realize this work. +# Configure bond/vlan/bridge support redhat only. # # You can configure nicdevices,nictypes,nicips,nicnetworks in nics table -# Then you can run the following commands on MN: +# 1. If you want to configure install nic and other nics, you can run the following command on MN: +# updatenode noderange "confignetwork -s" +# 2. If you want to configure nics except install nic, you can run the following command on MN: # updatenode noderange confignetwork -# confignetwork can be used in postscript too. +# 3. confignetwork can be used in postscripts or postbootscripts too. # ############################################################################ @@ -18,13 +22,12 @@ if [ x"$str_os_type" = "xLinux" ];then . $str_dir_name/nicutils.sh else log_error "Does NOT support non-Linux Operating System." - exit -1 + exit 1 fi - ###################################################################### # -# OS support +# OS support checking # Check OS version and get the directory of network configuration file # ##################################################################### @@ -39,18 +42,78 @@ if [ -f "/etc/redhat-release" ];then elif [ -f "/etc/SuSE-release" -o -n "$str_temp" ];then is_sles=1 nwdir="/etc/sysconfig/network" - log_error "Only supports RHEL" - exit -1 elif [ -f "/etc/debian_version" ];then nwdir="/etc/network/interfaces.d" is_debian=1 - log_error "Only supports RHEL" - exit -1 else - log_error "Only supports RHEL" - exit -1 + log_error "Only supports Linux" + exit 1 fi +###################################################################### +# +# get network configuration file content +# +#################################################################### +function get_nic_cfg_file_content { + cfg_dev=$1 + cfg_file='' + if [ $is_redhat -eq 1 ] || [ $is_sles -eq 1 ]; then + cfg_file="$nwdir/ifcfg-${cfg_dev}" + elif [ $is_debian -eq 1 ]; then + cfg_file="$nwdir/${cfg_dev}" + fi + + if [ -f $cfg_file ]; then + echo "['${cfg_file}']" >&2 + cat ${cfg_file}| $sed -e 's/^/ >> /g' | log_lines info + else + log_error "Can not find $cfg_file." + errorcode=1 + fi +} + +###################################################################### +# +# Parser input arguments +# +##################################################################### +boot_install_nic=0 +for arg in "$@" +do + if [ "$arg" = "-s" ];then + boot_install_nic=1 + fi + #TODO: IB support is TBD +done +if [ "$SETINSTALLNIC" = "1" ] || [ "$SETINSTALLNIC" = "yes" ]; then + bool_install_nic=1 +fi + +###################################################################### +# +# Preparation for installnic +# +##################################################################### +function get_installnic { + + tmp_installnic="mac" + [ $INSTALLNIC ] && tmp_installnic=$INSTALLNIC + + instnic='' + if [ "$tmp_installnic" = "mac" ];then + if [ -n "$MACADDRESS" ]; then + instnic=`ip -o link | grep -i "$MACADDRESS" | awk '{print $2;}' | sed s/://` + else + errorcode=1 + fi + elif [ `echo $tmp_installnic | grep -E "e(n|th|m)[0-9a-zA-Z]+"` ];then + instnic=$tmp_installnic + else + errorcode=1 + fi + echo $instnic +} ####################################################################################### # @@ -120,6 +183,19 @@ function find_nic_type { echo $(hashget "nictypes" $nic) } +################################################################ +# +# find nic custom scripts +# +# input : nic +# +# output : niccustomscripts from nics table +# +############################################################### +function find_nic_custom_scripts { + [ $1 ] && echo $(hashget "niccustomscripts" "$1") +} + ################################################################ # @@ -215,93 +291,112 @@ function find_nic_and_device_list { # ############################################################################### function sort_nics_device_order { + all_nics_list=$* eth_slot="" bond_slot="" vlan_slot="" num=1 - alone_nics=`echo "$all_nics_list"|awk '{if(01) print $0}'` - + #find stand alone nic num1=1 max1=`echo "$alone_nics"|wc -l` ((max1+=1)) while [ $num1 -lt $max1 ]; do - alonenic=`echo "$alone_nics"|sed -n "${num1}p"` + alonenic=`echo "$alone_nics"|sed -n "${num1}p"|sed "s/ //g"` + #make sure alonenic does not have base device echo "$nics_list"| grep "$alonenic" >/dev/null if [ $? -ne 0 ]; then - echo $alonenic + #pre-check nicips nictype nicnetworks for alone nic + #nicips nictype and nicnetworks should be configured in nics table for alone nic + alonenicips=`find_nic_ips $alonenic` + alonenictype=`find_nic_type $alonenic` + alonenicnetwork=`query_nicnetworks_net $alonenic` + if [ -n "$alonenicips" ] && [ -n "$alonenictype" ] && [ -n "$alonenicnetwork" ]; then + #if alone nic configure nicips, it is valid + echo $alonenic + else + errorcode=1 + echo "Error: nicips,nictype and nicnetwork should be configured in nics table for $alonenic." + ((num1+=1)) + continue + fi fi ((num1+=1)) done + + if [ -n "$nics_list" ]; then + if [ $is_redhat -eq 1 ]; then + num=1 + max=`echo "$nics_list"|wc -l` + ((max+=1)) + while [ $num -lt $max ]; + do + #for each nic and nicdevice : nic_dev base_nic_dev + #find nic type as nic_dev_type + #find nicdevice type as base_nic_type + base_nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $2}'` + if echo "$base_nic_dev"|grep "@" >/dev/null; then + for i in `echo "$base_nic_dev" |sed 's/@/ /g'` + do + temp_base_nic_type=`find_nic_type "$i" | $utolcmd` + if [ x"$temp_base_nic_type_one" = x ]; then + temp_base_nic_type_one=$temp_base_nic_type + elif [ x"$temp_base_nic_type" != x"$temp_base_nic_type_one" ]; then + log_error "different nic device types in $base_nic_dev." + break 2 + fi + done + else + temp_base_nic_dev=$base_nic_dev + temp_base_nic_type=`find_nic_type "$temp_base_nic_dev" | $utolcmd` + fi - # - num=1 - max=`echo "$nics_list"|wc -l` - ((max+=1)) - while [ $num -lt $max ]; - do - #for each nic and nicdevice : nic_dev base_nic_dev - #find nic type as nic_dev_type - #find nicdevice type as base_nic_type - base_nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $2}'` - if echo "$base_nic_dev"|grep "@" >/dev/null; then - for i in `echo "$base_nic_dev" |sed 's/@/ /g'` - do - temp_base_nic_type=`find_nic_type "$i"` - if [ x"$temp_base_nic_type_one" = x ]; then - temp_base_nic_type_one=$temp_base_nic_type - elif [ x"$temp_base_nic_type" != x"$temp_base_nic_type_one" ]; then - log_error "different nic device types in $base_nic_dev." - break 2 - fi - done - else - temp_base_nic_dev=$base_nic_dev - temp_base_nic_type=`find_nic_type "$temp_base_nic_dev"` - fi + base_nic_type=$temp_base_nic_type + nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $1}'` + nic_dev_type=`find_nic_type "$nic_dev" | $utolcmd` - base_nic_type=$temp_base_nic_type - nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $1}'` - nic_dev_type=`find_nic_type "$nic_dev"` - - #valid nic_dev and base_nic_dev pair as bond-ethernet or vlan-ethernet or bridge-ethernet - if [ x"$base_nic_type" = "xethernet" ]&& \ - [ x"$nic_dev_type" = "xbond" -o x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + #valid nic_dev and base_nic_dev pair as bond-ethernet or vlan-ethernet or bridge-ethernet + if [ x"$base_nic_type" = "xethernet" ]&& \ + [ x"$nic_dev_type" = "xbond" -o x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - if [ x"$eth_slot" = x ]; then - eth_slot=$num + if [ x"$eth_slot" = x ]; then + eth_slot=$num + else + eth_slot=$eth_slot" "$num + fi + + #valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond + elif [ x"$base_nic_type" = "xbond" ]&& \ + [ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + + if [ x"$bond_slot" = x ]; then + bond_slot=$num + else + bond_slot=$bond_slot" "$num + fi + + #valid nic_dev and base_nic_dev pair as bridge-vlan + elif [ x"$base_nic_type" = "xvlan" ]&& \ + [ x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + + if [ x"$vlan_slot" = x ]; then + vlan_slot=$num + else + vlan_slot=$vlan_slot" "$num + fi else - eth_slot=$eth_slot" "$num + echo "Error: $nic_dev $base_nic_dev pair is invalid nic and nicdevice pair." fi - - #valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond - elif [ x"$base_nic_type" = "xbond" ]&& \ - [ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - - if [ x"$bond_slot" = x ]; then - bond_slot=$num - else - bond_slot=$bond_slot" "$num - fi - - #valid nic_dev and base_nic_dev pair as bridge-vlan - elif [ x"$base_nic_type" = "xvlan" ]&& \ - [ x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - - if [ x"$vlan_slot" = x ]; then - vlan_slot=$num - else - vlan_slot=$vlan_slot" "$num - fi - else - log_error "Error: $nic_dev $base_nic_dev pair is invalid nic and nicdevice pair." - fi - ((num+=1)) - done + ((num+=1)) + done + else + log_error "Error: only support configure bond/vlan/bridge on redhat." + fi + fi new_order=$eth_slot" "$bond_slot" "$vlan_slot new_order_list="" if [ -n "$new_order" ]; then @@ -312,7 +407,6 @@ function sort_nics_device_order { echo "$nics_list" |sed -n "${i}p" done` fi - echo "$new_order_list" } @@ -326,18 +420,46 @@ function sort_nics_device_order { ################################################################################### function configure_nicdevice { nics_pair=$* - #nictypes support capital letters, for example, Ethernet and ethernet - #use $utolcmd to transform capital to lower case - utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" #configure nic and its device pair one by one num=1 max=`echo "$nics_pair"|wc -l` base_temp_nic="" base_nic_for_bond="" line_num="" + noip=1 ((max+=1)) while [ $num -lt $max ]; do + nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` + #If install nic is configured, skip to reconfigure it + if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 ]; then + log_warn "install nic $nic_dev has been configured, skip to reconfigure it." + ((num+=1)) + continue + fi + #processing custom scripts for nic + customcmd=`find_nic_custom_scripts $nic_dev` + customscript=`echo $customcmd|awk '{print $1}'` + if [ -n "$customscript" ]; then + if [ -f "/install/postscript/$customscript" ]; then + #if there is no custom script in /install/postscript,exit this loop + log_error "/install/postscript/$customscript does not exist." + errorcode=1 + ((num+=1)) + continue + fi + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + log_info "processing custom scripts:\"$customcmd\" for interface $nic_dev" + $customcmd + if [ $? -ne 0 ]; then + errorcode=1 + fi + + #if custom script is finished, go to configure next nic/nic_pair + ((num+=1)) + continue + fi + #get base nic and its type base_nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $2}'` if [ -n "$base_nic_dev" ]; then if echo "$base_nic_dev"|grep "@" >/dev/null; then @@ -349,7 +471,6 @@ function configure_nicdevice { base_nic_type=`find_nic_type "$base_temp_nic" | $utolcmd` fi - nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` nic_dev_type=`find_nic_type "$nic_dev" | $utolcmd` echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` @@ -357,19 +478,30 @@ function configure_nicdevice { #configure standalone ethernet nic if [ x"$nic_dev_type" = "xethernet" ]; then - - ipaddr=`find_nic_ips $nic_dev|awk -F"|" '{print $1}'` - if [ -n "$ipaddr" ]; then - create_ethernet_interface ifname=$nic_dev _ipaddr=$ipaddr + xcatnet=`query_nicnetworks_net $nic_dev` + ipaddrs=`find_nic_ips $nic_dev` + if [ -n "$ipaddrs" ]; then + log_info "configure $nic_dev" + log_info "call: configeth $nic_dev $ipaddrs $xcatnet" + configeth $nic_dev $ipaddrs $xcatnet + if [ $? -ne 0 ]; then + errorcode=1 + fi + get_nic_cfg_file_content $nic_dev else - log_error "There is no ip for $nic_dev." + log_warn "There is no ip for $nic_dev." + ((noip+=1)) fi + #All Ethernet nics have no nicips + if [ $noip -eq $max ]; then + log_error "There is no any ip configured for any nic. Check nicips in nics table first." + errorcode=1 + fi #configure bridge #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type #configure vlan @@ -386,12 +518,16 @@ function configure_nicdevice { #configure bond elif [ x"$nic_dev_type" = "xbond" ]; then create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond + elif [ x"$nic_dev_type" = "xinfiniband" ]; then + log_error "confignetwork does not support configure IB. " else log_error "Error : please check nictypes for $nic_pair." + errorcode=1 fi ((num+=1)) done + return $errorcode } ############################################################################ @@ -420,6 +556,31 @@ function enable_network_service { # ############################################################################ +errorcode=0 +#nictypes should support capital letters, for example, Ethernet and ethernet +utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" + +#get for installnic +installnic='' +installnic=`get_installnic` +instnic_conf=0 +if [ $boot_install_nic -eq 1 ];then + if [ -n "$installnic" ]; then + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + log_info "configure the install nic $installnic. " + instnic_conf=1 + configeth -s $installnic |log_lines info + if [ $? -ne 0 ]; then + errorcode=1 + fi + get_nic_cfg_file_content $installnic + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + else + log_error "Can not determine proper install nic." + errorcode=1 + fi +fi + #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` @@ -432,6 +593,8 @@ parser_nic_attribute "$NICTYPES" "nictypes" #make hash for nicips parser_nic_attribute "$NICIPS" "nicips" +#make hash for niccustomscripts +parser_nic_attribute "$NICCUSTOMSCRIPTS" "niccustomscripts" #get nic and its device pair, for example #eth0.6 eth0 @@ -441,18 +604,28 @@ parser_nic_attribute "$NICIPS" "nicips" new_nicdevice=`find_nic_and_device_list $str_all_nics|sort -g -k1 -g -k2|uniq` if [ -z "$new_nicdevice" ]; then log_info "There is no nic device to configure." - exit + exit $errorcode fi -#enable network service -enable_network_service - #sort nics device pair based on nicdevice type sorted_nicdevice_list=`sort_nics_device_order "$new_nicdevice"` -log_info "All valid nics and device list:" -echo "$sorted_nicdevice_list" |log_lines info +#If there is invalid nics pair, errorcode is 1 +invalid_nicdevice_pair=`echo "$sorted_nicdevice_list" | grep "Error"` +if [ $? -eq 0 ]; then + echo "$invalid_nicdevice_pair"|log_lines error + errorcode=1 +fi +#delete invalid nics device pair based on Error +valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d'` +if [ -n "$valid_sorted_nicdevice_list" ]; then + log_info "All valid nics and device list:" + echo "$valid_sorted_nicdevice_list" |log_lines info +fi +#enable network service +enable_network_service #config nics and ifcfg files -configure_nicdevice "$sorted_nicdevice_list" +configure_nicdevice "$valid_sorted_nicdevice_list" +exit $errorcode diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp new file mode 100755 index 000000000..d1403edeb --- /dev/null +++ b/xCAT/postscripts/cumulusztp @@ -0,0 +1,153 @@ +#!/bin/bash +#this script will be invoked by ZTP(zero touch provision) process in the onie switch +#this script finish the discovery and configuration after the switch is pluged in the cluster and powered on + +function error() { + echo -e "\e[0;33mERROR: The Zero Touch Provisioning script failed while running the command $BASH_COMMAND at line $BASH_LINENO.\e[0m" >&2 + exit 1 +} + +# Log all output from this script +exec >/var/log/autoprovision 2>&1 + +#trap error ERR + +#Add Debian Repositories +#since in most cases, the switch has no internet access, skip this step +#echo "deb http://http.us.debian.org/debian jessie main" >> /etc/apt/sources.list +#echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list + +#get ip address for server node +server_ip=`grep cumulus-provision-url /var/lib/dhcp/dhclient.eth0.leases | tail -1 | awk -F/ '{print $3}'` + +#download /install/postscripts from MN +max_retries=5 +retry=0 +rc=1 # this is a fail return +downloaded=0 +while [ 0 -eq 0 ]; do + + if [ -e "/xcatpost" ]; then + rm -rf "/xcatpost" + fi + + export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server_ip/install/postscripts/ -P /xcatpost 2> /tmp/wget.log + rc=$? + if [ $rc -eq 0 ]; then + # return from wget was 0 but some OS do not return errors, so we + # have additional checks for + # failed: Connection httpd not running + # 404: Not Found - if directory does not exist + grep -i -E "... failed: Connection refused.$" /tmp/wget.log + rc1=$? + grep -i -E "ERROR 404: Not Found.$" /tmp/wget.log + rc2=$? + # check to see no errors at all, grep returns 1 + if [ $rc1 -eq 1 ] && [ $rc2 -eq 1 ]; then + logger -s -t "xcat.cumulusztp" -p local4.info "download_postscripts return successfully " + downloaded=1 + break + fi + fi + + retry=$(($retry+1)) + logger -s -t "xcat.cumulusztp" -p local4.info "download_postscripts retry $retry" + if [ $retry -eq $max_retries ]; then + + break + fi + + SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*20)}') + sleep $SLI +done + +if [ "$downloaded" = "0" ];then + logger -s -t "xcat.cumulusztp" -p local4.err "download_postscripts failed" + ztp -R + exit 1 +fi + +chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` + +cd /xcatpost +rc=0 + +./documulusdiscovery +rc=$? +if [ "$rc" != "0" ];then + ztp -R + exit 1 +fi + +logger -s -t "xcat.cumulusztp" -p local4.info "switch discovered!" + +#restart mgt interface to apply the specified IP address +ifdown eth0;ifup eth0 + +retry=0 +while true; do + #check whether the network access between MN/CN and the node is ready + ping $server_ip -c 1 >/dev/null && break + retry=$[ $retry + 1 ] + if [ $retry -eq 90 ];then + #timeout, complain and exit + logger -s -t "xcat.cumulusztp" -p local4.err " the network between the node and $server_ip is not ready, please check[retry=$retry]..." "/var/log/xcat/xcat.log" + ztp -R + exit 1 + fi + + #sleep sometime before the next scan + sleep 2 +done + +#push root ssh keys, config passwordless +mkdir -p /root/.ssh +mv _ssh/authorized_keys /root/.ssh/authorized_keys + +#enable and config snmpd +./enablesnmp +rc=$? +if [ "$rc" != "0" ];then + logger -s -t "xcat.cumulusztp" -p local4.err "enablesnmp: failed to enable SNMP" + echo "enablesnmp: failed to enable SNMP" +else + logger -s -t "xcat.cumulusztp" -p local4.info "SNMP enabled!" +fi + +#config base interface +./configinterface +rc=$? +if [ "$rc" != "0" ];then + echo "configinterface: failed to config switch data ports" +else + logger -s -t "xcat.cumulusztp" -p local4.info "data ports enabled!" +fi + +#obtain myposctscript from MN +./getmypostscript.cumulus $server_ip:3001 +rc=$? +if [ "$rc" != "0" ]; then + logger -s -t "xcat.cumulusztp" -p local4.info "failed to get mypostscript" + echo "failed to get mypostscript" + ztp -R + exit 1 +fi + +#config static ip address for mgt interface +echo './confignics -s' >> ./mypostscript +chmod +x ./mypostscript +./mypostscript +rc=$? +if [ "$rc" != "0" ]; then + logger -s -t "xcat.cumulusztp" -p local4.info "failed to set static ip address for mgt interface" + echo "failed to set static ip address for mgt interface" + ztp -R + exit 1 +fi + + +#report status +echo "installstatus configured" | socat STDIN TCP:$server_ip:3002,sourceport=301,reuseaddr,retry=5 + +# CUMULUS-AUTOPROVISIONING +exit 0 diff --git a/xCAT/postscripts/documulusdiscovery b/xCAT/postscripts/documulusdiscovery new file mode 100755 index 000000000..a6f8bae60 --- /dev/null +++ b/xCAT/postscripts/documulusdiscovery @@ -0,0 +1,132 @@ +#!/bin/bash +#this script grabs the switch information, then composes a "findme" request and sends it to MN +#so that the switch can be discovered + +# TODO: Figure out the master based on the DHCP packet +XCATMASTER=$(cat /var/lib/dhcp/dhclient.eth0.leases |grep cumulus-provision-url|tail -1|awk -F/ '{print $3}') +XCATPORT=3001 +log_label="xcat.documulusdiscovery" + +#helper script for socat, write the received message to /tmp/helper.socat.sh +cat > /tmp/helper.socat.sh << 'EOF' +read strin +echo $strin > /tmp/result.socat.out +EOF + +[ -f "/tmp/helper.socat.sh" ] && chmod 777 /tmp/helper.socat.sh + +#listen to the 3001 port for any response from xcatd on MN +#the message in the response will be written to /tmp/result.socat.out +socat TCP4-LISTEN:3001,reuseaddr EXEC:"/tmp/helper.socat.sh" & + +#generate key pairs for the SSL connection between switch and xcatd on MN +mkdir -p /etc/xcat +mkdir -p /etc/pki/tls + +if [ ! -f /etc/xcat/privkey.pem ]; then +echo "[ req ] +distinguished_name = nodedn + +[ nodedn ]" > /etc/pki/tls/openssl.cnf + logger -s -t $log_label -p local4.info "Generating private key..." + openssl genrsa -out /etc/xcat/privkey.pem 1024 >& /dev/null + logger -s -t $log_label -p local4.info "Done" +fi + +PUBKEY=`openssl rsa -in /etc/xcat/privkey.pem -pubout 2> /dev/null|grep -v "PUBLIC KEY"` +PUBKEY=`echo $PUBKEY|sed -e 's/ //g'` +export PUBKEY + +logger -s -t $log_label -p local4.info "Beginning switch discovery process..." + +#grab the switch information +dmidweinfo=$(/usr/sbin/dmidecode 2>/dev/null) +PRODUCTNAME=$(echo "$dmidweinfo"|grep "Product Name"|cut -d: -f2|sed -e 's/^\s*//' -e 's/\s*$//') +MTM=$PRODUCTNAME +ARCH=$(uname -m) +SERIAL=$(echo "$dmidweinfo"|grep "Serial Number"|cut -d: -f2|sed -e 's/^\s*//' -e 's/\s*$//') + +#compose the findme request +echo '' > /tmp/discopacket +echo "findme" >> /tmp/discopacket +echo "1" >> /tmp/discopacket +echo "switch" >> /tmp/discopacket +echo "$ARCH" >> /tmp/discopacket +#echo "$MTM" >> /tmp/discopacket +echo "$MTM" >> /tmp/discopacket +echo "$SERIAL" >> /tmp/discopacket + +MAC_OF_FIRST_UP_NIC=$(ip addr show eth0|grep "link/ether"|awk -F' ' '{print $2}') +MAC=$MAC_OF_FIRST_UP_NIC +ADDRESS=$(ip address show dev eth0|grep "inet "|grep global|awk '{print $2}') +DRIVER=$(grep DRIVER /sys/class/net/eth0/device/uevent|awk -F= '{print $2}') +echo "$DRIVER|eth0|$MAC|$ADDRESS" >> /tmp/discopacket + +UUID=`echo $MTM-$SERIAL-$MAC_OF_FIRST_UP_NIC| tr /A-Z/ /a-z/` +echo "$UUID" >> /tmp/discopacket + +echo "$PUBKEY" >> /tmp/discopacket +echo "" >> /tmp/discopacket +echo "" >> /tmp/discopacket +echo "" >> /tmp/discopacket +openssl dgst -sha512 -out /tmp/discopacket.sha512 -sign /etc/xcat/privkey.pem /tmp/discopacket +openssl enc -e -a -in /tmp/discopacket.sha512 > /tmp/discopacket.b64sig +cat /tmp/discopacket |while read line; do + if [ "$line" = "" ]; then + cat /tmp/discopacket.b64sig >> /tmp/discopacket.new + fi + echo $line >> /tmp/discopacket.new +done +mv /tmp/discopacket.new /tmp/discopacket +logger -s -t $log_label -p local4.info "Discovery packet file is ready." +rm -f /tmp/discopacket.gz +gzip -9 /tmp/discopacket + + + +if [ -z "$XCATMASTER" ] || [ -z "$XCATPORT" ]; then + logger -s -t $log_label -p local4.err "Failed to get xcatd connection information, exit..." + rm -rf /tmp/result.socat.out + rm -rf /tmp/helper.socat.sh + exit 1 +fi + + +#send the find me request ot xcatd on MN +MAX_RETRY=10 +RETRY=0 +DISCOVERED=0 + +while [ $RETRY -lt $MAX_RETRY ]; do + logger -s -t $log_label -p local4.info "Sending the discovery packet to xCAT ($XCATMASTER:$XCATPORT) [ RETRY= $RETRY ] ..." + (cat /tmp/discopacket.gz | socat STDIN UDP:$XCATMASTER:$XCATPORT,sourceport=301 ) & + + WAITRETRY=0 + while [ $WAITRETRY -lt 100 ]; do + if [ -f "/tmp/result.socat.out" ] && grep "restart" /tmp/result.socat.out; then + DISCOVERED=1 + break; + fi + sleep 1 + ((WAITRETRY=WAITRETRY+1)) + done + + if [ "$DISCOVERED" = "1" ]; then + break + fi + + sleep 2 + ((RETRY=RETRY+1)) +done + +rm -rf /tmp/result.socat.out +rm -rf /tmp/helper.socat.sh + +if [ "$DISCOVERED" = "0" ] ; then + logger -s -t $log_label -p local4.info "Failed to discover me, exit..." + exit 1 +elif [ "$DISCOVERED" = "1" ]; then + echo "installstatus discovered" | socat STDIN TCP:$XCATMASTER:3002,sourceport=301,reuseaddr,retry=5 +fi + +exit 0 diff --git a/xCAT/postscripts/enablesnmp b/xCAT/postscripts/enablesnmp index 2d4f2fd96..6f5661346 100755 --- a/xCAT/postscripts/enablesnmp +++ b/xCAT/postscripts/enablesnmp @@ -6,7 +6,12 @@ if ! cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2 echo "This script is only supported on Cumulus OS in ONIE switch" exit 2 fi + snmp_conf="/etc/snmp/snmpd.conf" +if [ -f "$snmp_conf" ] && grep -w '#xCAT customized snmpd configuration' $snmp_conf;then + echo "The snmp has already been configured. Do nothing..." + exit 0 +fi [ -f "$snmp_conf" ] || exit -1 diff --git a/xCAT/postscripts/getmypostscript.cumulus b/xCAT/postscripts/getmypostscript.cumulus new file mode 100755 index 000000000..54a54d1d0 --- /dev/null +++ b/xCAT/postscripts/getmypostscript.cumulus @@ -0,0 +1,58 @@ +#!/bin/bash +#this script send getpostscript request to xcatd on MN and generate /xcatpost/mypostscript +#which includes the glocal environment variables to run postscripts + +if [ -z "$XCATDEST" ]; then + XCATDEST=$1 +fi + +#compose getpostscript request +echo " +getpostscript +" > /tmp/req.xml + + + +if [ -f /tmp/resp.xml ]; then + #remove any existing response file + rm /tmp/resp.xml; +fi + + +#communicate with xcatd on MN with getpostscript request +#the response will be saved in /tmp/resp.xml +while [ ! -f /tmp/resp.xml ] || grep error /tmp/resp.xml; do + if [ -f /tmp/resp.xml ]; then + timer=60 + while [ $timer -gt 0 ]; do + echo -en "Retrying in $timer seconds \r" >&2 + sleep 1 + timer=$(($timer-1)); + done + fi + #echo " " >&2 + if [ -f /etc/xcat/cert.pem -a -f /etc/xcat/certkey.pem ]; then #use client cert if available + cat /tmp/req.xml | /usr/bin/openssl s_client -key /etc/xcat/certkey.pem -cert /etc/xcat/cert.pem -connect $XCATDEST -quiet 2> /dev/null > /tmp/resp.xml + else + cat /tmp/req.xml | /usr/bin/openssl s_client -connect $XCATDEST -quiet 2>/dev/null > /tmp/resp.xml + fi +done + +if [ -f /tmp/resp.xml ] && grep '' /tmp/resp.xml >/dev/null 2>&1 ;then + echo "Success to obtain mypostscript!" +else + echo "Failed to obtain mypostscript!" + exit 1 +fi + +#parse the script from the xml-formated resposne +cat /tmp/resp.xml | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' | sed -e 's/<//g' -e 's/&/\&/g' -e 's/"/"/g' -e "s/'/'/g" > /xcatpost/mypostscript + +#the script specified in the "postscripts" and "postbootscripts" are currently not supported +#will be supported if there is requrement on this +sed -i -e "/# postscripts-start-here/,$ d" /xcatpost/mypostscript + +rm -f /tmp/req.xml +rm -f /tmp/resp.xml +exit 0 + diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index 0d51de150..94b21140d 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -47,11 +47,11 @@ network_ipv4calc () } if [ -f /etc/os-release ] && (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1); then - osver="cumulus" + OSVER="cumulus" fi defgw=`ip route | grep default | awk '{print $3}'` -if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") +if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then echo `hostname` >/etc/hostname mv /etc/network/interfaces /etc/network/interfaces.old # this file will be filled up next @@ -88,13 +88,13 @@ if [ ! -z $HOSTNAMECTL ] && [ ! -z $NODE ]; then fi for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do - IPADDRMASK=`ip addr show dev $nic | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1` + IPADDRMASK=`ip -4 -o a sh dev $nic | awk '/inet/{print $4}' | head -n 1` IPADDR=`echo $IPADDRMASK | awk -F'/' '{print $1}'` [ -z $IPADDR ] && continue PREFIXMASK=`echo $IPADDRMASK | awk -F'/' '{print $2}'` # converts to x.x.x.x mask value maskfromprefix $PREFIXMASK - if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") + if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then NETWORK=`network_ipv4calc $IPADDR $NETMASK` #BROADCAST=`ifconfig $nic | grep Bcast | awk '{print $3}' | awk -F: '{print $2}'` @@ -169,7 +169,7 @@ EOF fi done -if ( pmatch $OSVER "ubuntu*") || (pmatch $osver "cumulus") +if ( pmatch $OSVER "ubuntu*") || (pmatch $OSVER "cumulus") then cat >>/etc/network/interfaces </dev/null 2>/dev/null || echo "There is no ovs-vsctl" >&2 && exit 1 + type brctl >/dev/null 2>/dev/null || (echo "There is no ovs-vsctl" >&2 && exit 1) log_info "ovs-vsctl add-br $BNAME" ovs-vsctl add-br $BNAME elif [[ $BRIDGE == "bridge" ]]; then - type brctl >/dev/null 2>/dev/null || echo "There is no brctl" >&2 && exit 1 + type brctl >/dev/null 2>/dev/null || (echo "There is no brctl" >&2 && exit 1) log_info "brctl addbr $BNAME" brctl addbr $BNAME log_info "brctl stp $BNAME on" diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3e2c4ffb1..7aac7ab28 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -126,9 +126,8 @@ download_postscripts() retry=0 rc=1 # this is a fail return while [ 0 -eq 0 ]; do - - if [ -e "\/$xcatpost" ]; then - rm -rf "\/$xcatpost" + if [ -e "$xcatpost" ]; then + rm -rf "$xcatpost" fi export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /$xcatpost 2> /tmp/wget.log