diff --git a/buildcore.sh b/buildcore.sh index 0fbcf0ec6..13494774c 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -1,5 +1,4 @@ -# The shell is commented out so that it will run in bash on linux and ksh on aix -# !/bin/bash +#!/bin/bash # Build and upload the xcat-core code, on either linux or aix. diff --git a/builddep.sh b/builddep.sh index 5a3f7e931..84ca78e40 100755 --- a/builddep.sh +++ b/builddep.sh @@ -1,5 +1,5 @@ -# The shell is commented out so that it will run in bash on linux and ksh on aix -# !/bin/sh +#!/bin/sh + # # Package up all the xCAT open source dependencies # - creating the yum repos diff --git a/buildlocal.sh b/buildlocal.sh index fa4e6dfa6..da6f64899 100755 --- a/buildlocal.sh +++ b/buildlocal.sh @@ -1,3 +1,4 @@ +#!/bin/sh ####################################################################### #build script for local usage #used for Linux/AIX/Ubuntu diff --git a/docs/source/advanced/hierarchy/databases/mysql_configure.rst b/docs/source/advanced/hierarchy/databases/mysql_configure.rst index 4b03f9b78..b830760b4 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_configure.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_configure.rst @@ -29,7 +29,7 @@ Granting/Revoking access to the database for Service Node Clients * Log into the MySQL interactive program. :: - /usr/bin/mysql -r root -p + /usr/bin/mysql -u root -p * Granting access to the xCAT database. Service Nodes are required for xCAT hierarchical support. Compute nodes may also need access that depends on which application is going to run. (xcat201 is xcatadmin's password for following examples) :: diff --git a/docs/source/advanced/hierarchy/databases/mysql_install.rst b/docs/source/advanced/hierarchy/databases/mysql_install.rst index a22eef7b6..e5dd7cc58 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_install.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_install.rst @@ -77,7 +77,7 @@ Debian/Ubuntu mysql-server-5* mysql-server-core-5* -* MariaDB - Using ``apt-get``, ensure that the following packages are installed on the management node: :: +* MariaDB - Using ``apt-get``, ensure that the following packages are installed on the management node. ``apt-get install mariadb-server`` will pull in all required packages. For Ubuntu 16.04, it no longer required ``libmariadbclient18``. :: libmariadbclient18 mariadb-client diff --git a/docs/source/advanced/networks/infiniband/driver_and_installation.rst b/docs/source/advanced/networks/infiniband/driver_and_installation.rst index 1c22dfed9..d9d10a596 100644 --- a/docs/source/advanced/networks/infiniband/driver_and_installation.rst +++ b/docs/source/advanced/networks/infiniband/driver_and_installation.rst @@ -1,11 +1,11 @@ IB Driver Preparation and Installation ====================================== -xCAT provides sample postscripts to help you install the Mellanox OpenFabrics Enterprise Distribution (OFED) Infiniband Driver. These scripts are located in ``opt/xcat/share/xcat/ib/scripts/Mellanox/``. You can use these scripts directly or change them to satisfy your own environment. **xCAT 2.11 drops support of mlnxofed_ib_install and recommends using version 2 of the script: mlnxofed_ib_install.v2**. +xCAT provides sample postscripts to help you install the Mellanox OpenFabrics Enterprise Distribution (OFED) InfiniBand Driver. These scripts are located in ``opt/xcat/share/xcat/ib/scripts/Mellanox/``. You can use these scripts directly or change them to satisfy your own environment. **xCAT 2.11 drops support of mlnxofed_ib_install and recommends using version 2 of the script: mlnxofed_ib_install.v2**. .. toctree:: :maxdepth: 2 mlnxofed_ib_install_v2_usage.rst mlnxofed_ib_install_v1_usage.rst - \ No newline at end of file + diff --git a/docs/source/advanced/networks/infiniband/index.rst b/docs/source/advanced/networks/infiniband/index.rst index 1ef66d623..c525d6c95 100644 --- a/docs/source/advanced/networks/infiniband/index.rst +++ b/docs/source/advanced/networks/infiniband/index.rst @@ -1,8 +1,8 @@ -Infiniband (Mellanox) +InfiniBand (Mellanox) ===================== -xCAT offers a certain degree support for Mellanox infiniband product, it help you to configurate Mellanox infiniband products easily. - +xCAT offers a certain degree support for Mellanox InfiniBand product, it help you to configurate Mellanox InfiniBand products easily. For more information about Mellanox InfiniBand, please refer to `Mellanox official site `_. + .. 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 b1eee7fff..453e888a5 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 @@ -1,95 +1,169 @@ Configuration for Diskful Installation ======================================= -1. Set script ``mlnxofed_ib_install`` as postbootscript :: +1. Set script ``mlnxofed_ib_install`` as ``postbootscripts`` or ``postscripts`` :: - chdef -p postbootscripts="mlnxofed_ib_install -p /install//" + chdef -p postbootscripts="mlnxofed_ib_install -p /install//" + + Or :: + + chdef -p postscripts="mlnxofed_ib_install -p /install//" + + xCAT simulates completely the way Mellanox scripts work by using ``postbootscripts``. This way need to reboot after drive installation to make Mellanox drivers work reliably just like Mellanox suggested. If you want to use the reboot after operating system installation to avoid reboot twice, you can using ``postscripts`` attribute to install Mellanox drivers. This way has been verified in limited scenarios. For more information please refer to :doc:`The Scenarios Have Been Verified `. You can try this way in other else scenarios if you needed. -2. Specify dependence package **[required for RHEL and SLES]** +2. Specify dependency package - a) Copy a correct pkglist file **shipped by xCAT** according your environment to the ``/install/custom/install//`` directory, these pkglist files are located under ``/opt/xcat/share/xcat/install//`` :: + Some dependencies need to be installed before running Mellanox scripts. These dependencies are different between different scenario. xCAT configurates these dependency packages by using ``pkglist`` attribute of ``osimage`` definition. Please refer to :doc:`Add Additional Software Packages ` for more information:: - cp /opt/xcat/share/xcat/install//compute...pkglist \ - /install/custom/install//compute...pkglist + # lsdef -t osimage --install-compute + Object name: --install-compute + imagetype=linux + .... + pkgdir=/ + pkglist=//compute...pkglist + .... - b) Edit your ``/install/custom/install//compute...pkglist`` and add one line - - ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist#`` - - You can check directory ``/opt/xcat/share/xcat/ib/netboot//`` and choose one correct ``ib...pkglist`` according your environment. - - - c) Make the related osimage use the customized pkglist :: + You can append the ib dependency packages list in the end of ``//compute...pkglist`` directly like below: :: - chdef -t osimage -o --install-compute \ - pkglist=/install/custom/install//compute...pkglist + #cat //compute...pkglist + @base + @x11 + openssl + ntp + rsyn + #ib part + createrepo + kernel-devel + kernel-source + .... + + + Or if you want to isolate InfiniBand dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: + + #cat //compute...pkglist + @base + @x11 + openssl + ntp + rsyn + #INCLUDE://# + + xCAT has shipped some ib pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenario. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + + #cat //compute...pkglist + @base + @x11 + openssl + ntp + rsyn + #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# + + Take rhels7.2 on ppc64le for example: :: + + # lsdef -t osimage rhels7.2-ppc64le-install-compute + Object name: rhels7.2-ppc64le-install-compute + imagetype=linux + osarch=ppc64le + osdistroname=rhels7.2-ppc64le + osname=Linux + osvers=rhels7.2 + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + pkgdir=/install/rhels7.2/ppc64le + pkglist=/install/custom/install/rh/compute.rhels7.ib.pkglist + profile=compute + provmethod=install + template=/opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl - Take RHEL 6.4 on x86_64 for example :: - cp /opt/xcat/share/xcat/install/rh/compute.rhels6.x86_64.pkglist \ - /install/custom/install/rh/compute.rhels6.x86_64.pkglist + **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/install/rh/compute.rhels7.ib.pkglist`` is a copy of ``/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist``. :: + + # cat /install/custom/install/rh/compute.rhels7.ib.pkglist + #Please make sure there is a space between @ and group name + wget + ntp + nfs-utils + net-snmp + rsync + yp-tools + openssh-server + util-linux + net-tools + #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist# + + - Edit the ``/install/custom/install/rh/compute.rhels6.x86_64.pkglist`` and add below line - ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist#`` - - Then ``/install/custom/install/rh/compute.rhels6.x86_64.pkglist`` looks like below :: - - #Please make sure there is a space between @ and group name - #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist# - ntp - nfs-utils - net-snmp - rsync - yp-tools - openssh-server - util-linux-ng - - Then modify related osimage :: - - chdef -t osimage -o rhels6.4-x86_64-install-compute \ - pkglist=/install/custom/install/rh/compute.rhels6.x86_64.pkglist - 3. Install node :: nodeset osimage=--install-compute rsetboot net rpower reset - **[Note]**: - * In RHEL7.x, after performing all steps above, ``openibd`` doesn't work well. you can resolve this problem depending on `Mellanox OFED Linux Release Notes `_ by yourself. But reboot one more time can resolve all of these complex issues. so **we strongly recommend reboot machine again to avoid unexpected problem in RHEL7.x.** + After steps above, you can login target node and find the Mellanox InfiniBand drives are located under ``/lib/modules//extra/``. - * If you performed firmware updates, i.e. you didn't pass ``--without-fw-update`` to option ``-m`` of ``mlnxofed_ib_install``, **reboot machine for all distro** + Issue ``ibv_devinfo`` command you can get the InfiniBand apater information :: - After steps above, you can login target ndoe and find the Mellanox IB drives are located under ``/lib/modules//extra/``. + # ibv_devinfo + hca_id: mlx5_0 + transport: InfiniBand (0) + fw_ver: 10.14.2036 + node_guid: f452:1403:0076:10e0 + sys_image_guid: f452:1403:0076:10e0 + vendor_id: 0x02c9 + vendor_part_id: 4113 + hw_ver: 0x0 + board_id: IBM1210111019 + phys_port_cnt: 2 + Device ports: + port: 1 + state: PORT_INIT (2) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand + + port: 2 + state: PORT_DOWN (1) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand + + Using ``service openibd status`` to verify if openibd works well. Below is the output in rhels7.2. :: + + + # service openibd status + HCA driver loaded + + Configured IPoIB devices: + ib0 ib1 + + Currently active IPoIB devices: + Configured Mellanox EN devices: + + Currently active Mellanox devices: + + The following OFED modules are loaded: + + rdma_ucm + rdma_cm + ib_addr + ib_ipoib + mlx4_core + mlx4_ib + mlx4_en + mlx5_core + mlx5_ib + ib_uverbs + ib_umad + ib_ucm + ib_sa + ib_cm + ib_mad + ib_core - Issue ``ibstat`` command you can get the IB apater information :: - [root@server ~]# ibstat - CA 'mlx4_0' - CA type: MT4099 - Number of ports: 2 - Firmware version: 2.11.500 - Hardware version: 0 - Node GUID: 0x5cf3fc000004ec02 - System image GUID: 0x5cf3fc000004ec05 - Port 1: - State: Initializing - Physical state: LinkUp - Rate: 40 (FDR10) - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec03 - Link layer: InfiniBand - Port 2: - State: Down - Physical state: Disabled - Rate: 10 - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec04 - Link layer: InfiniBand 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 37fae36c2..e9576024f 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 @@ -1,128 +1,169 @@ Configuration for Diskless Installation ======================================= -1. Specify dependence package **[required for RHEL and SLES]** +1. Specify dependency package - a) Copy a correct pkglist file **shipped by xCAT** according your environment to the ``/install/custom/netboot//`` directory :: + Some dependencies need to be installed before running Mellanox scripts. These dependencies are different among different scenarios. xCAT can help user to install these dependency packages by adding these package names to the file specified by the ``pkglist`` attribute of the ``osimage`` definition. Please refer to :doc:`Add Additional Software Packages ` for more information:: - cp /opt/xcat/share/xcat/netboot//compute...pkglist \ - /install/custom/netboot//compute...pkglist + # lsdef -t osimage --netboot-compute + Object name: --netboot-compute + imagetype=linux + .... + pkgdir=/ + pkglist=//compute...pkglist + .... - b) Edit ``/install/custom/netboot//.pkglist`` and add ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist#`` + You can append the ib dependency packages list in the end of ``//compute...pkglist`` directly like below: :: - For example, on RHEL 6.4 (x86_64): :: + #cat //compute...pkglist + bash + nfs-utils + openssl + dhclient + kernel + ..... - cp /opt/xcat/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist \ - /install/custom/netboot/rh/compute.rhels6.x86_64.pkglist - - Edit ``/install/custom/netboot/rh/compute.rhels6.x86_64.pkglist`` and add ``#INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist#`` - - Then ``/install/custom/netboot/rh/compute.rhels6.x86_64.pkglist`` looks like below :: + #ib part + createrepo + kernel-devel + kernel-source + .... + + + Or if you want to isolate InfiniBand dependency packages list into a separate file, after you edit this file, you can append the file in ``//compute...pkglist`` like below way: :: + + #cat //compute...pkglist + bash + nfs-utils + openssl + dhclient + kernel + ..... + #INCLUDE://# + + xCAT ships some InfiniBand pkglist files under ``/opt/xcat/share/xcat/ib/netboot//``, these pkglist files have been verified in sepecific scenario. Please refer to :doc:`The Scenarios Have Been Verified ` to judge if you can use it directly in your environment. If so, you can use it like below: :: + + #cat //compute...pkglist + bash + nfs-utils + openssl + dhclient + kernel + ..... + #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# - #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels6.x86_64.pkglist# - bash - nfs-utils - openssl - dhclient - ..... 2. Prepare postinstall scripts - a) Specify a correct postinstall script **shipped by xCAT** :: - - mkdir -p /install/custom/netboot// - - cp /opt/xcat/share/xcat/netboot//.postinstall \ - /install/custom/netboot// - - chmod +x /install/custom/netboot//.postinstall + Edit ``postinstall`` script to trigger InfniBand drvices installation during ``genimage``. Using below command to find out where the ``postinstall`` script is defined. :: + + # lsdef -t osimage --netboot-compute + Object name: --netboot-compute + .... + postinstall=/..postinstall + .... + - Take RHEL 6.4 on x86_64 for example :: - - mkdir -p /install/custom/netboot/rh/ - cp /opt/xcat/share/xcat/netboot/rh/compute.rhels6.x86_64.postinstall \ - /install/custom/netboot/rh/ - chmod +x /install/custom/netboot/rh/compute.rhels6.x86_64.postinstall - b) Edit ``/install/custom/netboot//.postinstall`` and add below line in the end :: + Edit ``/..postinstall`` and add below line in the end. :: /install/postscripts/mlnxofed_ib_install \ -p /install// -i $1 -n genimage - **[Note]** If you want to customized kernel version (i.e the kernel version of the diskless image you want to generate is different with the kernel version of you management node), you need to pass ``--add-kernel-support`` attribute to Mellanox. the line added into ``.postinstall`` should like below :: - + **[Note]** Mellanox OFED ISO was built against a series of certain kernael versions, If the version of linux kernel you are using does not match with any of the Mellanox offered pre-built kernel modules, you can pass ``--add-kernel-support`` command line argument to Mellanox OFED installation script to build these kernel modules base on the version of linux kernel you are using. The line added into ``.postinstall`` should like below. :: + /install/postscripts/mlnxofed_ib_install \ - -p /install// -m --add-kernel-support -end- -i $1 -n genimage + -p /install// -m --add-kernel-support -end- -i $1 -n genimage - Below steps maybe helpful for you to do judgment if you belong to this situation. - - Get the kernel version of your management node :: - - uname -r - - Get the kernel version of target image. take generating a diskless image of rhels7.0 on x86_64 for example :: - - [root@server]# lsdef -t osimage rhels7.0-x86_64-install-compute -i pkgdir - Object name: rhels7.0-x86_64-install-compute - pkgdir=/install/rhels7.0/x86_64 - - [root@server]# ls -l /install/rhels7.0/x86_64/Packages/ |grep kernel* - ....... - -r--r--r-- 1 root root 30264588 May 5 2014 kernel-3.10.0-123.el7.x86_64.rpm - ....... -3. Set the related osimage using the customized pkglist and compute.postinsall + Take rhels7.2 on ppc64le for example: :: -* [RHEL/SLES] :: + #lsdef -t osimage rhels7.2-ppc64le-netboot-compute + Object name: rhels7.2-ppc64le-netboot-compute + exlist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.exlist + imagetype=linux + osarch=ppc64le + osdistroname=rhels7.2-ppc64le + osname=Linux + osvers=rhels7.2 + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + permission=755 + pkgdir=/install/rhels7.2/ppc64le + pkglist=/install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist + postinstall=/install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall + profile=compute + provmethod=netboot + rootimgdir=/install/netboot/rhels7.2/ppc64le/compute - chdef -t osimage -o --netboot-compute \ - pkglist=/install/custom/netboot//compute...pkglist \ - postinstall=/install/custom/netboot//.postinstall -* [Ubuntu] :: + **[Note]**: If the osimage definition was generated by xCAT command ``copycds``, default value ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` was assigned to ``pkglist`` attribute. ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist`` is the sample pkglist shipped by xCAT, recommend to make a copy of this sample and using the copy in real environment. In the above example, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist``. For the same reason, ``/install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall`` is a copy of ``/opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.postinstall``. - chdef -t osimage -o --netboot-compute \ - postinstall=/install/custom/netboot//.postinstall + ``compute.rhels7.ppc64le.pkglist`` looks like below: :: -4. Generate and package image for diskless installation :: + # cat /install/custom/netboot/rh/compute.rhels7.ppc64le.pkglist + bash + nfs-utils + openssl + dhclient + bc + ...... + lsvpd + irqbalance + procps-ng + parted + net-tools + #INCLUDE:/opt/xcat/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist# + + ``compute.rhels7.ppc64le.ib.postinstall`` looks like below: :: + + # cat /install/custom/netboot/rh/compute.rhels7.ppc64le.ib.postinstall + #!/bin/sh + #-- Do not remove following line if you want to make use of CVS version tracking + ..... + # [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION + #done + /install/postscripts/mlnxofed_ib_install -p /install/ofed/MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.2-ppc64le.iso -i $1 -n genimage + +3. Generate and package image for diskless installation :: genimage --netboot-compute packimage --netboot-compute -5. Install node :: +4. Install node :: nodeset osimage=--netboot-compute rsetboot net rpower reset - After installation, you can login target ndoe and issue ``ibstat`` command to verify if your IB driver works well. if everything is fine, you can get the IB apater information :: - - [root@server ~]# ibstat - CA 'mlx4_0' - CA type: MT4099 - Number of ports: 2 - Firmware version: 2.11.500 - Hardware version: 0 - Node GUID: 0x5cf3fc000004ec02 - System image GUID: 0x5cf3fc000004ec05 - Port 1: - State: Initializing - Physical state: LinkUp - Rate: 40 (FDR10) - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec03 - Link layer: InfiniBand - Port 2: - State: Down - Physical state: Disabled - Rate: 10 - Base lid: 0 - LMC: 0 - SM lid: 0 - Capability mask: 0x02594868 - Port GUID: 0x5cf3fc000004ec04 - Link layer: InfiniBand + After installation, you can login target ndoe and issue ``ibv_devinfo`` command to verify if your InfiniBand driver works well. if everything is fine, you can get the InfiniBand apater information. :: + + # ibv_devinfo + hca_id: mlx5_0 + transport: InfiniBand (0) + fw_ver: 10.14.2036 + node_guid: f452:1403:0076:10e0 + sys_image_guid: f452:1403:0076:10e0 + vendor_id: 0x02c9 + vendor_part_id: 4113 + hw_ver: 0x0 + board_id: IBM1210111019 + phys_port_cnt: 2 + Device ports: + port: 1 + state: PORT_INIT (2) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand + + port: 2 + state: PORT_DOWN (1) + max_mtu: 4096 (5) + active_mtu: 4096 (5) + sm_lid: 0 + port_lid: 65535 + port_lmc: 0x00 + link_layer: InfiniBand 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 217eb828d..cff51e6a6 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 @@ -1,12 +1,22 @@ Preparation =========== -Obtain the Mellanox OFED ISO file from `Mellanox official site `_ and put it into one place under ``/install`` directory depending on your need. +Obtain the Mellanox OFED ISO +---------------------------- + +Obtain the Mellanox OFED ISO file from `Mellanox official Download Page `_ and put it into one place under ``/install`` directory depending on your need. **[NOTE]** -* Mellanox provides OFED drivers in **tarball** and **iso** formats. xCAT only supports the **iso** format at this time. -* Mellanox provides different OFED ISOs depending on operating system and machine architecture, named like MLNX_OFED_LINUX----.iso, you should download correct one according your environment. +* Mellanox provides OFED drivers in **tarball** and **ISO image** formats. xCAT only supports the **iso** format at this time. +* Mellanox provides different OFED ISOs depending on operating system and machine architecture, named like MLNX_OFED_LINUX----.iso, you should download correct one according to your environment. +* Mellanox has some updates and known issues for echo OFED, please read `InfiniBand/VPI Software Overview `_ to understand these information. +* The Mellanox links offered above maybe outdate in future for Mellanox updates its web page, xCAT will keep updating for synchronization. If we don't update in time, please access `Mellanox web portal `_ to find ``Support/Education`` then ``InfiniBand/VPI Drivers`` lables. + +Prepare Install Script +---------------------- + +**mlnxofed_ib_install.v2** is a sample script, its framework can help you install Mellanox drives easily. But in specific scenario, some detail need to be modified to meet requirement, such like dependency package list. It has been verified in limited scenarios and can work as solution in these scenarios. For these scenarions information please refer to :doc:`The Scenarios Have Been Verified `. Copy **mlnxofed_ib_install.v2** into ``/install/postscripts`` and change name to **mlnxofed_ib_install** :: @@ -27,7 +37,10 @@ In general you can use ``mlnxofed_ib_install`` like below :: mlnxofed_ib_install -p /install// -If need to pass ``--without-32bit --without-fw-update --add-kernel-support --force`` to ``mlnxofedinstall``, refer to below command :: +If need to pass ``--without-32bit --without-fw-update --add-kernel-support --force`` to ``mlnxofedinstall``, refer to below command. :: mlnxofed_ib_install -p /install// \ -m --without-32bit --without-fw-update --add-kernel-support --force -end- + +**[Note]** We recommend to update your firmware to the version Mellanox supported in its release notes to avoid unexpected problem when you install InfiniBand driver. + diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst index be8532360..52d500fb3 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_usage.rst @@ -7,4 +7,6 @@ Using mlnxofed_ib_install.v2 (Recommend) mlnxofed_ib_install_v2_preparation.rst mlnxofed_ib_install_v2_diskful.rst mlnxofed_ib_install_v2_diskless.rst + mlnxofed_ib_verified_scenario_matrix.rst + mlnxofed_ib_known_issue.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst new file mode 100644 index 000000000..ef0ee44c6 --- /dev/null +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_known_issue.rst @@ -0,0 +1,19 @@ +Known Issues +============ + + +Known Issue 1 +------------- + +After you install mellanox derives in rhels7.2 successfully by xCAT, maybe you have new requirement to upgrade your operating system to higher version. In this case you probably hit such problem the IB adaptor drives shipped by operating system is higher than the Mellanox drives you have installed. That means the the Mellanox drives will be replaced by the drives shipped by operating system. If it's not the result you expect, you hope keep the Mellanox drives after operating system upgraded, please add below statement into ``/etc/yum.conf`` in your target node after you install mellanox derives successfully for the first time. :: + + exclude=dapl* libib* ibacm infiniband* libmlx* librdma* opensm* ibutils* + + +Known Issue 2 +------------- + +If you want to use ``--add-kernel-support`` attribute in sles12.1 and ppc64le scenario, you will find some dependency packages are not shipped by SLES Server DVDs, such like ``python-devel``, it's shipped in SDK DVDs. xCAT doesn't ship specific pkglist to support such scenario. If you have such requirement, please used ``otherpkglist`` and ``otherpkgs`` attributes to prepare dependency packages repository ahead. If you need help about ``otherpkglist`` and ``otherpkgs``attributes, please refer to :doc:`Add Additional Software Packages `. + + + 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 new file mode 100644 index 000000000..d8a515de6 --- /dev/null +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst @@ -0,0 +1,15 @@ +The Scenarios Have Been Verified +================================= + + ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| OS version | Arch | Ofed version | Attribute supported by mlnx | IB.pkglist | ++===============+=========+===================================================+==================================================================+===========================+ +| rhels7.1 | ppc64 | MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.1-ppc64.iso |--without-32bit --without-fw-update --add-kernel-support --force | ib.rhels7.ppc64.pkglist | ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| rhels7.2 | ppc64le | MLNX_OFED_LINUX-3.2-2.0.0.0-rhel7.2-ppc64le.iso |--without-32bit --without-fw-update --add-kernel-support --force | ib.rhels7.ppc64le.pkglist | ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| sles12.1 | ppc64le |MLNX_OFED_LINUX-3.2-2.0.0.0-sles12sp1-ppc64le.iso |--without-32bit --without-fw-update --force | ib.sles12.ppc64le.pkglist | ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ +| ubuntu14.04.3 | ppc64le |MLNX_OFED_LINUX-3.2-2.0.0.0-ubuntu14.04-ppc64le.iso|--without-32bit --without-fw-update --add-kernel-support --force |ib.ubuntu14.ppc64le.pkglist| ++---------------+---------+---------------------------------------------------+------------------------------------------------------------------+---------------------------+ diff --git a/docs/source/guides/admin-guides/manage_clusters/index.rst b/docs/source/guides/admin-guides/manage_clusters/index.rst index 9efd4b00d..d44e4a099 100644 --- a/docs/source/guides/admin-guides/manage_clusters/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/index.rst @@ -1,14 +1,10 @@ Manage Clusters =============== -This chapter introduces the procedures of how to manage a real cluster. Basically, it includes the following parts: +The following provides detailed information to help start managing your cluster using xCAT. - * Discover and Define Nodes - * Deploy/Configure OS for the Nodes - * Install/Configure Applications for the Nodes - * General System Management Work for the Nodes +The sections are organized based on hardware architecture. -You should select the proper sub-chapter according to the hardware type of your cluster. If having a mixed cluster that has multiple types of hardware, you have to refer to multiple sub-chapters accordingly. .. toctree:: :maxdepth: 2 diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst new file mode 100644 index 000000000..766981112 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/index.rst @@ -0,0 +1,11 @@ +Configure xCAT +============== + +After installing xCAT onto the management node, configure some basic attributes for your cluster into xCAT. + +.. toctree:: + :maxdepth: 2 + + site.rst + networks.rst + password.rst 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 new file mode 100644 index 000000000..5c6feeacf --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/networks.rst @@ -0,0 +1,46 @@ +Set attributes in the ``networks`` table +======================================== + +#. Display the network settings defined in the xCAT ``networks`` table using: ``tabdump networks`` :: + + #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers, + dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain, + comments,disable + "10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth0","10.0.0.101",,"10.4.27.5",,,,,,,,,,,, + + A default network is created for the detected primary network using the same netmask and gateway. There may be additional network entries in the table for each network present on the management node where xCAT is installed. + +#. To define additional networks, use one of the following options: + + * Use ``mkdef`` to create/update an entry into ``networks`` table. (**Recommended**) + + To create a network entry for 192.168.X.X/16 with a gateway of 192.168.1.254: :: + + mkdef -t network -o net1 net=192.168.0.0 mask=255.255.0.0 gateway=192.168.1.254 + + * Use the ``tabedit`` command to modify the networks table directly in an editor: ``tabedit networks`` + + * Use the ``makenetworks`` command to automatically generate a entry in the ``networks`` table + +#. Verify the network statements + + **Domain** and **nameserver** attributes must be configured in the ``networks`` table or in the ``site`` table for xCAT to function properly. + + + +Initialize DHCP services +------------------------ + +#. Configure DHCP to listen on different network interfaces (**Optional**) + + xCAT allows specifying different network intercaces thateDHCP can listen on for different nodes or node groups. If this is not needed, go to the next step. To set dhcpinterfaces :: + + chdef -t site dhcpinterfaces='xcatmn|eth1,eth2;service|bond0' + + For more information, see ``dhcpinterfaces`` keyword in the :doc:`site ` table. + + +#. Create a new DHCP configuration file with the networks defined using the ``makedhcp`` command. :: + + makedhcp -n + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst new file mode 100644 index 000000000..af22d16d8 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst @@ -0,0 +1,59 @@ +Configure passwords +=================== + +#. Configure the system password for the ``root`` user on the compute nodes. + + * Set using the :doc:`chtab ` command: (**Recommended**) :: + + chtab key=system passwd.username=root passwd.password=abc123 + + To encrypt the password using ``openssl``, use the following command: :: + + chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123` + + * Directly edit the passwd table using the :doc:`tabedit ` command. + + +#. Configure the passwords for Management modules of the compute nodes. + + * For IPMI/BMC managed systems: :: + + chtab key=ipmi passwd.username=USERID passwd.password=PASSW0RD + + * For HMC managed systems: :: + + chtab key=hmc passwd.username=hscroot passwd.password=abc123 + + The username and password for the HMC can be assigned directly to the HMC node object definition in xCAT. This is needed when the HMC username/password is different for each HMC. :: + + mkdef -t node -o hmc1 groups=hmc,all nodetype=ppc hwtype=hmc mgt=hmc \ + username=hscroot password=hmcPassw0rd + + * For Blade managed systems: :: + + chtab key=blade passwd.username=USERID passwd.password=PASSW0RD + + * For FSP/BPA (Flexible Service Processor/Bulk Power Assembly), if the passwords are set to the factory defaults, you must change them before running and commands to them. :: + + rspconfig frame general_passwd=general, + rspconfig frame admin_passwd=admin, + rspconfig frame HMC_passwd=, + + +#. If the REST API is being used configure a user and set a policy rule in xCAT. + + #. Create a non root user that will be used to make the REST API calls. :: + + useradd xcatws + passwd xcatws # set the password + + #. Create an entry for the user into the xCAT ``passwd`` table. :: + + chtab key=xcat passwd.username=xcatws passwd.password= + + #. Set a policy in the xCAT ``policy`` table to allow the user to make calls against xCAT. :: + + mkdef -t policy 6 name=xcatws rule=allow + + + When making calls to the xCAT REST API, pass in the credentials using the following attributes: ``userName`` and ``userPW`` diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst new file mode 100644 index 000000000..49911d4d2 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/site.rst @@ -0,0 +1,36 @@ +Set attributes in the ``site`` table +==================================== + +#. Verify the following attributes have been correctly set in the xCAT ``site`` table. + + * domain + * forwarders + * master [#]_ + * nameservers + + For more information on the keywords, see the DHCP ATTRIBUTES in the :doc:`site ` table. + + If the fields are not set or need to be changed, use the xCAT ``chdef`` command: :: + + chdef -t site domain="domain_string" + chdef -t site fowarders="forwarders" + chdef -t site master="xcat_master_ip" + chdef -t site nameservers="nameserver1,nameserver2,etc" + +.. [#] The value of the ``master`` attribute in the site table should be set as the IP address of the management node responsible for the compute node. + +Initialize DNS services +----------------------- + +#. Initialize the DNS [#]_ services on the xCAT Management Node: :: + + makedns -n + + Verify DNS is working by running ``nslookup`` against your Management Node: :: + + nslookup + + For more information on DNS, refer to :ref:`dns_label` + + +.. [#] Setting up name resolution and the ability to have hostname resolved to IP addresses is **required** for xCAT. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst deleted file mode 100644 index 70b877814..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure_xcat.rst +++ /dev/null @@ -1,251 +0,0 @@ -Configure xCAT -============== - -After you installed xCAT packages on management node,you have to configure the management node first .This document introduces how to configure the environment well before you can use xCAT normally. - -Here is a summary of steps required for the xCAT management node . - -:: - - 1.Check Site Table - 2.Check Networks - 3.Configure Password Table - 4.Initialize DHCP - -Check Site Table ----------------- - -After xCAT is installed , site table should be checked. Please verify following attributes and make sure they are correctly set. :: - - domain: The DNS domain name (exg. cluster.com). - - nameservers: A comma delimited list of DNS servers that each node in this network should use. This value will end up in the nameserver settings of the /etc/resolv.conf on each node in this network. If this attribute value is set to the IP address of an xCAT node, make sure DNS is running on it. In a hierarchical cluster, you can also set this attribute to "" to mean the DNS server for each node in this network should be the node that is managing it (either its service node or the management node). Used in creating the DHCP network definition, and DNS configuration. - - forwarders: The DNS servers at your site that can provide names outside of the cluster. The makedns command will configure the DNS on the management node to forward requests it does not know to these servers.Note that the DNS servers on the service nodes will ignore this value and always be configured to forward requests to the management node. - - master: The hostname of the xCAT management node, as known by the nodes. - -1. Before xCAT build is installed, management HostName and management DomainName should be configured in DNS configure file **/etc/resolv.conf**, after xCAT is installed, nameserver, master, domain and forwarder will be set correctly in site table. - - 1.1.Before install xCAT: - - * Modify **resolv.conf** file like example1: - - :: - - cat /etc/resolv.conf - ; generated by /usr/sbin/dhclient-script - search - nameserver - nameserver - - * Configure hostname setting so that using ``hostname`` could get the machine hostname like example2: - - :: - - mn:~ # hostname - mn - - * Configure domain name setting so that using ``hostname -d`` could get domain name like example3: - - :: - - [root@mn ~]# hostname -d - pok.stglabs.ibm.com - - 1.2 After xCAT is installed: - - * Using tabdump site to check ``site table``, the outputs will like example4: - - :: - - "domain","",, - "forwarders","",, - "master","",, - "nameservers","",, - -2. If configures in above 1 are not configured before xCAT is installed, the outputs of ``tabdump site`` are as following: :: - - "domain"," ",, - "forwarders",,, - "master","NORESOLUTION",, - "nameservers","NORESOLUTION" - - * In this situation, please configure the **/etc/resolv.conf** file according to example1. Then using ``chdef`` (exg. ``chdef -t site master=`` ) or ``tabedit site`` command to configure the site table according to example4. - -3.After site table is configured - - * Please initialize DNS using: :: - - makedns -n - - * Verify DNS work well using: :: - - nslookup - - * It gives out the Management node hostname and resolved ip. Here is an example: :: - - c910f04x27v05:~ # nslookup c910f04x27v05 - Server: 10.4.27.5 - Address: 10.4.27.5#53 - Name: c910f04x27v05.pok.stglabs.ibm.com - Address: 10.4.27.5 - -**Note**: - -#. The value of attribute master in site table can be set either management node ip or service node ip. -#. Setting up name resolution and having the nodes resolved to IP addresses are required in xCAT clusters . -#. Set site.forwarders to your site-wide DNS servers that can resolve site or public hostnames. The DNS on the MN will forward any requests it can't answer to these servers. -#. For more dns explanation please refer to :ref:`dns_label` - -Check Networks --------------- - -Please check networks tables: :: - - tabdump networks - -The outputs are as following: :: - - #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,comments,disable - "10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth0","10.0.0.103",,"10.4.27.5",,,,,,,,,,,, - -**Note**:Networks table will be set after xCAT is installed using default net,default mask and default gateway. - -1.If the cluster-facing NICs were not configured when xCAT was installed, or if there are more networks in the cluster that are only available via the service nodes or compute nodes, users can use such options below to create network definitions (exg.50.3.5.5). - - 1.1(Optinal) How to configured networks table: - - * Using ``mkdef`` to update networks table. :: - - mkdef -t network -o net1 net=9.114.0.0 mask=255.255.255.224 gateway=9.114.113.254 - - net The network address. - - mask The network mask. - - gateway The network gateway. - - * Or using ``tabedit`` to modify networks table. :: - - Tabedit networks - - * Or using command ``makenetworks`` to automatically generate networks table entry. :: - - makenetworks - - 1.2.Verify networks table similar like: - - :: - - # tabdump networks - #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,nodehostname,comments,disable - 50_0_0_0-255_0_0_0","50.0.0.0","255.0.0.0","eth1","",,"50.3.5.5",,,,,,,,,,,, - -**Note**:Domain and nameservers values must be provided either in the network definiton corresponding to the node or in the site definition. - -Configure Password Table -------------------------- - -The password should be set in the passwd table that will be assigned to root when the node is installed. You can modify this table using ``tabedit``. To change the default password for root on the nodes, change the system line. :: - - tabedit passwd - #key,username,password,cryptmethod,comments,disable - "system","root","cluster",,, - "hmc","hscroot","ABC123",,, - -Or :: - - chtab key=system passwd.username=root passwd.password=cluster - -**Note**: - -#. Currently xCAT puts the root password on the node only during install. It is taken from the passwd table where key=system. The new subcluster support requires a unique password for each subcluster to be installed. - -#. The xCAT database needs to contain the proper authentication working with hmc/blade/ipmi userid and password. Example for passwd set up: - - :: - - chtab key=hmc passwd.username=hscroot passwd.password=abc123 - or - chtab key=blade passwd.username=USERID passwd.password=PASSW0RD - or - chtab key=ipmi passwd.username=USERID passwd.password=PASSW0RD - -#. (Optional)If the BPA passwords are still the factory defaults, you must change them before running any other commands to them. - - :: - - rspconfig frame general_passwd=general, - rspconfig frame admin_passwd=admin, - rspconfig frame HMC_passwd=, - -#. (Optional)The username and password for xCAT to access an HMC can also be assigned directly to the HMC node object using the ``mkdef`` or ``chdef`` commands. This assignment is useful when a specific HMC has a username and/or password that is different from the default one specified in the passwd table. For example, to create an HMC node object and set a unique username or password for it: - - :: - - mkdef -t node -o hmc1 groups=hmc,all nodetype=ppc hwtype=hmc mgt=hmc username=hscroot password=abc1234 - - Or to change it if the HMC definition already exists: - - chdef -t node -o hmc1 username=hscroot password=abc1234 - -#. (Optional)The REST API calls need to provide a username and password. When this request is passed to xcatd, it will first verify that this user/pw is in the xCAT passwd table, and then xcatd will look in the policy table to see if that user is allowed to do the requested operation. - - * The account which key is xcat will be used for the REST API authentication. The username and password should be passed in with the attirbutes. :: - - userName: Pass the username of the account - userPW: Pass the password of the account - - * Use non-root account to create new user and setup the password and policy rules. :: - - useradd wsuser - passwd wsuser # set the password - tabch key=xcat,username=wsuser passwd.password=cluster - mkdef -t policy 6 name=wsuser rule=allow - - * Use root account: :: - - tabch key=xcat,username=root passwd.password= - -Initialize DHCP ---------------- - -Initialize DHCP service -~~~~~~~~~~~~~~~~~~~~~~~ - -Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on. :: - - makedhcp -n - -(Optional)Setup the DHCP interfaces in site table -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To set up the site table dhcp interfaces for your system p cluster, identify the correct interfaces that xCAT should listen to on your management node and service nodes. :: - - chdef -t site dhcpinterfaces='pmanagenode|eth1;service|eth0' - - makedhcp -n - - dhcpinterfaces: The network interfaces DHCP should listen on. If it is the same for all nodes, use a simple comma-separated list of NICs. To specify different NICs for different nodes:xcatmn|eth1,eth2;service|bond0.In this example xcatmn is the name of the xCAT MN, and DHCP there should listen on eth1 and eth2. On all of the nodes in group 'service' DHCP should listen on the bond0 nic. - -**Note**:To verify makedhcp work well, please check nic,domain-name ,domain-servers in dhcpd.conf , for example: :: - - shared-network nic { - subnet 10.0.0.0 netmask 255.0.0.0 { - authoritative; - max-lease-time 43200; - min-lease-time 43200; - default-lease-time 43200; - option routers 10.2.1.12; - next-server 10.2.1.13; - option log-servers ; - option ntp-servers ; - option domain-name ""; - option domain-name-servers ; - option domain-search "pok.stglabs.ibm.com"; - zone pok.stglabs.ibm.com. { - primary 10.2.1.13; key xcat_key; - } - - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst index 028e73d61..95c71c100 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/config_environment.rst @@ -4,7 +4,6 @@ Configure xCAT Configure network table ``````````````````````` - Normally, there will be at least two entries for the two subnet on MN in ``networks`` table after xCAT is installed:: #tabdump networks @@ -50,18 +49,10 @@ For hardware management with ipmi, add the following line:: Verify the genesis packages ``````````````````````````` -Genesis packages are used to **create the root image for network boot** and **MUST** be installed before doing hardware discovery. +The **xcat-genesis** packages should have been installed when xCAT was installed, but would cause problems if missing. **xcat-genesis** packages are required to create the genesis root image to do hardware discovery and the genesis kernel sits in ``/tftpboot/xcat/``. Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: -* **[RH]**:: +* **[RHEL/SLES]**: ``rpm -qa | grep -i genesis`` - # rpm -qa |grep -i genesis - xCAT-genesis-scripts-ppc64-2.10-snap201507240527.noarch - xCAT-genesis-base-ppc64-2.10-snap201505172314.noarch +* **[Ubuntu]**: ``dpkg -l | grep -i genesis`` -* **[ubuntu]**:: - - # dpkg -l | grep genesis - ii xcat-genesis-base-ppc64 2.10-snap201505172314 all xCAT Genesis netboot image - ii xcat-genesis-scripts 2.10-snap201507240105 ppc64el xCAT genesis - -**Note:** If the two packages are not installed, install them first and then run ``mknb ppc64`` to create the network boot root image. +If missing, install them from the ``xcat-deps`` package and run ``mknb ppc64`` to create the genesis network boot root image. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst index 242dded82..61de0fdc5 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/index.rst @@ -1,11 +1,20 @@ Hardware Discovery & Define Node ================================ -Have the servers to be defined as **Node Object** in xCAT is the first step to do for a cluster management. +In order to manage machines using xCAT, the machines need to be defined as xCAT ``node objects`` in the database. The :doc:`xCAT Objects ` documentation describes the process for manually creating ``node objects`` one by one using the xCAT ``mkdef`` command. This is valid when managing a small sizes cluster but can be error prone and cumbersome when managing large sized clusters. -In the chapter :doc:`xCAT Object <../../../basic_concepts/xcat_object/index>`, it describes how to create a **Node Object** through `mkdef` command. You can collect all the necessary information of target servers and define them to a **xCAT Node Object** by manually run `mkdef` command. This is doable when you have a small cluster which has less than 10 servers. But it's really error-prone and inefficiency to manually configure SP (like BMC) and collect information for a large number servers. +xCAT provides several *automatic hardware discovery* methods to assist with hardware discovery by helping to simplify the process of detecting service processors (SP) and collecting various server information. The following are methods that xCAT supports: + + +.. toctree:: + :maxdepth: 2 + + mtms/index.rst + switch_discovery.rst + seq_discovery.rst + manually_define.rst + manually_discovery.rst -xCAT offers several powerful **Automatic Hardware Discovery** methods to simplify the procedure of SP configuration and server information collection. If your managed cluster has more than 10 servers, the automatic discovery is worth to take a try. If your cluster has more than 50 servers, the automatic discovery is recommended. Following are the brief characteristics and adaptability of each method, you can select a proper one according to your cluster size and other consideration. @@ -73,12 +82,3 @@ Following are the brief characteristics and adaptability of each method, you can You have to strictly boot on the node in order if you want the node has the expected name. Generally you have to waiting for the discovery process finished before power on the next one. -.. toctree:: - :maxdepth: 2 - - manually_define.rst - mtms_discovery.rst - switch_discovery.rst - seq_discovery.rst - manually_discovery.rst - diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst new file mode 100644 index 000000000..45e69d072 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery.rst @@ -0,0 +1,14 @@ +Discovery +========= + +When the IPMI-based servers are connected to power, the BMCs will boot up and attempt to obtain an IP address from an open range dhcp server on your network. In the case for xCAT managed networks, xCAT should be configured serve an open range dhcp IP addresses with the ``dynamicrange`` attribute in the networks table. + +When the BMCs have an IP address and is pingable from the xCAT management node, administrators can discover the BMCs using the xCAT's :doc:`bmcdiscover ` command and obtain basic information to start the hardware discovery process. + +xCAT Hardware discover uses the xCAT genesis kernel (diskless) to discover additional attributes of the compute node and automatically populate the node definitions in xCAT. + +.. toctree:: + :maxdepth: 2 + + discovery_using_defined.rst + discovery_using_dhcp.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst new file mode 100644 index 000000000..ca8e4c571 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -0,0 +1,144 @@ +Set static BMC IP using different IP address (recommended) +========================================================== + +The following example outlines the MTMS based hardware discovery for a single IPMI-based compute node. + ++------------------------------+------------+ +| Compute Node Information | Value | ++==============================+============+ +| Model Type | 8247-22l | ++------------------------------+------------+ +| Serial Number | 10112CA | ++------------------------------+------------+ +| Hostname | cn01 | ++------------------------------+------------+ +| IP address | 10.1.2.1 | ++------------------------------+------------+ + +The BMC IP address is obtained by the open range dhcp server and the plan in this scenario is to change the IP address for the BMC to a static IP address in a different subnet than the open range addresses. The static IP address in this example is in the same subnet as the open range to simplify the networking configuration on the xCAT management node. + ++------------------------------+------------+ +| BMC Information | Value | ++==============================+============+ +| IP address - dhcp | 172.30.0.1 | ++------------------------------+------------+ +| IP address - static | 172.20.2.1 | ++------------------------------+------------+ + +#. Detect the BMCs and add the node definitions into xCAT. + + Use the ``bmcdiscover`` command to discover the BMCs responding over an IP range and automatically write the output into the xCAT database. You **must** use the ``-t`` option to indicate node type is bmc and the ``-w`` option to automatically write the output into the xCAT database. + + To discover the BMC with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -t -z -w + + The discovered nodes will be written to xCAT database: :: + + # lsdef node-8247-22l-10112ca + Object name: node-8247-22l-10112ca + bmc=172.30.0.1 + cons=ipmi + groups=all + hwtype=bmc + mgt=ipmi + mtm=8247-22L + nodetype=mp + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + serial=10112CA + + +#. **Pre-define** the compute nodes: + + Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT. + + To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + + The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> :: + + # cat predefined.stanzas + node-8247-22l-10112ca: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + + +#. Edit the ``predefined.stanzas`` file and change the discovered nodes to the intended ``hostname`` and ``IP address``. + + #. Edit the ``predefined.stanzas`` file: :: + + vi predefined.stanzas + + #. Rename the discovered object names to their intended compute node hostnames based on the MTMS mapping: :: + + node-8247-22l-10112ca ==> cn01 + + #. Add a ``ip`` attribute and give it the compute node IP address: :: + + ip=10.1.2.1 + + #. Repeat for additional nodes in the ``predefined.stanza`` file based on the MTMS mapping. + + + In this example, the ``predefined.stanzas`` file now looks like the following: :: + + # cat predefined.stanzas + cn01: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + ip=10.1.2.1 + + +#. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. :: + + chdef cn01 chain="runcmd=bmcsetup" + + +#. Change the BMC IP address + + Set the BMC IP address to a different value for the **predefined** compute node definitions. + + To change the dhcp obtained IP address of 172.30.0.1 to a static IP address of 172.20.2.1, run the following command: :: + + chdef cn01 bmc=172.20.2.1 + +#. Define the compute nodes into xCAT: :: + + cat predefined.stanzas | mkdef -z + +#. Add the compute node IP information to ``/etc/hosts``: :: + + makehosts cn01 + +#. Refresh the DNS configuration for the new hosts: :: + + makedns -n + +#. **[Optional]** Monitor the node discovery process using rcons + + Configure the conserver for the **discovered** node to watch the discovery process using ``rcons``:: + + makeconservercf node-8247-22l-10112ca + + In another terminal window, open the remote console: :: + + rcons node-8247-22l-10112ca + +#. Start the discovery process by booting the **discovered** node definition: :: + + rsetboot node-8247-22l-10112ca net + rpower node-8247-22l-10112ca on + +#. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst new file mode 100644 index 000000000..7759e3c2e --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst @@ -0,0 +1,113 @@ +Set static BMC IP using dhcp provided IP address +================================================ + +The following example outlines the MTMS based hardware discovery for a single IPMI-based compute node. + ++------------------------------+------------+ +| Compute Node Information | Value | ++==============================+============+ +| Model Type | 8247-22l | ++------------------------------+------------+ +| Serial Number | 10112CA | ++------------------------------+------------+ +| Hostname | cn01 | ++------------------------------+------------+ +| IP address | 10.1.2.1 | ++------------------------------+------------+ + +The BMC IP address is obtained by the open range dhcp server and the plan is to leave the IP address the same, except we want to change the IP address to be static in the BMC. + ++------------------------------+------------+ +| BMC Information | Value | ++==============================+============+ +| IP address - dhcp | 172.30.0.1 | ++------------------------------+------------+ +| IP address - static | 172.30.0.1 | ++------------------------------+------------+ + + +#. **Pre-define** the compute nodes: + + Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT. + + To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: :: + + bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + + The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> :: + + # cat predefined.stanzas + node-8247-22l-10112ca: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + + +#. Edit the ``predefined.stanzas`` file and change the discovered nodes to the intended ``hostname`` and ``IP address``. + + #. Edit the ``predefined.stanzas`` file: :: + + vi predefined.stanzas + + #. Rename the discovered object names to their intended compute node hostnames based on the MTMS mapping: :: + + node-8247-22l-10112ca ==> cn01 + + #. Add a ``ip`` attribute and give it the compute node IP address: :: + + ip=10.1.2.1 + + #. Repeat for additional nodes in the ``predefined.stanza`` file based on the MTMS mapping. + + + In this example, the ``predefined.stanzas`` file now looks like the following: :: + + # cat predefined.stanzas + cn01: + objtype=node + groups=all + bmc=172.30.0.1 + cons=ipmi + mgt=ipmi + mtm=8247-22L + serial=10112CA + ip=10.1.2.1 + + +#. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. :: + + chdef cn01 chain="runcmd=bmcsetup" + +#. Define the compute nodes into xCAT: :: + + cat predefined.stanzas | mkdef -z + +#. Add the compute node IP information to ``/etc/hosts``: :: + + makehosts cn01 + +#. Refresh the DNS configuration for the new hosts: :: + + makedns -n + +#. **[Optional]** Monitor the node discovery process using rcons + + Configure the conserver for the **predefined** node to watch the discovery process using ``rcons``:: + + makeconservercf cn01 + + In another terminal window, open the remote console: :: + + rcons cn01 + +#. Start the discovery process by booting the **predefined** node definition: :: + + rsetboot cn01 net + rpower cn01 on + +#. The discovery process will network boot the machine into the diskless xCAT genesis kernel and perform the discovery process. When the discovery process is complete, doing ``lsdef`` on the compute nodes should show discovered attributes for the machine. The important ``mac`` information should be discovered, which is necessary for xCAT to perform OS provisioning. + 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 new file mode 100644 index 000000000..fde5e5254 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst @@ -0,0 +1,27 @@ +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. + +**Overview** + + #. Automatically search and collect MTMS information from the servers + #. Write **discovered-bmc-nodes** to xCAT (recommened 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 + +**Pros** + + * Limited effort to get servers defined using xCAT hardware discovery engine + +**Cons** + + * When compared to switch-based discovery, the administrator needs to create the **predefined-compute-nodes** for each of the **discovered-bmc-nodes**. This could become difficult for a large number of servers. + +.. toctree:: + :maxdepth: 2 + + verification.rst + discovery.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst new file mode 100644 index 000000000..a77acd58c --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/verification.rst @@ -0,0 +1,53 @@ +Verification +============ + +Before starting hardware discovery, ensure the following is configured to make the discovery process as smooth as possible. + +Password Table +-------------- + +In order to communicate with IPMI-based hardware (with BMCs), verify that the xCAT ``passwd`` table contains an entry for ``ipmi`` which defines the default username and password to communicate with the IPMI-based servers. :: + + tabdump passwd | grep ipmi + +If not configured, use the following command to set ``usernam=ADMIN`` and ``password=admin``. :: + + chtab key=ipmi passwd.username=ADMIN passwd.password=admin + + +Genesis Package +--------------- + +The **xCAT-genesis** packages provides the utility to create the genesis network boot rootimage used by xCAT when doing hardware discovery. It should be installed during the xCAT install and would cause problems if missing. + +Verify that the ``genesis-scripts`` and ``genesis-base`` packages are installed: + + * **[RHEL/SLES]**: :: + + rpm -qa | grep -i genesis + + * **[Ubuntu]**: :: + + dpkg -l | grep -i genesis + + +If missing: + + #. Install them from the ``xcat-dep`` repository using the Operating Specific package manager (``yum, zypper, apt-get, etc``) + + * **[RHEL]**: :: + + yum install xCAT-genesis + + * **[SLES]**: :: + + zypper install xCAT-genesis + + * **[Ubuntu]**: :: + + apt-get install xCAT-genesis + + #. Create the network boot rootimage with the following command: ``mknb ppc64``. + + The genesis kernel should be copied to ``/tftpboot/xcat``. + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst deleted file mode 100644 index ea9e921bd..000000000 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms_discovery.rst +++ /dev/null @@ -1,80 +0,0 @@ -MTMS-based Discovery -==================== - -MTMS is short for Machine Type/Model and Serial which is unique for a physical server. The idea of MTMS based hardware discovery is that the admin know the physical location information of the server with specified MTMS. Then the admin can assign nodename and host ip address for the physical server. - -.. include:: schedule_environment.rst -.. include:: config_environment.rst - -Discover server and define --------------------------- - -After environment is ready, and the server is powered, we can start server discovery process. The first thing to do is discovering the FSP/BMC of the server. It is automatically powered on when the physical server is powered. - -The following command can be used to discover BMC(s) within an IP range and write the discovered node definition(s) into a stanza file:: - - bmcdiscover -s nmap --range 50.0.100.1-100 -z > ./bmc.stanza - -**Note**: bmcdiscover will use username/password pair set in ``passwd`` table with **key** equal **ipmi**. If you'd like to use other username/password, you can use :: - - bmcdiscover -s nmap --range 50.0.100.1-100 -z -u -p > ./bmc.stanza - -You need to modify the node definition(s) in stanza file before using them, the stanza file will be like this:: - - # cat pbmc.stanza - cn1: - objtype=node - bmc=50.0.100.1 - mtm=8247-42L - serial=10112CA - groups=pbmc,all - mgt=ipmi - -Then, define it into xCATdb:: - - # cat pbmc.stanza | mkdef -z - 1 object definitions have been created or modified. - -The server definition will be like this:: - - # lsdef cn1 - Object name: cn1 - bmc=50.0.100.1 - groups=pbmc,all - hidden=0 - mgt=ipmi - mtm=8247-42L - nodetype=mp - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - serial=10112CA - -After the physical server is defined into xCATdb, the next thing is update the node definition with the example node attributes:: - - chdef cn1 ip=10.0.101.1 - -In order to do BMC configuration during the discovery process, set ``runcmd=bmcsetup``. For more info about chain, please refer to :doc:`Chain <../../../../../advanced/chain/index>` :: - - chdef cn1 chain="runcmd=bmcsetup" - -Then, add node info into /etc/hosts and DNS:: - - makehosts cn1 - makedns -n - - - -Start discovery process ------------------------ - -To start discovery process, just need to power on the host remotely with the following command, and the discovery process will start automatically after the host is powered on:: - - rpower cn1 on - -**[Optional]** If you'd like to monitor the discovery process, you can use:: - - chdef cn1 cons=ipmi - makeconservercf - rcons cn1 - -.. include:: standard_cn_definition.rst 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 2ae5caba4..882086fa2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -1,14 +1,14 @@ IBM Power LE / OpenPOWER ========================= -This chapter introduces the procedure of how to manage an IBM Power LE/OpenPower cluster. Generally speaking, the processor of **Compute Node** is **IBM Power Chip** based and the management module is **BMC** based. +The following sections documents the procedures in managing IBM Power LE (Little Endian) / OpenPOWER servers in an xCAT cluster. +These are machines use the IBM Power Architecture and is **IPMI** managed. -For a new user, you are recommended to read this chapter in order since later section depends on the execute result of previous section. .. toctree:: :maxdepth: 2 - configure_xcat.rst + configure/index.rst discovery/index.rst management.rst diskful/index.rst 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 f45dc3aa1..f51b0d015 100644 --- a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst @@ -59,7 +59,7 @@ Keywords to use: .. code-block:: perl - apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key filed in a different row. + apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key field in a different row. 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. 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 4fbe488f4..f3fc52f98 100644 --- a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst @@ -11,7 +11,7 @@ NAME **** -\ **rmvm**\ - Removes HMC-, DFM-, IVM-, KVM-, Vmware- and zVM-managed partitions or virtual machines. +\ **rmvm**\ - Removes HMC-, DFM-, IVM-, KVM-, VMware- and zVM-managed partitions or virtual machines. ******** @@ -25,18 +25,18 @@ SYNOPSIS \ **rmvm [-V| -**\ **-verbose]**\ \ *noderange*\ \ **[-r] [-**\ **-service]**\ -For KVM and Vmware: +For KVM and VMware: =================== -\ **rmvm [-p] [-f]**\ +\ **rmvm [-p] [-f]**\ \ *noderange*\ PPC (using Direct FSP Management) specific: =========================================== -\ **rmvm**\ \ *noderange*\ +\ **rmvm [-p]**\ \ *noderange*\ @@ -65,9 +65,7 @@ OPTIONS \ **-**\ **-service**\ Remove the service partitions of the specified CECs. -\ **-p**\ 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. - -\ **-p|-**\ **-part**\ Remove the specified partiton on normal power machine. +\ **-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. \ **-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/rsetboot.1.rst b/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst index 0c8cef953..73f96eaf1 100644 --- a/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst @@ -11,7 +11,7 @@ SYNOPSIS ******** -\ **rsetboot**\ \ *noderange*\ {\ **hd | net | cd | default | stat**\ } +\ **rsetboot**\ \ *noderange*\ {\ **hd | net | cd | default | stat**\ } [\ **-u**\ ] [\ **-p**\ ] \ **rsetboot**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -21,9 +21,7 @@ DESCRIPTION *********** -\ **rsetboot**\ sets the boot media that should be used on the next boot of the specified nodes. After the nodes are -booted with the specified device (e.g. via rpower(1)|rpower.1), the nodes will return to using the -default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. +\ **rsetboot**\ sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via rpower(1)|rpower.1), the nodes will return to using the default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. ******* @@ -62,6 +60,18 @@ OPTIONS +\ **-u**\ + + To specify the next boot mode to be "UEFI Mode". + + + +\ **-p**\ + + To make the specified boot device and boot mode settings persistent. + + + ******** EXAMPLES 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 3da5ec913..d8c0be67f 100644 --- a/docs/source/guides/admin-guides/references/man8/nodeset.8.rst +++ b/docs/source/guides/admin-guides/references/man8/nodeset.8.rst @@ -19,11 +19,11 @@ Name **************** -\ **nodeset**\ [\ *noderange*\ ] [\ **boot**\ | \ **stat**\ | \ **iscsiboot**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ = \ *imagename*\ | \ **shell**\ | \ **shutdown**\ ] +\ **nodeset**\ \ *noderange*\ [\ **boot**\ | \ **stat**\ | \ **iscsiboot**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\ | \ **shutdown**\ ] -\ **nodeset**\ \ *noderange*\ \ **osimage=**\ \ *imagename*\ [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] +\ **nodeset**\ \ *noderange*\ \ **osimage**\ [=\ *imagename*\ ] [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] -\ **nodeset**\ \ *noderange*\ \ **runimage=**\ \ *task*\ +\ **nodeset**\ \ *noderange*\ \ **runimage=**\ \ *task*\ \ **nodeset**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] @@ -74,7 +74,7 @@ A user can supply their own scripts to be run on the mn or on the service node ( -\ **osimage | osimage= +\ **osimage | 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. diff --git a/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst b/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst index f0ca608fb..f67fefc32 100644 --- a/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst +++ b/docs/source/guides/install-guides/apt/prepare_mgmt_node.rst @@ -33,16 +33,24 @@ xCAT uses the apt package manager on Ubuntu Linux distributions to install and r gpgcheck=1 -Set up Network --------------- +Configure the Management Node +----------------------------- -The Management Node IP address should be set to a **static** IP address. +By setting properties on the Management Node before installing the xCAT software will allow xCAT to automatically configure key attributes in the xCAT ``site`` table during the install. -Modify the ``interfaces`` file in ``/etc/network`` and configure a static IP address. :: - - # The primary network interface - auto eth0 - iface eth0 inet static - address 10.3.31.11 - netmask 255.0.0.0 +#. Ensure a hostname is configured on the management node by issuing the ``hostname`` command. [*It's recommended to use a fully qualified domain name (FQDN) when setting the hostname*] + #. To set the hostname of *xcatmn.cluster.com*: :: + + hostname xcatmn.cluster.com + + #. Add the hostname to the ``/etc/hostname`` and ``/etc/hosts`` to persist the hostname on reboot. + + #. Reboot or run ``service hostname restart`` to allow the hostname to take effect and verify the hostname command returns correctly: + + * ``hostname`` + * ``hostname -d`` - should display the domain + +#. Reduce the risk of the Management Node IP address being lost by setting the interface IP to **STATIC** in the ``/etc/network/interfaces`` configuration file. + +#. Configure any domain search strings and nameservers using the ``resolvconf`` command. diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index be5e43d22..b4646a0cb 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -3,6 +3,9 @@ For the current list of operating systems supported and verified by the development team for the different releases of xCAT, see the :doc:`xCAT2 Release Notes `. +**Disclaimer** These instructions are intended to only be guidelines and specific details may differ slightly based on the operating system version. Always refer to the operating system documentation for the latest recommended procedures. + + .. END_see_release_notes .. BEGIN_install_os_mgmt_node @@ -26,14 +29,6 @@ The system requirements for your xCAT management node largely depend on the size .. END_install_os_mgmt_node -.. BEGIN_setup_mgmt_node_network - -The Management Node IP address should be set to a **static** IP address. - -Modify the ``ifcfg-`` file in ``/etc/sysconfig/network-scripts`` and configure a static IP address. - -.. END_setup_mgmt_node_network - .. BEGIN_install_xcat_introduction xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` diff --git a/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst b/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst index d02ec031e..7dbc7d0d7 100644 --- a/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst +++ b/docs/source/guides/install-guides/yum/prepare_mgmt_node.rst @@ -15,9 +15,8 @@ Configure the Base OS Repository xCAT uses the yum package manager on RHEL Linux distributions to install and resolve dependency packages provided by the base operating system. Follow this section to create the repository for the base operating system on the Management Node -#. Copy the DVD iso file to ``/tmp`` on the Management Node: :: - - # This example will use RHEL-LE-7.1-20150219.1-Server-ppc64le-dvd1.iso +#. Copy the DVD iso file to ``/tmp`` on the Management Node. + This example will use file ``RHEL-LE-7.1-20150219.1-Server-ppc64le-dvd1.iso`` #. Mount the iso to ``/mnt/iso/rhels7.1`` on the Management Node. :: @@ -33,10 +32,26 @@ xCAT uses the yum package manager on RHEL Linux distributions to install and res gpgcheck=1 -Set up Network --------------- +Configure the Management Node +----------------------------- -.. include:: ../common_sections.rst - :start-after: BEGIN_setup_mgmt_node_network - :end-before: END_setup_mgmt_node_network +By setting properties on the Management Node before installing the xCAT software will allow xCAT to automatically configure key attributes in the xCAT ``site`` table during the install. + +#. Ensure a hostname is configured on the management node by issuing the ``hostname`` command. [*It's recommended to use a fully qualified domain name (FQDN) when setting the hostname*] + + #. To set the hostname of *xcatmn.cluster.com*: :: + + hostname xcatmn.cluster.com + + #. Add the hostname to the ``/etc/sysconfig/network`` in order to persist the hostname on reboot. + + + #. Reboot the server and verify the hostname by running the following commands: + + * ``hostname`` + * ``hostname -d`` - should display the domain + +#. Reduce the risk of the Management Node IP address being lost by setting the IP to **STATIC** in the ``/etc/sysconfig/network-scripts/ifcfg-`` configuration files. + +#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file. diff --git a/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst b/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst index a795339b4..fce8dc660 100644 --- a/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst +++ b/docs/source/guides/install-guides/zypper/prepare_mgmt_node.rst @@ -33,10 +33,25 @@ xCAT uses the zypper package manager on SLES Linux distributions to install and gpgcheck=1 -Set up Network --------------- +Configure the Management Node +----------------------------- -The Management Node IP address should be set to a **static** IP address. +By setting properties on the Management Node before installing the xCAT software will allow xCAT to automatically configure key attributes in the xCAT ``site`` table during the install. -Modify the ``ifcfg-`` file in ``/etc/sysconfig/network/`` and configure a static IP address. +#. Ensure a hostname is configured on the management node by issuing the ``hostname`` command. [*It's recommended to use a fully qualified domain name (FQDN) when setting the hostname*] + #. To set the hostname of *xcatmn.cluster.com*: :: + + hostname xcatmn.cluster.com + + #. Add the hostname to the ``/etc/hostname`` in order to persist the hostname on reboot. + + + #. Reboot the server and verify the hostname by running the following commands: + + * ``hostname`` + * ``hostname -d`` - should display the domain + +#. Reduce the risk of the Management Node IP address being lost by setting the IP to **STATIC** in the ``/etc/sysconfig/network/ifcfg-`` configuration files. + +#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file. diff --git a/makerpm b/makerpm index 76a800688..355e236bf 100755 --- a/makerpm +++ b/makerpm @@ -1,5 +1,4 @@ -# The shell is commented out so that it will run in bash on linux and ksh on aix -# !/bin/bash +#!/bin/bash # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 9bfd043a9..f7c60288e 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -96,7 +96,7 @@ my %usage = ( MIC specific: rinv noderange [system|ver|board|core|gddr|all]", "rsetboot" => -"Usage: rsetboot [net|hd|cd|floppy|def|stat] [-V|--verbose] +"Usage: rsetboot [net|hd|cd|floppy|def|stat] [-V|--verbose] [-u] [-p] rsetboot [-h|--help|-v|--version]", "rbootseq" => "Usage: @@ -459,7 +459,7 @@ Options: "Usage: Common: nodeset [-h|--help|-v|--version] - nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline]", + nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline|shutdown|stat]", "rmflexnode" => "Usage: rmflexnode [-h|--help|-v|--version] diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index c0d38cffb..23e0c371d 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -874,12 +874,20 @@ sub initmysqldb } # end AIX only #on debian/ubuntu should comment the bind-adress line in my.cnf + #on Ubuntu16.04, the bind-address line is in the mariadb.conf.d/50-server.cnf if ( $::debianflag ){ - $cmd = "sed 's/\\(^\\s*bind.*\\)/#\\1/' /etc/mysql/my.cnf > /tmp/my.cnf; mv -f /tmp/my.cnf /etc/mysql/my.cnf;chmod 644 /etc/mysql/my.cnf"; + my $bind_file; + if (-e "/etc/mysql/mariadb.conf.d/50-server.cnf") + { + $bind_file = "/etc/mysql/mariadb.conf.d/50-server.cnf"; + } else { + $bind_file = "/etc/mysql/my.cnf"; + } + $cmd = "sed 's/\\(^\\s*bind.*\\)/#\\1/' $bind_file > /tmp/my.cnf; mv -f /tmp/my.cnf $bind_file;chmod 644 $bind_file"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E", " comment the bind-address line in /etc/mysql/my.cfg failed: $cmd."); + xCAT::MsgUtils->message("E", " comment the bind-address line in $bind_file failed: $cmd."); exit(1); } } diff --git a/xCAT-client/pods/man1/nodestat.1.pod b/xCAT-client/pods/man1/nodestat.1.pod index caf39cdde..42a0dc5f0 100644 --- a/xCAT-client/pods/man1/nodestat.1.pod +++ b/xCAT-client/pods/man1/nodestat.1.pod @@ -37,7 +37,7 @@ The following is an example of the settings in the B table: Keywords to use: - apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key filed in a different row. + apps -- a list of comma separated application names whose status will be queried. For how to get the status of each app, look for app name in the key field in a different row. 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. diff --git a/xCAT-client/pods/man1/rmvm.1.pod b/xCAT-client/pods/man1/rmvm.1.pod index 0dbba6788..959a350d8 100644 --- a/xCAT-client/pods/man1/rmvm.1.pod +++ b/xCAT-client/pods/man1/rmvm.1.pod @@ -1,6 +1,6 @@ =head1 NAME -B - Removes HMC-, DFM-, IVM-, KVM-, Vmware- and zVM-managed partitions or virtual machines. +B - Removes HMC-, DFM-, IVM-, KVM-, VMware- and zVM-managed partitions or virtual machines. =head1 SYNOPSIS @@ -10,13 +10,13 @@ B B I B<[-r] [--service]> -=head2 For KVM and Vmware: +=head2 For KVM and VMware: -B +B I =head2 PPC (using Direct FSP Management) specific: -B I +B I =head1 DESCRIPTION @@ -37,9 +37,7 @@ B<-r> Retain the data object definitions of the nodes. B<--service> Remove the service partitions of the specified CECs. -B<-p> 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. - -B<-p|--part> Remove the specified partiton on normal power machine. +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<-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/rsetboot.1.pod b/xCAT-client/pods/man1/rsetboot.1.pod index d9540bc1a..c9e6b1fd6 100644 --- a/xCAT-client/pods/man1/rsetboot.1.pod +++ b/xCAT-client/pods/man1/rsetboot.1.pod @@ -5,16 +5,14 @@ B - Sets the boot device to be used for BMC-based servers for the next =head1 SYNOPSIS -B I {B|B|B|B|B} +B I {B|B|B|B|B} [B<-u>] [B<-p>] B [B<-h>|B<--help>|B<-v>|B<--version>] =head1 DESCRIPTION -B sets the boot media that should be used on the next boot of the specified nodes. After the nodes are -booted with the specified device (e.g. via L), the nodes will return to using the -default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. +B sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via L), the nodes will return to using the default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes. =head1 OPTIONS @@ -40,6 +38,14 @@ Boot using the default set in BIOS. Display the current boot setting. +=item B<-u> + +To specify the next boot mode to be "UEFI Mode". + +=item B<-p> + +To make the specified boot device and boot mode settings persistent. + =back =head1 EXAMPLES diff --git a/xCAT-client/pods/man8/nodeset.8.pod b/xCAT-client/pods/man8/nodeset.8.pod index 6741beb92..835b7de8a 100644 --- a/xCAT-client/pods/man8/nodeset.8.pod +++ b/xCAT-client/pods/man8/nodeset.8.pod @@ -4,11 +4,11 @@ B - set the boot state for a noderange =head1 B -B [I] [B | B | B | B | B | B= I | B | B] +B I [B | B | B | B | B | B[=I] | B | B] -B I B I [B<--noupdateinitrd>] [B<--ignorekernelchk>] +B I B[=I] [B<--noupdateinitrd>] [B<--ignorekernelchk>] -B I B I +B I BI B [B<-h>|B<--help>|B<-v>|B<--version>] @@ -49,7 +49,7 @@ Instruct network boot loader to be skipped, generally meaning boot to hard disk Cleanup the current pxe/tftp boot configuration files for the nodes requested -=item B|B> +=item B|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. diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index 3dd876bc4..3ff63d83f 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -188,6 +188,7 @@ else done echo -n "Acquiring network addresses.." + 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 @@ -199,6 +200,10 @@ else fi done sleep 2 + tries=$(($tries+1)) + if [ $tries -ge 10 ]; then + break + fi done if [ -z "$bootnic" ]; then /bin/bash diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index e9089c564..c2ba52cd6 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -1577,7 +1577,7 @@ sub tabdb if ($rep) { return tabdb($rep->[0], $rep->[1], $rep->[2]); } else { - $tmplerr="Unable to find requested filed <$field> from table <$table>, with key <$key>" + $tmplerr="Unable to find requested field <$field> from table <$table>, with key <$key>" } } return ""; @@ -1586,7 +1586,7 @@ sub tabdb # check for site.xcatdebugmode if (($table =~ /site/) and ($key =~ /xcatdebugmode/)) { if ((($ent->{$field}) ne "0") and (($ent->{$field}) ne "1") and (($ent->{$field}) ne "2")) { - $tmplerr="Unable to recognise filed <$field> from table <$table>, with key <$key>. Please enter '0' '1' or '2'" + $tmplerr="Unable to recognise field <$field> from table <$table>, with key <$key>. Please enter '0' '1' or '2'" } } } diff --git a/xCAT-server/lib/xcat/monitoring/xcatmon.pm b/xCAT-server/lib/xcat/monitoring/xcatmon.pm index 61db830a0..02228ba80 100644 --- a/xCAT-server/lib/xcat/monitoring/xcatmon.pm +++ b/xCAT-server/lib/xcat/monitoring/xcatmon.pm @@ -418,7 +418,7 @@ sub getDescription { ping-interval: the number of minutes between each nmap/fping operation. The default value is 3. apps: a list of comma separated application names whose status will be queried. - For how to get the status of each app, look for app name in the key filed + For how to get the status of each app, look for app name in the key field in a different row. port: the application daemon port number, if not specified, use internal list, then /etc/services. diff --git a/xCAT-server/lib/xcat/plugins/docker.pm b/xCAT-server/lib/xcat/plugins/docker.pm index 48376a45b..b9ff4a16c 100755 --- a/xCAT-server/lib/xcat/plugins/docker.pm +++ b/xCAT-server/lib/xcat/plugins/docker.pm @@ -172,15 +172,9 @@ my %command_states = ( # ^ / | # | 404 and / | # 20x| 'No such image'/ | -# | v 20x| error +# | v | error # CREATE_TO_WAIT_FOR_IMAGE_PULL_DONE ------------------------------> error_msg # | -# v error -# CREATE_TO_WAIT_FOR_RM_DEFCONN_DONE-------> error_msg -# | -# 20x| -# v error -# CREATE_TO_WAIT_FOR_CONNECT_NET_DONE------> error_msg # | # 20x| # v @@ -200,28 +194,10 @@ my %command_states = ( init_url => "/images/create?fromImage=#DOCKER_IMAGE#", init_state => "CREATE_TO_WAIT_FOR_IMAGE_PULL_DONE", }, - connectnet => { - genreq_ptr => \&genreq_for_net_connect, - state_machine_engine => \&default_state_engine, - init_method => "POST", - init_url => "/networks/#NETNAME#/connect", - init_state => "CREATE_TO_WAIT_FOR_CONNECT_NET_DONE", - }, - rmdefconn => { - genreq_ptr => \&genreq_for_net_disconnect, - state_machine_engine => \&default_state_engine, - init_method => "POST", - init_url => "/networks/bridge/disconnect", - init_state => "CREATE_TO_WAIT_FOR_RM_DEFCONN_DONE", - } }, -# The state changing for rmdocker -# -# INIT_TO_WAIT_FOR_DISCONNECT_NET_DONE -# If success or force to remove, to remove docker -# Else return error -# In remove docker round, return error_msg if failed or success if done +# For rmdocker +# return error_msg if failed or success if done rmdocker => { force => { state_machine_engine => \&default_state_engine, @@ -233,13 +209,6 @@ my %command_states = ( init_method => "DELETE", init_url => "/containers/#NODE#", }, - disconnect => { - genreq_ptr => \&genreq_for_net_disconnect, - state_machine_engine => \&default_state_engine, - init_method => "POST", - init_url => "/networks/#NETNAME#/disconnect", - init_state => "INIT_TO_WAIT_FOR_DISCONNECT_NET_DONE", - }, }, # For lsdocker [-l|--logs] @@ -484,17 +453,6 @@ sub default_state_engine { $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Pull image $node_hash->{image} start"]}]}); change_node_state($node, $command_states{mkdocker}{pullimage}); return; - } elsif ($data->is_success) { - $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Remove default network connection"]}]}); - change_node_state($node, $command_states{mkdocker}{rmdefconn}); - return; - } - } - elsif ($curr_state eq 'CREATE_TO_WAIT_FOR_RM_DEFCONN_DONE') { - if ($data->is_success) { - $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Connecting customzied network '$node_hash->{nics}'"]}]}); - change_node_state($node, $command_states{mkdocker}{connectnet}); - return; } } elsif ($curr_state eq 'CREATE_TO_WAIT_FOR_IMAGE_PULL_DONE') { @@ -505,13 +463,6 @@ sub default_state_engine { return; } } - elsif ($curr_state eq 'INIT_TO_WAIT_FOR_DISCONNECT_NET_DONE') { - if ($data->is_success or $node_hash_variable{$node}->{opt} eq 'force') { - $global_callback->({node=>[{name=>[$node],"$info_flag"=>["Disconnect customzied network '$node_hash->{nics}' done"]}]}); - change_node_state($node, $command_states{rmdocker}{$node_hash->{opt}}); - return; - } - } foreach my $tmp (@msg) { if ($tmp->[0]) { @@ -736,7 +687,7 @@ sub parse_args { return ( [1, "Option $op is not supported for $cmd"]); } } - $request->{mapping_option} = "disconnect"; + $request->{mapping_option} = "force"; } elsif ($cmd eq 'lsdocker') { foreach my $op (@ARGV) { @@ -825,11 +776,7 @@ sub process_request { $mapping_hash = $command_states{$command}{$req->{mapping_option}}; } else { - if ($command eq 'rmdocker') { - $mapping_hash = $command_states{$command}{disconnect}; - } else { - $mapping_hash = $command_states{$command}{default}; - } + $mapping_hash = $command_states{$command}{default}; } my $max_concur_session_allow = 20; # A variable can be set by caculated in the future if ($command eq 'lsdocker') { @@ -1131,6 +1078,10 @@ sub genreq_for_mkdocker { my ($node, $dockerhost, $method, $api) = @_; my $dockerinfo = $node_hash_variable{$node}; my %info_hash = (); + if (defined($dockerinfo->{flag})) { + my $flag_hash = decode_json($dockerinfo->{flag}); + %info_hash = %$flag_hash; + } #$info_hash{name} = '/'.$node; #$info_hash{Hostname} = ''; #$info_hash{Domainname} = ''; @@ -1139,72 +1090,15 @@ sub genreq_for_mkdocker { $info_hash{Memory} = $dockerinfo->{mem}; $info_hash{MacAddress} = $dockerinfo->{mac}; $info_hash{CpusetCpus} = $dockerinfo->{cpus}; - if (defined($dockerinfo->{flag})) { - my $flag_hash = decode_json($dockerinfo->{flag}); - %info_hash = (%info_hash, %$flag_hash); - } + $info_hash{HostConfig}->{NetworkMode} = $dockerinfo->{nics}; + $info_hash{NetworkDisabled} = JSON::false; + $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{IPAMConfig}->{IPv4Address} = $dockerinfo->{ip}; my $content = encode_json \%info_hash; return genreq($node, $dockerhost, $method, $api, $content); } #------------------------------------------------------- -=head3 genreq_for_net_connect - - Generate HTTP request for network operation for a docker - - Input: $node: The docker container name - $dockerhost: hash, keys: name, port, user, pw, user, pw, user, pw - $method: the http method to generate the http request - $api: the url to generate the http request - - return: The http request; - Usage example: - my $res = genreq_for_net_connect($node,\%dockerhost,'POST','/networks/$nic/connect'); - -=cut - -#------------------------------------------------------- - -sub genreq_for_net_connect { - my ($node, $dockerhost, $method, $api) = @_; - my $dockerinfo = $node_hash_variable{$node}; - my %info_hash = (); - $info_hash{container} = $node; - $info_hash{EndpointConfig}->{IPAMConfig}->{IPv4Address} = $dockerinfo->{ip}; - my $content = encode_json \%info_hash; - return genreq($node, $dockerhost, $method, $api, $content); -} -#------------------------------------------------------- - -=head3 genreq_for_net_disconnect - - Generate HTTP request for network operation for a docker - - Input: $node: The docker container name - $dockerhost: hash, keys: name, port, user, pw, user, pw, user, pw - $method: the http method to generate the http request - $api: the url to generate the http request - - return: The http request; - Usage example: - my $res = genreq_for_net_disconnect($node,\%dockerhost,'POST','/networks/$nic/disconnect'); - -=cut - -#------------------------------------------------------- - -sub genreq_for_net_disconnect { - my ($node, $dockerhost, $method, $api) = @_; - my $dockerinfo = $node_hash_variable{$node}; - my %info_hash = (); - $info_hash{Container} = $node; - $info_hash{Force} = JSON::false; - my $content = encode_json \%info_hash; - return genreq($node, $dockerhost, $method, $api, $content); -} -#------------------------------------------------------- - =head3 sendreq Based on the method, url create a http request and send out on the given SSL connection diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 418a67f30..15267f0da 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -23,22 +23,25 @@ my $globaltftpdir = xCAT::TableUtils->getTftpDir(); my %usage = ( - "nodeset" => "Usage: nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline]", +"nodeset" => "Usage: nodeset [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=]|offline|shutdown|stat]", ); + sub handled_commands { + # process noderes:netboot like "grub2-" # such as grub2-http and grub2-tftp return { nodeset => "noderes:netboot=(grub2[-]?.*)" - } + } } sub check_dhcp { return 1; + #TODO: omapi magic to do things right my $node = shift; my $dhcpfile; - open ($dhcpfile,$dhcpconf); + open($dhcpfile, $dhcpconf); while (<$dhcpfile>) { if (/host $node\b/) { close $dhcpfile; @@ -49,25 +52,26 @@ sub check_dhcp { return 0; } -sub _slow_get_tftpdir { #make up for paths where tftpdir is not passed in - my $node=shift; - my $nrtab = xCAT::Table->new('noderes',-create=>0); #in order to detect per-node tftp directories +sub _slow_get_tftpdir { #make up for paths where tftpdir is not passed in + my $node = shift; + my $nrtab = xCAT::Table->new('noderes', -create => 0); #in order to detect per-node tftp directories unless ($nrtab) { return $globaltftpdir; } - my $ent = $nrtab->getNodeAttribs($node,["tftpdir"]); + my $ent = $nrtab->getNodeAttribs($node, ["tftpdir"]); if ($ent and $ent->{tftpdir}) { - return $ent->{tftpdir}; + return $ent->{tftpdir}; } else { return $globaltftpdir; } } + sub getstate { - my $node = shift; + my $node = shift; my $tftpdir = shift; unless ($tftpdir) { $tftpdir = _slow_get_tftpdir($node); } if (check_dhcp($node)) { - if (-r $tftpdir . "/boot/grub2/".$node) { + if (-r $tftpdir . "/boot/grub2/" . $node) { my $fhand; - open ($fhand,$tftpdir . "/boot/grub2/".$node); + open($fhand, $tftpdir . "/boot/grub2/" . $node); my $headline = <$fhand>; close $fhand; $headline =~ s/^#//; @@ -82,17 +86,19 @@ sub getstate { } sub setstate { + =pod This function will manipulate the grub structure to match what the noderes/chain tables indicate the node should be booting. =cut - my $node = shift; - my %bphash = %{shift()}; - my %chainhash = %{shift()}; - my %machash = %{shift()}; - my $tftpdir = shift; - my %nrhash = %{shift()}; + + my $node = shift; + my %bphash = %{ shift() }; + my %chainhash = %{ shift() }; + my %machash = %{ shift() }; + my $tftpdir = shift; + my %nrhash = %{ shift() }; my $linuximghash = shift(); my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); if ($kern->{kcmdline} =~ /!myipfn!/) { @@ -101,27 +107,28 @@ sub setstate { if ($ipfnd[0] eq 1) { $::callback->( - { - error => [$ipfnd[1]], - errorcode => [1] - }); + { + error => [ $ipfnd[1] ], + errorcode => [1] + }); return; } elsif ($ipfnd[0] eq 2) { my $servicenodes = $nrhash{$node}->[0]; if ($servicenodes and $servicenodes->{servicenode}) { my @sns = split /,/, $servicenodes->{servicenode}; - foreach my $sn ( @sns ) { + foreach my $sn (@sns) { + # We are in the service node pools, print error if no facing ip. if (xCAT::InstUtils->is_me($sn)) { my @myself = xCAT::NetworkUtils->determinehostname(); - my $myname = $myself[(scalar @myself)-1]; + my $myname = $myself[ (scalar @myself) - 1 ]; $::callback->( { - error => [ - "$myname: $ipfnd[1] on service node $sn" - ], - errorcode => [1] + error => [ + "$myname: $ipfnd[1] on service node $sn" + ], + errorcode => [1] } ); return; @@ -129,13 +136,13 @@ sub setstate { } } else { $::callback->( - { - error => [ + { + error => [ "$myname: $ipfnd[1]" - ], - errorcode => [1] - } - ); + ], + errorcode => [1] + } + ); return; } } else { @@ -146,238 +153,243 @@ sub setstate { my $addkcmdline; if ($kern->{addkcmdline}) { - $addkcmdline .= $kern->{addkcmdline}." "; + $addkcmdline .= $kern->{addkcmdline} . " "; } - - if($linuximghash and $linuximghash->{'addkcmdline'}) + + if ($linuximghash and $linuximghash->{'addkcmdline'}) { - unless($linuximghash->{'boottarget'}) + unless ($linuximghash->{'boottarget'}) { - $addkcmdline .= $linuximghash->{'addkcmdline'}." "; - } + $addkcmdline .= $linuximghash->{'addkcmdline'} . " "; + } } my $cmdhashref; - if($addkcmdline){ - $cmdhashref=xCAT::Utils->splitkcmdline($addkcmdline); - } - - if($cmdhashref and $cmdhashref->{volatile}) - { - $kern->{kcmdline}.=" ".$cmdhashref->{volatile}; + if ($addkcmdline) { + $cmdhashref = xCAT::Utils->splitkcmdline($addkcmdline); } - + + if ($cmdhashref and $cmdhashref->{volatile}) + { + $kern->{kcmdline} .= " " . $cmdhashref->{volatile}; + } + my $pcfg; unless (-d "$tftpdir/boot/grub2") { - mkpath("$tftpdir/boot/grub2"); + mkpath("$tftpdir/boot/grub2"); } my $nodemac; - my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] ); - - open($pcfg,'>',$tftpdir."/boot/grub2/".$node); - my $cref=$chainhash{$node}->[0]; #$chaintab->getNodeAttribs($node,['currstate']); + my %client_nethash = xCAT::DBobjUtils->getNetwkInfo([$node]); + + open($pcfg, '>', $tftpdir . "/boot/grub2/" . $node); + my $cref = $chainhash{$node}->[0]; #$chaintab->getNodeAttribs($node,['currstate']); if ($cref->{currstate}) { - print $pcfg "#".$cref->{currstate}."\n"; + print $pcfg "#" . $cref->{currstate} . "\n"; } - if(($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")){ - print $pcfg "set debug=all\n"; + if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) { + print $pcfg "set debug=all\n"; } print $pcfg "set timeout=5\n"; - - $normalnodes{$node}=1; #Assume a normal netboot (well, normal dhcp, - #which is normally with a valid 'filename' field, - #but the typical ppc case will be 'special' makedhcp - #to clear the filename field, so the logic is a little - #opposite - + + $normalnodes{$node} = 1; #Assume a normal netboot (well, normal dhcp, + #which is normally with a valid 'filename' field, + #but the typical ppc case will be 'special' makedhcp + #to clear the filename field, so the logic is a little + #opposite + if ($cref and $cref->{currstate} eq "boot") { - $breaknetbootnodes{$node}=1; - delete $normalnodes{$node}; #Signify to omit this from one makedhcp command - close($pcfg); + $breaknetbootnodes{$node} = 1; + delete $normalnodes{$node}; #Signify to omit this from one makedhcp command + close($pcfg); } elsif ($kern and $kern->{kernel}) { - #It's time to set grub configuration for this node to boot the kernel.. - #get tftpserver - my $tftpserver; - if (defined ($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'tftpserver'}) { - $tftpserver = $nrhash{$node}->[0]->{'tftpserver'}; - } 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; - } - - my $grub2protocol="tftp"; - if (defined ($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'} - && ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) { - $grub2protocol = $1; - } - unless($grub2protocol =~ /^http|tftp$/ ){ - $::callback->( - { - error => [ - "Invalid netboot method, please check noderes.netboot for $node" - ], - errorcode => [1] - } - ); - return; - } + #It's time to set grub configuration for this node to boot the kernel.. + #get tftpserver + my $tftpserver; + if (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'tftpserver'}) { + $tftpserver = $nrhash{$node}->[0]->{'tftpserver'}; + } 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; + } - - print $pcfg "set default=\"xCAT OS Deployment\"\n"; - print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; - print $pcfg " insmod http\n"; - print $pcfg " insmod tftp\n"; - print $pcfg " set root=$grub2protocol,$serverip\n"; - print $pcfg " echo Loading Install kernel ...\n"; - - my $protocolrootdir=""; - if($grub2protocol =~ /^http$/) - { - $protocolrootdir=$tftpdir; - } + my $grub2protocol = "tftp"; + if (defined($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'} + && ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) { + $grub2protocol = $1; + } - if ($kern and $kern->{kcmdline}) { - print $pcfg " linux $protocolrootdir/$kern->{kernel} $kern->{kcmdline}\n"; - } else { - print $pcfg " linux $protocolrootdir/$kern->{kernel}\n"; - } - print $pcfg " echo Loading initial ramdisk ...\n"; - if ($kern and $kern->{initrd}) { - print $pcfg " initrd $protocolrootdir/$kern->{initrd}\n"; - } - - print $pcfg "}"; - close($pcfg); - my $inetn = xCAT::NetworkUtils->getipaddr($node); - unless ($inetn) { - syslog("local1|err","xCAT unable to resolve IP for $node in grub2 plugin"); - return; - } - } else { - close($pcfg); + unless ($grub2protocol =~ /^http|tftp$/) { + $::callback->( + { + error => [ +"Invalid netboot method, please check noderes.netboot for $node" + ], + errorcode => [1] + } + ); + return; + } + + + print $pcfg "set default=\"xCAT OS Deployment\"\n"; + print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; + print $pcfg " insmod http\n"; + print $pcfg " insmod tftp\n"; + print $pcfg " set root=$grub2protocol,$serverip\n"; + print $pcfg " echo Loading Install kernel ...\n"; + + my $protocolrootdir = ""; + if ($grub2protocol =~ /^http$/) + { + $protocolrootdir = $tftpdir; + } + + if ($kern and $kern->{kcmdline}) { + print $pcfg " linux $protocolrootdir/$kern->{kernel} $kern->{kcmdline}\n"; + } else { + print $pcfg " linux $protocolrootdir/$kern->{kernel}\n"; + } + print $pcfg " echo Loading initial ramdisk ...\n"; + if ($kern and $kern->{initrd}) { + print $pcfg " initrd $protocolrootdir/$kern->{initrd}\n"; + } + + print $pcfg "}"; + close($pcfg); + my $inetn = xCAT::NetworkUtils->getipaddr($node); + unless ($inetn) { + syslog("local1|err", "xCAT unable to resolve IP for $node in grub2 plugin"); + return; + } + } else { + close($pcfg); } my $ip = xCAT::NetworkUtils->getipaddr($node); unless ($ip) { - syslog("local1|err","xCAT unable to resolve IP in grub2 plugin"); - return; + syslog("local1|err", "xCAT unable to resolve IP in grub2 plugin"); + return; } my $mactab = xCAT::Table->new('mac'); my %ipaddrs; my $macstring; $ipaddrs{$ip} = 1; if ($mactab) { - my $ment = $machash{$node}->[0]; #$mactab->getNodeAttribs($node,['mac']); - if ($ment and $ment->{mac}) { - $macstring=$ment->{mac}; - my @macs = split(/\|/,$ment->{mac}); - foreach (@macs) { - $nodemac = $_; - if (/!(.*)/) { - my $ipaddr = xCAT::NetworkUtils->getipaddr($1); - if ($ipaddr) { - $ipaddrs{$ipaddr} = 1; - } - } - } - } + my $ment = $machash{$node}->[0]; #$mactab->getNodeAttribs($node,['mac']); + if ($ment and $ment->{mac}) { + $macstring = $ment->{mac}; + my @macs = split(/\|/, $ment->{mac}); + foreach (@macs) { + $nodemac = $_; + if (/!(.*)/) { + my $ipaddr = xCAT::NetworkUtils->getipaddr($1); + if ($ipaddr) { + $ipaddrs{$ipaddr} = 1; + } + } + } + } } + # Do not use symbolic link, p5 does not support symbolic link in /tftpboot # my $hassymlink = eval { symlink("",""); 1 }; foreach $ip (keys %ipaddrs) { - my @ipa=split(/\./,$ip); - my $pname = "grub.cfg-" . sprintf("%02x%02x%02x%02x",@ipa); - unlink($tftpdir."/boot/grub2/".$pname); - link($tftpdir."/boot/grub2/".$node,$tftpdir."/boot/grub2/".$pname); + my @ipa = split(/\./, $ip); + my $pname = "grub.cfg-" . sprintf("%02x%02x%02x%02x", @ipa); + unlink($tftpdir . "/boot/grub2/" . $pname); + link($tftpdir . "/boot/grub2/" . $node, $tftpdir . "/boot/grub2/" . $pname); } - if($macstring){ - $nodemac=xCAT::Utils->parseMacTabEntry($macstring,$node); + if ($macstring) { + $nodemac = xCAT::Utils->parseMacTabEntry($macstring, $node); } if ($nodemac =~ /:/) { my $tmp = lc($nodemac); $tmp =~ s/(..):(..):(..):(..):(..):(..)/$1-$2-$3-$4-$5-$6/g; my $pname = "grub.cfg-01-" . $tmp; - unlink($tftpdir."/boot/grub2/".$pname); - link($tftpdir."/boot/grub2/".$node,$tftpdir."/boot/grub2/".$pname); + unlink($tftpdir . "/boot/grub2/" . $pname); + link($tftpdir . "/boot/grub2/" . $node, $tftpdir . "/boot/grub2/" . $pname); } - return; + return; } my $errored = 0; -sub pass_along { + +sub pass_along { my $resp = shift; - + $callback->($resp); if ($resp and ($resp->{errorcode} and $resp->{errorcode}->[0]) or ($resp->{error} and $resp->{error}->[0])) { - $errored=1; + $errored = 1; } - foreach (@{$resp->{node}}) { - if ($_->{error} or $_->{errorcode}) { - $errored=1; - } + foreach (@{ $resp->{node} }) { + if ($_->{error} or $_->{errorcode}) { + $errored = 1; + } } } - + sub preprocess_request { my $req = shift; if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } my $callback1 = shift; - my $command = $req->{command}->[0]; - my $sub_req = shift; - my @args=(); + my $command = $req->{command}->[0]; + my $sub_req = shift; + my @args = (); if (ref($req->{arg})) { - @args=@{$req->{arg}}; + @args = @{ $req->{arg} }; } else { - @args=($req->{arg}); + @args = ($req->{arg}); } @ARGV = @args; my $nodes = $req->{node}; + #use Getopt::Long; my $HELP; my $VERSION; my $VERBOSE; Getopt::Long::Configure("bundling"); Getopt::Long::Configure("pass_through"); - if (!GetOptions('h|?|help' => \$HELP, - 'v|version' => \$VERSION, - 'V' => \$VERBOSE #>>>>>>>used for trace log>>>>>>> - ) ) { - if($usage{$command}) { - my %rsp; - $rsp{data}->[0]=$usage{$command}; - $callback1->(\%rsp); - } - return; + if (!GetOptions('h|?|help' => \$HELP, + 'v|version' => \$VERSION, + 'V' => \$VERBOSE #>>>>>>>used for trace log>>>>>>> + )) { + if ($usage{$command}) { + my %rsp; + $rsp{data}->[0] = $usage{$command}; + $callback1->(\%rsp); + } + return; } #>>>>>>>used for trace log start>>>>>> - my $verbose_on_off=0; - if($VERBOSE){$verbose_on_off=1;} + my $verbose_on_off = 0; + if ($VERBOSE) { $verbose_on_off = 1; } + #>>>>>>>used for trace log end>>>>>>> - - if ($HELP) { - if($usage{$command}) { + + if ($HELP) { + if ($usage{$command}) { my %rsp; - $rsp{data}->[0]=$usage{$command}; + $rsp{data}->[0] = $usage{$command}; $callback1->(\%rsp); } return; @@ -386,271 +398,301 @@ sub preprocess_request { if ($VERSION) { my $ver = xCAT::Utils->Version(); my %rsp; - $rsp{data}->[0]="$ver"; + $rsp{data}->[0] = "$ver"; $callback1->(\%rsp); - return; + return; } - if (@ARGV==0) { - if($usage{$command}) { + if (@ARGV == 0) { + if ($usage{$command}) { my %rsp; - $rsp{data}->[0]=$usage{$command}; + $rsp{data}->[0] = $usage{$command}; $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 - my @entries = xCAT::TableUtils->get_site_attribute("sharedtftp"); - my $t_entry = $entries[0]; - - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: sharedtftp=$t_entry"); - - if ( defined($t_entry) and ($t_entry eq "0" or $t_entry eq "no" or $t_entry eq "NO")) { - # check for computenodes and servicenodes from the noderange, if so error out - my @SN; - my @CN; - xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN); - unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { - if ((@SN > 0) && (@CN >0 )) { # there are both SN and CN - my $rsp; - $rsp->{data}->[0] = - "Nodeset was run with a noderange containing both service nodes and compute nodes. This is not valid. You must submit with either compute nodes in the noderange or service nodes. \n"; - xCAT::MsgUtils->message("E", $rsp, $callback1); - 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 + my @entries = xCAT::TableUtils->get_site_attribute("sharedtftp"); + my $t_entry = $entries[0]; - $req->{'_disparatetftp'}=[1]; - if ($req->{inittime}->[0]) { - return [$req]; - } - if (@CN >0 ) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req,@_); - } - } - return [$req]; + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: sharedtftp=$t_entry"); + + if (defined($t_entry) and ($t_entry eq "0" or $t_entry eq "no" or $t_entry eq "NO")) { + + # check for computenodes and servicenodes from the noderange, if so error out + my @SN; + my @CN; + xCAT::ServiceNodeUtils->getSNandCPnodes(\@$nodes, \@SN, \@CN); + unless (($args[0] eq 'stat') or ($args[0] eq 'enact')) { + if ((@SN > 0) && (@CN > 0)) { # there are both SN and CN + my $rsp; + $rsp->{data}->[0] = +"Nodeset was run with a noderange containing both service nodes and compute nodes. This is not valid. You must submit with either compute nodes in the noderange or service nodes. \n"; + xCAT::MsgUtils->message("E", $rsp, $callback1); + return; + + } + } + + $req->{'_disparatetftp'} = [1]; + if ($req->{inittime}->[0]) { + return [$req]; + } + if (@CN > 0) { # if compute nodes broadcast to all servicenodes + return xCAT::Scope->get_broadcast_scope($req, @_); + } + } + return [$req]; } sub process_request { - $request = shift; - $callback = shift; - $::callback=$callback; - $sub_req = shift; - my $command = $request->{command}->[0]; - %breaknetbootnodes=(); - %normalnodes=(); - + $request = shift; + $callback = shift; + $::callback = $callback; + $sub_req = shift; + my $command = $request->{command}->[0]; + %breaknetbootnodes = (); + %normalnodes = (); + my @args; my @nodes; my @rnodes; - + #>>>>>>>used for trace log start>>>>>>> my %opt; - my $verbose_on_off=0; + my $verbose_on_off = 0; if (ref($::XNBA_request->{arg})) { - @args=@{$::XNBA_request->{arg}}; + @args = @{ $::XNBA_request->{arg} }; } else { - @args=($::XNBA_request->{arg}); + @args = ($::XNBA_request->{arg}); } @ARGV = @args; - GetOptions('V' => \$opt{V}); - if($opt{V}){$verbose_on_off=1;} - #>>>>>>>used for trace log end>>>>>>> + GetOptions('V' => \$opt{V}); + if ($opt{V}) { $verbose_on_off = 1; } + + #>>>>>>>used for trace log end>>>>>>> if (ref($request->{node})) { - @rnodes = @{$request->{node}}; + @rnodes = @{ $request->{node} }; } else { if ($request->{node}) { @rnodes = ($request->{node}); } } unless (@rnodes) { - if ($usage{$request->{command}->[0]}) { - $callback->({data=>$usage{$request->{command}->[0]}}); + if ($usage{ $request->{command}->[0] }) { + $callback->({ data => $usage{ $request->{command}->[0] } }); } return; } - + #if not shared tftpdir, then filter, otherwise, set up everything if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command @nodes = (); foreach (@rnodes) { if (xCAT::NetworkUtils->nodeonmynet($_)) { - push @nodes,$_; + push @nodes, $_; } else { - xCAT::MsgUtils->message("S", "$_: grub2 netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); + xCAT::MsgUtils->message("S", "$_: grub2 netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster."); } } } else { @nodes = @rnodes; } - + #>>>>>>>used for trace log>>>>>>> - my $str_node = join(" ",@nodes); - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: nodes are $str_node"); - + my $str_node = join(" ", @nodes); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: nodes are $str_node"); + # return directly if no nodes in the same network unless (@nodes) { xCAT::MsgUtils->message("S", "xCAT: grub2 netboot: no valid nodes. Stop the operation on this server."); return; } - + if (ref($request->{arg})) { - @args=@{$request->{arg}}; + @args = @{ $request->{arg} }; } else { - @args=($request->{arg}); + @args = ($request->{arg}); } - + #now run the begin part of the prescripts - unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { - $errored=0; - if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: the call is distrubuted to the service node already, so only need to handles my own children"); - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runbeginpre request"); - $sub_req->({command=>['runbeginpre'], - node=>\@nodes, - arg=>[$args[0], '-l']},\&pass_along); + unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; + if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: the call is distrubuted to the service node already, so only need to handles my own children"); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runbeginpre request"); + $sub_req->({ command => ['runbeginpre'], + node => \@nodes, + arg => [ $args[0], '-l' ] }, \&pass_along); } else { #nodeset did not distribute to the service node, here we need to let runednpre to distribute the nodes to their masters - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: nodeset did not distribute to the service node"); - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runbeginpre request"); - $sub_req->({command=>['runbeginpre'], - node=>\@rnodes, - arg=>[$args[0]]},\&pass_along); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: nodeset did not distribute to the service node"); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runbeginpre request"); + $sub_req->({ command => ['runbeginpre'], + node => \@rnodes, + arg => [ $args[0] ] }, \&pass_along); } if ($errored) { - my $rsp; - $rsp->{errorcode}->[0]=1; - $rsp->{error}->[0]="Failed in running begin prescripts.\n"; - $callback->($rsp); - return; + my $rsp; + $rsp->{errorcode}->[0] = 1; + $rsp->{error}->[0] = "Failed in running begin prescripts.\n"; + $callback->($rsp); + return; } - } - + } + #back to normal business - my $inittime=0; - if (exists($request->{inittime})) { $inittime= $request->{inittime}->[0];} - if (!$inittime) { $inittime=0;} - $errored=0; - unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue setdestiny request"); - $sub_req->({command=>['setdestiny'], - node=>\@nodes, - inittime=>[$inittime], - arg=>\@args},\&pass_along); + my $inittime = 0; + if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } + if (!$inittime) { $inittime = 0; } + $errored = 0; + unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); + $sub_req->({ command => ['setdestiny'], + node => \@nodes, + inittime => [$inittime], + arg => \@args }, \&pass_along); } if ($errored) { return; } - - my $bptab=xCAT::Table->new('bootparams',-create=>1); - my $bphash = $bptab->getNodesAttribs(\@nodes,['kernel','initrd','kcmdline','addkcmdline']); - my $chaintab=xCAT::Table->new('chain',-create=>1); - my $chainhash=$chaintab->getNodesAttribs(\@nodes,['currstate']); - my $noderestab=xCAT::Table->new('noderes',-create=>1); - my $nodereshash=$noderestab->getNodesAttribs(\@nodes,['tftpdir']); - my $mactab=xCAT::Table->new('mac',-create=>1); - my $machash=$mactab->getNodesAttribs(\@nodes,['mac']); - my $nrtab=xCAT::Table->new('noderes',-create=>1); - my $nrhash=$nrtab->getNodesAttribs(\@nodes,['servicenode','tftpserver','xcatmaster','netboot']); - my $typetab=xCAT::Table->new('nodetype',-create=>1); - my $typehash=$typetab->getNodesAttribs(\@nodes,['os','provmethod','arch','profile']); - my $linuximgtab=xCAT::Table->new('linuximage',-create=>1); - my $osimagetab=xCAT::Table->new('osimage',-create=>1); - + + my $bptab = xCAT::Table->new('bootparams', -create => 1); + my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); + my $chaintab = xCAT::Table->new('chain', -create => 1); + my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); + my $noderestab = xCAT::Table->new('noderes', -create => 1); + my $nodereshash = $noderestab->getNodesAttribs(\@nodes, ['tftpdir']); + my $mactab = xCAT::Table->new('mac', -create => 1); + my $machash = $mactab->getNodesAttribs(\@nodes, ['mac']); + my $nrtab = xCAT::Table->new('noderes', -create => 1); + my $nrhash = $nrtab->getNodesAttribs(\@nodes, [ 'servicenode', 'tftpserver', 'xcatmaster', 'netboot' ]); + my $typetab = xCAT::Table->new('nodetype', -create => 1); + my $typehash = $typetab->getNodesAttribs(\@nodes, [ 'os', 'provmethod', 'arch', 'profile' ]); + my $linuximgtab = xCAT::Table->new('linuximage', -create => 1); + my $osimagetab = xCAT::Table->new('osimage', -create => 1); + my $rc; my $errstr; - + my $tftpdir; foreach (@nodes) { my %response; if ($nodereshash->{$_} and $nodereshash->{$_}->[0] and $nodereshash->{$_}->[0]->{tftpdir}) { - $tftpdir = $nodereshash->{$_}->[0]->{tftpdir}; + $tftpdir = $nodereshash->{$_}->[0]->{tftpdir}; } else { - $tftpdir = $globaltftpdir; + $tftpdir = $globaltftpdir; } - $response{node}->[0]->{name}->[0]=$_; + $response{node}->[0]->{name}->[0] = $_; if ($args[0] eq 'stat') { - $response{node}->[0]->{data}->[0]= getstate($_,$tftpdir); + $response{node}->[0]->{data}->[0] = getstate($_, $tftpdir); $callback->(\%response); } elsif ($args[0]) { #If anything else, send it on to the destiny plugin, then setstate - my $ent = $typehash->{$_}->[0]; - my $osimgname = $ent->{'provmethod'}; - my $linuximghash=undef; - unless($osimgname =~ /^(install|netboot|statelite)$/){ - $linuximghash = $linuximgtab->getAttribs({imagename => $osimgname}, 'boottarget', 'addkcmdline'); - } - - ($rc,$errstr) = setstate($_,$bphash,$chainhash,$machash,$tftpdir,$nrhash,$linuximghash); + my $ent = $typehash->{$_}->[0]; + my $osimgname = $ent->{'provmethod'}; + my $linuximghash = undef; + unless ($osimgname =~ /^(install|netboot|statelite)$/) { + $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); + } + + ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); if ($rc) { - $response{node}->[0]->{errorcode}->[0]= $rc; - $response{node}->[0]->{errorc}->[0]= $errstr; + $response{node}->[0]->{errorcode}->[0] = $rc; + $response{node}->[0]->{errorc}->[0] = $errstr; $callback->(\%response); } } - }# end of foreach node - + } # end of foreach node + my @normalnodeset = keys %normalnodes; - my @breaknetboot=keys %breaknetbootnodes; + my @breaknetboot = keys %breaknetbootnodes; + #print "grub2 :inittime=$inittime; normalnodeset=@normalnodeset; breaknetboot=@breaknetboot\n"; my %osimagenodehash; - for my $nn (@normalnodeset){ + for my $nn (@normalnodeset) { + #record the os version for node - my $ent = $typehash->{$nn}->[0]; - my $osimage=$ent->{'provmethod'}; - if($osimage =~ /^(install|netboot|statelite)$/){ - $osimage=($ent->{'os'}).'-'.($ent->{'arch'}).'-'.($ent->{'provmethod'}).'-'.($ent->{'profile'}); + my $ent = $typehash->{$nn}->[0]; + my $osimage = $ent->{'provmethod'}; + if ($osimage =~ /^(install|netboot|statelite)$/) { + $osimage = ($ent->{'os'}) . '-' . ($ent->{'arch'}) . '-' . ($ent->{'provmethod'}) . '-' . ($ent->{'profile'}); } - push @{$osimagenodehash{$osimage}}, $nn; + push @{ $osimagenodehash{$osimage} }, $nn; } - - my $do_dhcpsetup=1; - my @entries = xCAT::TableUtils->get_site_attribute("dhcpsetup"); - my $t_entry = $entries[0]; - if (defined($t_entry) ) { - if ($t_entry =~ /0|n|N/) { $do_dhcpsetup=0; } + + my $do_dhcpsetup = 1; + my @entries = xCAT::TableUtils->get_site_attribute("dhcpsetup"); + my $t_entry = $entries[0]; + if (defined($t_entry)) { + if ($t_entry =~ /0|n|N/) { $do_dhcpsetup = 0; } } - + #Don't bother to try dhcp binding changes if sub_req not passed, i.e. service node build time unless (($args[0] eq 'stat') || ($inittime) || ($args[0] eq 'offline')) { foreach my $osimage (keys %osimagenodehash) { + #TOTO check the existence of grub2 executable files for corresponding arch - my $osimgent = $osimagetab->getAttribs({imagename => $osimage },'osarch'); - my $validarch=undef; - if($osimgent and $osimgent->{'osarch'}) - { - $validarch = $osimgent->{'osarch'}; - } + my $osimgent = $osimagetab->getAttribs({ imagename => $osimage }, 'osarch'); + my $validarch = undef; + if ($osimgent and $osimgent->{'osarch'}) + { + $validarch = $osimgent->{'osarch'}; + } + else + { + # Can not determine arch from osimage definition. This is most likely + # the case when nodeset is "shell" or "shutdown". Look at node definition, to + # figure out arch to use. + + # get nodename from osimagenodehash hash + my $node_name = $osimagenodehash{$osimage}[0]; + + # lookup node arch setting + my $node_entry = $typetab->getNodeAttribs($node_name, ['arch']); + if ($node_entry and $node_entry->{'arch'}) + { + # Extracted arch from node definition + $validarch = $node_entry->{'arch'}; + } + else + { + # At this point we can not determine architecture either + # from osimage or node definition. + my $rsp; + push @{ $rsp->{data} }, "Not able to determine architecture of node $node_name. Verify arch attribute setting.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } + } if ($validarch =~ /ppc64/i) - { - $validarch="ppc" - } - my $grub2 = "/boot/grub2/grub2.".$validarch; + { + $validarch = "ppc" + } + my $grub2 = "/boot/grub2/grub2." . $validarch; my $tftppath = $tftpdir . $grub2; unless (-e "$tftppath") { - my $rsp; - push @{$rsp->{data}}, - "stop configuration, missing $tftppath.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - return; - } + my $rsp; + push @{ $rsp->{data} }, + "stop configuration, missing $tftppath.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return; + } chdir("$tftpdir/boot/grub2/"); - foreach my $tmp_node (@{$osimagenodehash{$osimage}}) { + foreach my $tmp_node (@{ $osimagenodehash{$osimage} }) { unless (-e "grub2-$tmp_node") { - symlink("grub2.".$validarch, "grub2-$tmp_node"); + symlink("grub2." . $validarch, "grub2-$tmp_node"); } } if ($do_dhcpsetup) { if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@{$osimagenodehash{$osimage}}}, $callback); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@{ $osimagenodehash{$osimage} } }, $callback); } else { - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@{$osimagenodehash{$osimage}}},$callback); + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@{ $osimagenodehash{$osimage} } }, $callback); } } - } #end of foreach osimagenodehash + } #end of foreach osimagenodehash foreach my $tmp_node (@breaknetboot) { if (-e "$tftpdir/boot/grub2/grub2-$tmp_node") { @@ -658,44 +700,45 @@ sub process_request { } } if ($do_dhcpsetup) { - if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@breaknetboot, - arg=>['-l']},$callback); - } else { - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue makedhcp request"); - $sub_req->({command=>['makedhcp'], - node=>\@breaknetboot},$callback); - } - } - } - - #now run the end part of the prescripts - unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') - $errored=0; - if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runendpre request"); - $sub_req->({command=>['runendpre'], - node=>\@nodes, - arg=>[$args[0], '-l']},\&pass_along); - } else { #nodeset did not distribute to the service node, here we need to let runednpre to distribute the nodes to their masters - xCAT::MsgUtils->trace($verbose_on_off,"d","grub2: issue runendpre request"); - $sub_req->({command=>['runendpre'], - node=>\@rnodes, - arg=>[$args[0]]},\&pass_along); + if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@breaknetboot, + arg => ['-l'] }, $callback); + } else { + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@breaknetboot }, $callback); + } } - if ($errored) { - my $rsp; - $rsp->{errorcode}->[0]=1; - $rsp->{error}->[0]="Failed in running end prescripts\n"; - $callback->($rsp); - return; + } + + #now run the end part of the prescripts + unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') + $errored = 0; + if ($request->{'_disparatetftp'}->[0]) { #the call is distrubuted to the service node already, so only need to handles my own children + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runendpre request"); + $sub_req->({ command => ['runendpre'], + node => \@nodes, + arg => [ $args[0], '-l' ] }, \&pass_along); + } else { #nodeset did not distribute to the service node, here we need to let runednpre to distribute the nodes to their masters + xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue runendpre request"); + $sub_req->({ command => ['runendpre'], + node => \@rnodes, + arg => [ $args[0] ] }, \&pass_along); + } + if ($errored) { + my $rsp; + $rsp->{errorcode}->[0] = 1; + $rsp->{error}->[0] = "Failed in running end prescripts\n"; + $callback->($rsp); + return; } } } #---------------------------------------------------------------------------- + =head3 getNodesetStates returns the nodeset state for the given nodes. The possible nodeset states are: netboot, install, boot and discover. @@ -707,18 +750,19 @@ sub process_request { Returns: (return code, error message) =cut + #----------------------------------------------------------------------------- sub getNodesetStates { - my $noderef=shift; + my $noderef = shift; if ($noderef =~ /xCAT_plugin::grub2/) { - $noderef=shift; + $noderef = shift; } - my @nodes=@$noderef; - my $hashref=shift; + my @nodes = @$noderef; + my $hashref = shift; my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories - my %nrhash = %{$noderestab->getNodesAttribs(\@nodes,[qw(tftpdir)])}; - - if (@nodes>0) { + my %nrhash = %{ $noderestab->getNodesAttribs(\@nodes, [qw(tftpdir)]) }; + + if (@nodes > 0) { foreach my $node (@nodes) { my $tftpdir; if ($nrhash{$node}->[0] and $nrhash{$node}->[0]->{tftpdir}) { @@ -726,15 +770,15 @@ sub getNodesetStates { } else { $tftpdir = $globaltftpdir; } - my $tmp=getstate($node, $tftpdir); - my @a=split(' ', $tmp); + my $tmp = getstate($node, $tftpdir); + my @a = split(' ', $tmp); $stat = $a[0]; if (exists($hashref->{$stat})) { - my $pa=$hashref->{$stat}; + my $pa = $hashref->{$stat}; push(@$pa, $node); } else { - $hashref->{$stat}=[$node]; + $hashref->{$stat} = [$node]; } } } diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 9da8ec168..dd881b5d2 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3055,6 +3055,17 @@ sub rscan { $hash_vm2host{$vm_node_host->{node}} = $vm_node_host->{host}; } + my @maxlength; + my @rscan_header = ( + ["type", "" ], + ["name", "" ], + ["hypervisor", "" ], + ["id", "" ], + ["cpu", "" ], + ["memory", "" ], + ["nic", "" ], + ["disk", "" ]); + #operate every domain in current hypervisor foreach $dom (@doms) { my $name=$dom->get_name(); @@ -3071,16 +3082,31 @@ sub rscan { $uuid =~ s/^(..)(..)(..)(..)-(..)(..)-(..)(..)/$4$3$2$1-$6$5-$8$7/; } my $type = $domain->findnodes("/domain")->[0]->getAttribute("type"); + if (length($type) > $maxlength[0]) { + $maxlength[0] = length($type); + } my @nodeobj = $domain->findnodes("/domain/name"); if (@nodeobj and defined($nodeobj[0])) { $node = $nodeobj[0]->to_literal; } + if (length($node) > $maxlength[1]) { + $maxlength[1] = length($node); + } my $hypervisor = $hyper; + if (length($hypervisor) > $maxlength[2]) { + $maxlength[2] = length($hypervisor); + } my $id = $domain->findnodes("/domain")->[0]->getAttribute("id"); + if (length($id) > $maxlength[3]) { + $maxlength[3] = length($id); + } my @vmcpusobj = $domain->findnodes("/domain/vcpu"); if (@vmcpusobj and defined($vmcpusobj[0])) { $vmcpus = $vmcpusobj[0]->to_literal; } + if (length($vmcpus) > $maxlength[4]) { + $maxlength[4] = length($vmcpus); + } my @vmmemoryobj = $domain->findnodes("/domain/memory"); if (@vmmemoryobj and defined($vmmemoryobj[0])) { my $mem = $vmmemoryobj[0]->to_literal; @@ -3105,6 +3131,9 @@ sub rscan { $vmmemory=($mem*1024)/(1024*1024); } } + if (length($vmmemory) > $maxlength[5]) { + $maxlength[5] = length($vmmemory); + } my @vmstoragediskobjs = $domain->findnodes("/domain/devices/disk"); foreach my $vmstoragediskobj (@vmstoragediskobjs) { if (($vmstoragediskobj->getAttribute("device") eq "disk") and ($vmstoragediskobj->getAttribute("type") eq "file")) { @@ -3115,6 +3144,9 @@ sub rscan { } } } + if (length($vmstorage) > $maxlength[7]) { + $maxlength[7] = length($vmstorage); + } my @archobj = $domain->findnodes("/domain/os/type"); if (@archobj and defined($archobj[0])) { $arch = $archobj[0]->getAttribute("arch"); @@ -3133,6 +3165,9 @@ sub rscan { } } } + if (length($vmnics) > $maxlength[6]) { + $maxlength[6] = length($vmnics); + } push @{$host2kvm{$uuid}}, join( ",", $type,$node,$hypervisor,$id,$vmcpus,$vmmemory,$vmnics,$vmstorage,$arch,$mac,$vmnicnicmodel ); if ($write) { unless (exists $hash_vm2host{$node}) { @@ -3222,15 +3257,14 @@ sub rscan { if (!$stanza) { my $header; - my @rscan_header = ( - ["type", "%-8s" ], - ["name", "%-9s" ], - ["hypervisor", "%-15s"], - ["id", "%-7s" ], - ["cpu", "%-8s" ], - ["memory", "%-11s"], - ["nic", "%-8s" ], - ["disk", "%-9s" ]); + $rscan_header[0][1] = sprintf "%%-%ds",($maxlength[0]+3); + $rscan_header[1][1] = sprintf "%%-%ds",($maxlength[1]+3); + $rscan_header[2][1] = sprintf "%%-%ds",($maxlength[2]+3); + $rscan_header[3][1] = sprintf "%%-%ds",($maxlength[3]+3); + $rscan_header[4][1] = sprintf "%%-%ds",($maxlength[4]+3); + $rscan_header[5][1] = sprintf "%%-%ds",($maxlength[5]+3); + $rscan_header[6][1] = sprintf "%%-%ds",($maxlength[6]+3); + $rscan_header[7][1] = sprintf "%%-%ds",($maxlength[7]+3); foreach (@rscan_header) { $header .= sprintf ( @$_[1], @$_[0] ); } diff --git a/xCAT-server/share/xcat/ca/openssl.cnf.tmpl b/xCAT-server/share/xcat/ca/openssl.cnf.tmpl index abfe25892..e3647635c 100644 --- a/xCAT-server/share/xcat/ca/openssl.cnf.tmpl +++ b/xCAT-server/share/xcat/ca/openssl.cnf.tmpl @@ -67,7 +67,7 @@ cert_opt = ca_default # Certificate field options default_days = 7300 # how long to certify for default_crl_days= 30 # how long before next CRL -default_md = sha1 # which md to use. +default_md = sha256 # which md to use. preserve = no # keep passed DN ordering # A few difference way of specifying how similar the request should look diff --git a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist new file mode 100644 index 000000000..5c4dd377e --- /dev/null +++ b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64.pkglist @@ -0,0 +1,14 @@ +pciutils-libs +pciutils +tcl +tk +tcsh +libgcc.ppc +gcc-gfortran +createrepo +kernel-devel +python-devel +lsof +redhat-rpm-config +rpm-build +libnl diff --git a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist index a17788955..90723aa51 100644 --- a/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist +++ b/xCAT-server/share/xcat/ib/netboot/rh/ib.rhels7.ppc64le.pkglist @@ -14,4 +14,6 @@ kernel-devel gtk2 atk cairo - +gcc +createrepo +libnl diff --git a/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist new file mode 100644 index 000000000..a0979ff1a --- /dev/null +++ b/xCAT-server/share/xcat/ib/netboot/sles/ib.sles12.ppc64le.pkglist @@ -0,0 +1,10 @@ +python-libxml2 +tcsh +libatk-1_0-0 +python +tcl +lsof +libgtk-2_0-0 +tk +libnl1 +pciutils diff --git a/xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist b/xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist new file mode 100644 index 000000000..bcab162a8 --- /dev/null +++ b/xCAT-server/share/xcat/ib/netboot/ubuntu/ib.ubuntu14.ppc64le.pkglist @@ -0,0 +1 @@ +dpkg-dev diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 5520ab43b..6683a1693 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -97,7 +97,9 @@ if [ -z "$install_disk" ]; then fi # If there is kernel file, add partition's disk into disk_array - for i in $ker_dir/vmlinuz*; do + # It seems the kernel file in ubuntu and sles are named like vmlinux, but in RH it is called vmlinuz + # To check both vmlinux and vmlinuz, use regular expression "vmlinu*" to match them + for i in $ker_dir/vmlinu*; do disk_part=${partition%%[0-9]*} touch "$tmpfile$disk_part" disk_array=$disk_array"$disk_part " diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 index b34d7d012..3b36dfefe 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -20,3 +20,11 @@ do #nic name change during the install and first_reboot sed -i '/HWADDR/d' $i done + +# NetworkManager will conflict with the configuring xcat do later in postboot script, so disable it in postscript + +# There are 2 other service related to NetworkManager: NetworkManager-dispatcher and NetworkManager-wait-online +# Both of them are triggered by NetworkManager, so just disable NetworkManager here +if [ -f "/usr/lib/systemd/system/NetworkManager.service" ]; then + systemctl disable NetworkManager +fi diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist index 992097641..6ad7101c8 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist @@ -24,3 +24,4 @@ lsvpd irqbalance procps parted +xz diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist index e235bfaba..cf0538893 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist @@ -20,3 +20,4 @@ rsync rsyslog e2fsprogs parted +xz diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 81688a1be..1ece8362a 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -73,18 +73,34 @@ sub xdie { die @_; } + +#helper subroutine to get the major release number +#of a osver +sub majversion { + my $version = shift; + my $majorrel; + + if($osver =~ /^\D*(\d*)[.\d]*$/){ + $majorrel = $1; + } + + return $majorrel; +} + sub mount_chroot { my $rootimage_dir = shift; - #postinstall script of package installation - #might access the /proc, /sys and /dev filesystem - #mount them from host read-only - system("mkdir -p $rootimage_dir/proc"); - system("mount proc $rootimage_dir/proc -t proc -o ro"); - system("mkdir -p $rootimage_dir/sys"); - system("mount sysfs $rootimage_dir/sys -t sysfs -o ro"); - system("mkdir -p $rootimage_dir/dev"); - system("mount devtmpfs $rootimage_dir/dev -t devtmpfs -o ro"); + #postinstall script of some packages might access the /proc, /sys and /dev filesystem + #For Redhat7 or above, mount these directories readonly from host to avoid error messages + #For Redhat6 or below, mount these directories might introduce error messages + if(majversion($osver) > 6){ + system("mkdir -p $rootimage_dir/proc"); + system("mount proc $rootimage_dir/proc -t proc -o ro"); + system("mkdir -p $rootimage_dir/sys"); + system("mount sysfs $rootimage_dir/sys -t sysfs -o ro"); + system("mkdir -p $rootimage_dir/dev"); + system("mount devtmpfs $rootimage_dir/dev -t devtmpfs -o ro"); + } } @@ -92,9 +108,11 @@ sub mount_chroot { sub umount_chroot { my $rootimage_dir = shift; - system("umount $rootimage_dir/proc"); - system("umount $rootimage_dir/sys"); - system("umount $rootimage_dir/dev"); + if(majversion($osver) >6){ + system("umount $rootimage_dir/proc"); + system("umount $rootimage_dir/sys"); + system("umount $rootimage_dir/dev"); + } } #check whether a dir is NFS mounted @@ -969,14 +987,19 @@ sub mkinitrd_dracut { $perm = (stat("$fullpath/$dracutdir/installkernel"))[2]; chmod($perm&07777, "$dracutmpath/installkernel"); + my $dracutmodulelist=" xcat nfs base network kernel-modules "; + if (-d glob($dracutmoduledir."[0-9]*fadump")){ + $dracutmodulelist .=" fadump "; + + } + + if ($dracutver >= "033") { + $dracutmodulelist .= " syslog "; + } + # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - if (-d glob($dracutmoduledir."[0-9]*fadump")){ - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules fadump syslog"\n}; - } - else{ - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules syslog"\n}; - } + print $DRACUTCONF qq{dracutmodules+="$dracutmodulelist"\n}; print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; close $DRACUTCONF; } else { diff --git a/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle b/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle index 9a4fc47a9..4b67d0bc1 100644 --- a/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle +++ b/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle @@ -241,3 +241,16 @@ switchdiscover_range_x switchdiscover_range_z switchdiscover_range_z_V nodeset_check_warninginfo +rpower_stop +rpower_start +rpower_state +rpower_restart +rpower_pause +rpower_unpause +mkdocker_h +mkdocker_command +rmdocker_h +rmdocker_command +rmdocker_f_command +lsdocker_h_command +lsdocker_l_command diff --git a/xCAT-test/autotest/testcase/dockercommand/cases0 b/xCAT-test/autotest/testcase/dockercommand/cases0 new file mode 100644 index 000000000..f3bd01e96 --- /dev/null +++ b/xCAT-test/autotest/testcase/dockercommand/cases0 @@ -0,0 +1,279 @@ +start:rpower_stop +description:stop a created docker instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN stop +check:rc==0 +check:ouptut=~container already stopped +cmd:rpower $$DOCKERCN restart +check:ouptut=~success +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~running +cmd:rpower $$DOCKERCN stop +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~exited +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:rpower_start +description:start a created docker instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~created +cmd:rpower $$DOCKERCN start +check:rc==0 +check:output=~success +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~running +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_state +description:get state of the instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~created +cmd:rpower $$DOCKERCN restart +check:rc==0 +check:output=~success +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~running +cmd:rpower $$DOCKERCN stop +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~exited +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_restart +description:restart a created docker instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~created +cmd:rpower $$DOCKERCN restart +check:rc==0 +check:output=~success +cmd:sleep 6 +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:sleep 6 +cmd:rpower $$DOCKERCN restart +check:rc==0 +check:output=~success +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_pause +decription:pause all processes in the instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN pause +check:rc!=0 +check:output=~ Cannot pause container $$DOCKERCN +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rpower $$DOCKERCN pause +check:rc==0 +cmd:rpower $$DOCKERCN state +check:output=~paused +cmd:rpower $$DOCKERCN unpause +check:rc==0 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end + +start:rpower_unpause +description:unpause all processes in the instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rpower $$DOCKERCN pause +check:ouptut=~paused +cmd:rpower $$DOCKERCN unpause +check:rc==0 +check:output=~success +cmd:sleep 6 +cmd:rpower $$DOCKERCN state +check:output=~running +cmd:sleep 6 +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:mkdocker_h +description:output usage for mkdocker +cmd:mkdocker -h +check:rc==0 +check:output=~Usage: mkdocker +end +start:mkdocker_command +description:create docker instance image should be ubuntu and command should be bash here +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:lsdocker $$DOCKERCN +check:rc==0 +check:output=~$$DOCKERIMAGE +check:output=~$$DOCKERCOMMAND +cmd:rpower $$DOCKERCN state +check:rc==0 +check:output=~$$DOCKERCN: created +cmd:rpower $$DOCKERCN start +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:xdsh $$DOCKERHOST "docker ps -l" +check:output=~$$DOCKERCN +check:rc==0 +cmd:ping $$DOCKERCN -c 3 +check:output=~64 bytes from $$DOCKERCN +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:rmdocker_h +description:output usage for rmdocker +cmd:rmdocker -h +check:rc==0 +check:output=~Usage: rmdocker +end +start:rmdocker_command +description:remove docker instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:lsdocker $$DOCKERCN +check:rc==0 +cmd:rmdocker $$DOCKERCN +check:rc==0 +cmd:lsdocker -l $$DOCKERCN +check:rc!=0 +check:output=~ Error: No such container +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:rmdocker_f_command +description:force to remove docker instance +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:lsdocker $$DOCKERCN +check:rc==0 +cmd:rpower $$DOCKERCN start +check:rc==0 +cmd:rmdocker $$DOCKERCN +chec:rc!=0 +check:output=~Stop the container before attempting removal or use -f +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +check:output=~$$DOCKERCN: success +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end +start:lsdocker_h_command +description:output usage for lsdocker +cmd:lsdocker -h +check:rc==0 +check:output=~Usage: lsdocker +end +start:lsdocker_l_command +description:list docker instance info +cmd:chdef $$DOCKERCN dockerhost=$$DOCKERHOST:2375 dockercpus=1 ip=$$DOCKERCONIP dockermemory=4096 groups=docker,all mgt=docker +check:rc==0 +cmd:makehosts $$DOCKERCN +check:rc==0 +cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true}" +check:rc==0 +cmd:lsdocker -l $$DOCKERCN +check:rc==0 +check:output=~$$DOCKERCN +cmd:rmdocker $$DOCKERCN -f +check:rc==0 +cmd:makehosts -d $$DOCKERCN +check:rc==0 +cmd:rmdef $$DOCKERCN +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le similarity index 89% rename from xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le rename to xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index fa08387d9..6e9c128d4 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_p8le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -1,10 +1,9 @@ start:Diskless_installation_flat_p8_le os:Linux -stop=yes cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 20G ; fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f && mkvm $$CN ; fi check:rc==0 cmd:makedns -n check:rc==0 @@ -26,6 +25,8 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi +check:rc==0 cmd:rpower $$CN boot check:rc==0 cmd:sleep 200 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le similarity index 99% rename from xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le rename to xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index 577497c82..749938977 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_p8le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -1,6 +1,5 @@ start:Full_installation_flat_p8_le os:Linux -stop=yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index de138e5de..428b322fb 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -1,6 +1,5 @@ start:reg_linux_SN_installation_hierarchy os:Linux -stop=yes cmd:chtab key=nameservers site.value="" check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 0cdc0239a..411c11e79 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,12 +1,11 @@ start:reg_linux_diskfull_installation_flat os:Linux -stop=yes 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:if [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f && mkvm $$CN ; fi cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -14,7 +13,7 @@ check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN cmd:sleep 20 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then getmacs -D $$CN; fi +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 @@ -32,10 +31,12 @@ check:rc==0 cmd:lsdef $$CN |grep provmethod check:rc==0 check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi +check:rc==0 +cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 1200;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then sleep 600;else sleep 180;fi +cmd:if [[ "__GETNODEATTR($$CN,mgt)__" =~ "ipmi" ]]; then sleep 1800;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then sleep 1200;else sleep 600;fi cmd:lsdef -l $$CN | grep status @@ -52,4 +53,8 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index 2e90b4525..ef0b19a63 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,6 +1,5 @@ start:reg_linux_diskfull_installation_hierarchy os:Linux -stop=yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index c34ad4f44..f6c69169d 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,6 +1,5 @@ start:reg_linux_diskless_installation_flat os:Linux -stop=yes cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 @@ -63,6 +62,10 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 check:output=~on / type tmpfs +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index abb6fda6a..9119eee1a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,6 +1,5 @@ start:reg_linux_diskless_installation_hierarchy os:Linux -stop=yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index af9d3a8ec..780d32e3b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,6 +1,5 @@ start:reg_linux_statelite_installation_flat os:Linux -stop=yes cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 @@ -117,6 +116,10 @@ cmd:xdsh $$CN mount check:rc==0 check:output=~/nodedata/$$CN on /.statelite/persistent check:output=~rootfs on / type tmpfs +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy index 0f85312c9..f9de59ccd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy @@ -1,5 +1,6 @@ start:reg_linux_statelite_installation_hierarchy os:Linux +stop:yes cmd:MNIP=`cat /etc/hosts|grep $$MN|awk '{print $1}'`;sed -i "s:nameserver .*:nameserver $MNIP:g" /etc/resolv.conf diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 3bc3dd622..28260fdc0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,6 +1,5 @@ start:reg_linux_statelite_installation_hierarchy_by_nfs os:Linux -stop=yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 3eaff6341..c9b3af64f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,6 +1,5 @@ start:reg_linux_statelite_installation_hierarchy_by_ramdisk os:Linux -stop=yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index 62980140f..c642ca7b3 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -1,10 +1,9 @@ start:Ubuntu_diskless_installation_flat_x86_vm os:Linux -stop=yes cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f -p && mkvm $$CN -s 15G; fi +cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$CN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$CN -f && mkvm $$CN ; fi cmd:makedns -n check:rc==0 cmd:makedhcp -n diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm index 6cf90d2b6..e25d55a4c 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm @@ -1,6 +1,5 @@ start:Ubuntu_full_installation_flat_x86_vm os:Linux -stop=yes cmd:copycds $$ISO check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker new file mode 100644 index 000000000..ced2f1231 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -0,0 +1,54 @@ +start:Full_installation_flat_docker +os:Linux +cmd:copycds $$ISO +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,arch)__" != "ppc64" ]];then chdef -t node -o $$DOCKERHOST vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$DOCKERHOST -f && mkvm $$DOCKERHOST ; fi +check:rc==0 +cmd:makehosts $$DOCKERHOST +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:sleep 60 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:makeconservercf $$DOCKERHOST +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$DOCKERHOST +check:output=~$$DOCKERHOST +cmd: mkdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost -u profile=compute provmethod=install +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'` ; chdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost otherpkgdir="https://apt.dockerproject.org/repo ubuntu-trusty main,http://cz.archive.ubuntu.com/ubuntu trusty main" otherpkglist="/install/custom/ubuntu$ver/ubuntu"$ver"_docker.pkglist" osdistroname="__GETNODEATTR($$DOCKERHOST,os)__ ";fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'` ; mkdir -p /install/custom/ubuntu$ver/ ; chdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost otherpkglist="/install/custom/ubuntu$ver/ubuntu"$ver"_docker.pkglist" pkglist="/install/custom/ubuntu$ver/ubuntu$ver.pkglist";fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'` ;for i in openssh-server ntp gawk nfs-common snmpd bridge-utils; do cat /install/custom/ubuntu$ver/ubuntu$ver.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /install/custom/ubuntu$ver/ubuntu$ver.pkglist; fi done;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$DOCKERHOST,os)__" =~ "ubuntu14.04" ]];then ver=`cat /etc/*-release |grep "VERSION_ID"| awk -F '"' '{print $2}'| awk -F"." '{printf "%s%s\n",$1,$2}'`; for i in docker-engine;do cat /install/custom/ubuntu$ver/ubuntu"$ver"\_docker.pkglist |grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /install/custom/ubuntu$ver/ubuntu"$ver"\_docker.pkglist;fi done;fi +check:rc==0 +cmd: chdef $$DOCKERHOST -p postbootscripts="setupdockerhost mynet0=$$MYNET0VALUE@$$DOCKERHOSIP:$$NICNAME" +check:rc==0 +cmd:nodeset $$DOCKERHOST osimage=__GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost +check:rc==0 +cmd:rpower $$DOCKERHOST boot +check:rc==0 +cmd:sleep 40 +cmd:lsdef -l $$DOCKERHOST | grep status +cmd:sleep 3600 +check:rc==0 +cmd:ping $$DOCKERHOST -c 3 +check:output=~64 bytes from $$DOCKERHOST +check:rc==0 +cmd:lsdef -l $$DOCKERHOST | grep status +check:output=~booted +cmd:xdsh $$DOCKERHOST date +check:rc==0 +cmd:xdsh $$DOCKERHOST "docker -v" +check:output=~Docker version +check:rc==0 +cmd:xdsh $$DOCKERHOST "docker pull $$DOCKERIMAGE" +check:rc==0 +cmd:rmdef -t osimage -o __GETNODEATTR($$DOCKERHOST,os)__-__GETNODEATTR($$DOCKERHOST,arch)__-install-dockerhost +check:rc==0 +end diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index 0eee2be6a..83d9a8eb9 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -99,13 +99,6 @@ fi " >> /xcatpost/mypostscript.post fi -stopservice NetworkManager -stopservice NetworkManager-dispatcher -stopservice NetworkManager-wait-online - -disableservice NetworkManager -disableservice NetworkManager-dispatcher -disableservice NetworkManager-wait-online chmod +x /xcatpost/mypostscript.post if [ -x /xcatpost/mypostscript.post ];then msgutil_r "$MASTER_IP" "info" "running /xcatpost/mypostscript.post" "/var/log/xcat/xcat.log"