2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-23 17:22:47 +00:00

Merge pull request #5854 from xcat2/master

Merge master to 2.14 for 2.14.5 release(1)
This commit is contained in:
zet809
2018-11-30 18:17:56 +08:00
committed by GitHub
408 changed files with 4779 additions and 2342 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
os: linux
dist: trusty
dist: xenial
sudo: required
before_install:
- sudo apt-get install -y git reprepro devscripts debhelper libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common
- sudo apt-get install -y git fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common
- perl -v
- echo "yes" | sudo cpan -f -i Capture::Tiny
#- echo "yes" | sudo cpan -f -i Capture::Tiny
script:
- echo $TRAVIS_BUILD_ID
+1 -1
View File
@@ -1 +1 @@
2.14.4
2.14.5
+1
View File
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
+17 -16
View File
@@ -19,6 +19,13 @@
# of the FRS area.
# VERBOSE=1 - Set to 1 to see more VERBOSE output
# This script should only be run on RPM based machines
# This test is not foolproof, but at least tries to detect
if [ `/bin/rpm -q -f /bin/rpm >/dev/null 2>&1; echo $?` != 0 ]; then
echo "ERROR: This script should only be executed on a RPM based Operation System."
exit 1
fi
# you can change this if you need to
USER=xcat
TARGET_MACHINE=xcat.org
@@ -49,6 +56,16 @@ if [ ! -d $GSA ]; then
exit 1
fi
REQPKG=("rpm-sign" "createrepo")
for pkg in ${REQPKG[*]}; do
if [ `rpm -q $pkg >> /dev/null; echo $?` != 0 ]; then
echo "ERROR: $pkg is required to successfully create the xcat-deps package. Install and rerun."
exit 1
else
echo "Checking for package=$pkg ..."
fi
done
# set grep to quiet by default
GREP="grep -q"
if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then
@@ -58,14 +75,10 @@ if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then
fi
# this is needed only when we are transitioning the yum over to frs
# YUMREPOURL1="http://xcat.org/yum"
# YUMREPOURL2="http://xcat.org/files/yum"
if [ "$FRSYUM" != 0 ]; then
YUMDIR="$FRS/repos"
# YUMREPOURL="$YUMREPOURL2"
else
YUMDIR=htdocs
# YUMREPOURL="$YUMREPOURL1"
fi
cd `dirname $0`
@@ -127,18 +140,6 @@ if [ "$OSNAME" != "AIX" ]; then
# Modify xcat-dep.repo files to point to the correct place
echo "===> Modifying the xcat-dep.repo files to point to the correct location..."
# 10/01/2015 - vkhu
# The URLs have been updated in GSA, this section is not needed at the moment
#
#if [ "$FRSYUM" != 0 ]; then
# newurl="$YUMREPOURL2"
# oldurl="$YUMREPOURL1"
#else
# newurl="$YUMREPOURL1"
# oldurl="$YUMREPOURL2"
#fi
#
#sed -i -e "s|=$oldurl|=$newurl|g" `find . -name "xcat-dep.repo" `
fi
if [ "$OSNAME" == "AIX" ]; then
@@ -22,18 +22,19 @@ An example ``localdisk`` configuration file: ::
enable=yes
enablepart=no
[disk]
dev=/dev/sdb
clear=yes
parts=100M-200M,1G-2G
[disk]
dev=/dev/sda
clear=yes
parts=10,20,30
[disk]
dev=/dev/sdb
clear=yes
parts=100M-200M,1G-2G
[disk]
dev=/dev/sdc
ptype=gpt
clear=yes
parts=10,20,30
@@ -53,6 +54,7 @@ The ``[disk]`` section is used to configure how to partition a hard disk:
* dev: The path of the device file.
* clear: If set to ``yes`` it will clear all the existing partitions on this disk.
* ptype: The partition table type of the disk. For example, ``msdos`` or ``gpt``, and ``msdos`` is the default.
* fstype: The file system type for the new created partitions. ``ext3`` is the default.
* parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``<startpoint>-<endpoint>`` or ``<percentage of the disk>``. For example, you could set it to ``100M-10G`` or ``50``. If set to ``50``, 50% of the disk space will be assigned to that partition.
@@ -8,3 +8,4 @@ Advanced Operations
rvitals.rst
rflash/index.rst
rspconfig.rst
reventlog.rst
@@ -0,0 +1,14 @@
``reventlog`` - Remote Event Log of Service Processors
======================================================
See :doc:`reventlog manpage </guides/admin-guides/references/man1/reventlog.1>` for more information.
The ``reventlog`` command can be used to display and clear event log information on the service processor, or Baseboard Management Controller (BMC), of a physical machine.
For example, to display all event log entries for node ``cn5``: ::
reventlog cn5
To clear all event log entries for node ``cn5``: ::
reventlog cn5 clear
@@ -47,6 +47,7 @@ This is the minimal list of files needed, you can add additional files to the li
"ALL","/etc/ntp.conf","tmpfs",,
"ALL","/etc/rsyslog.conf","tmpfs",,
"ALL","/etc/rsyslog.conf.XCATORIG","tmpfs",,
"ALL","/etc/rsyslog.d/","tmpfs",,
"ALL","/etc/udev/","tmpfs",,
"ALL","/etc/ntp.conf.predhclient","tmpfs",,
"ALL","/etc/resolv.conf","tmpfs",,
@@ -393,9 +393,12 @@ site Attributes:
entries generated by 'makehosts' will put the FQDN before the PQDN(Partially
Qualified Domain Name). Otherwise, the original behavior will be performed.
hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be
included hierarchically. Attribute values for all the node's groups
hierarchicalattrs: A comma delimited list of table attributes(e.g. postscripts, postbootscripts)
that will be included hierarchically. Attribute values for all the node's groups
will be applied to the node in the groups' order except the repeat one.
By default, comma is used to combine the values. But some columns use different
delimiter, to specify delimiter for those columns as format of 'column:delimiter'.
dbtracelevel: The trace level for the database access log. To activate this setting, please.
restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .
ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print $2}' | xargs kill -HUP
@@ -21,7 +21,7 @@ Name
\ **rinstall**\ \ *noderange*\ [\ **boot**\ | \ **shell**\ | \ **runcmd=**\ \ *command*\ ] [\ **-c | -**\ **-console**\ ] [\ **-V | -**\ **-verbose**\ ]
\ **rinstall**\ \ *noderange*\ \ **osimage**\ [=\ *imagename*\ ] [\ **-**\ **-noupdateinitrd**\ ][\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ]
\ **rinstall**\ \ *noderange*\ [\ **osimage**\ [=\ *imagename*\ ]] [\ **-**\ **-noupdateinitrd**\ ][\ **-**\ **-ignorekernelchk**\ ] [\ **-c | -**\ **-console**\ ] [\ **-u | -**\ **-uefimode**\ ] [\ **-V | -**\ **-verbose**\ ]
\ **rinstall**\ \ *noderange*\ \ **runimage=**\ \ *task*\
@@ -35,9 +35,9 @@ Name
\ **rinstall**\ is a convenience command to begin OS provision on a noderange.
If \ **osimage**\ =\ *imagename*\ is specified or \ **osimage**\ is specified and nodetype.provmethod=\ **osimage**\ is set, provision the noderange with the osimage specified/configured.
If \ **osimage**\ =\ *imagename*\ is specified or \ **osimage**\ is specified and nodetype.provmethod=\ *osimage*\ is set, provision the noderange with the osimage specified/configured. If no task specified, default is \ **osimage**\ .
If \ **-c**\ is specified, it will then run \ **rcons**\ on the node. This is allowed only if one node is in the noderange. If consoles are needed on multiple nodes, see winstall(8)|winstall.8.
If \ **-c**\ is specified, \ **rinstall**\ will run \ **rcons**\ on the node. This is allowed only if one node is in the noderange. If consoles are needed on multiple nodes, see winstall(8)|winstall.8.
***************
@@ -46,18 +46,25 @@ Stop xCAT Service
Remove xCAT Files
-----------------
1. Remove the xCAT RPMs
1. Remove xCAT Packages
There is no easy way to identify all xCAT packages. For packages shipped by xCAT, you can remove them by using the commands below.
To automatically remove all xCAT packages, run the following command ::
[RHEL and SLES] ::
/opt/xcat/share/xcat/tools/go-xcat uninstall
yum remove '*xcat*'
yum remove '*xCAT*'
There is no easy way to identify all xCAT packages. For packages shipped by xCAT, you can manually remove them by using one of the commands below.
[RHEL] ::
yum remove conserver-xcat elilo-xcat goconserver grub2-xcat ipmitool-xcat perl-xCAT syslinux-xcat xCAT xCAT-SoftLayer xCAT-buildkit xCAT-client xCAT-confluent xCAT-csm xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-openbmc-py xCAT-probe xCAT-server xnba-undi yaboot-xcat
[SLES] ::
zypper remove conserver-xcat elilo-xcat goconserver grub2-xcat ipmitool-xcat perl-xCAT syslinux-xcat xCAT xCAT-SoftLayer xCAT-buildkit xCAT-client xCAT-confluent xCAT-csm xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-openbmc-py xCAT-probe xCAT-server xnba-undi yaboot-xcat
[Ubuntu] ::
dpkg -l | awk '/xcat/ { print $2 }'
apt-get remove conserver-xcat elilo-xcat goconserver grub2-xcat ipmitool-xcat perl-xcat syslinux-xcat xcat xcat-buildkit xcat-client xcat-confluent xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-probe xcat-server xcat-test xcat-vlan xcatsn xnba-undi
To do an even more thorough cleanup, use links below to get a list of RPMs installed by xCAT. Some RPMs may not to be installed in a specific environment.
@@ -5,4 +5,3 @@ Known Issues
:maxdepth: 2
genesis_base.rst
openbmc/index.rst
@@ -1,7 +0,0 @@
#4264 - rpower command intermittently reports 503: Service Unavailable Error
============================================================================
Issue `#4264 <https://github.com/xcat2/xcat-core/issues/4264>`_
In attempt to improve the performance of the REST calls to OpenBMC and reduce the time spent in a timeout, we fail too soon here before the BMC has a chance to respond.
@@ -1,17 +0,0 @@
SW402273 - Unable to tell the firmware level that is actually running on the node via REST
==========================================================================================
* **Issue:** `SW402273 <https://w3.rchland.ibm.com/projects/bestquest/?defect=SW402273>`_
* **Reported:** 1738B (ibm-v1.99.10-0-r7)
* **Fixed:** 1740B (ibm-v1.99.10-0-r13)
**Issue:**
Until 1740B firmware (> ibm-v1.99.10-0-r13), there's no method provided by OpenBMC to indicate the active running firmware on the node. Until the BMC is rebooted or the HOST is rebooted, the Active firmware may or may not really be running.
If you are running a version that prints the following message from ``rflash``: ::
cn01: WARNING, The current firmware is unable to detect running firmware version.
Please update the BMC to a version higher than ibm-v1.99.10-0-r13.
@@ -1,26 +0,0 @@
SW404161 - Firmware do not self extract tar, causing rflash cannot find ID to activate
======================================================================================
* **Issue:** `SW404161 <https://w3.rchland.ibm.com/projects/bestquest/?defect=SW404161>`_
* **Reported:** 1738A (ibm-v1.99.10-0-r7)
* **Fixed:** 1742D (ibm-v1.99.10-0-113-r10)
**Issue:**
Firmware is not extracted and could not be found by rflash to activate ::
[root@c650mnp03 ~]# rflash c650f07p27 obmc-phosphor-image-witherspoon.ubi.mtd.tar -a
c650f07p27: Uploading /root/obmc-phosphor-image-witherspoon.ubi.mtd.tar ...
c650f07p27: Firmware upload successful. Attempting to activate firmware: ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d
c650f07p27: Could not find ID for firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d to activate, waiting 10 seconds and retry...
c650f07p27: Could not find ID for firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d to activate, waiting 10 seconds and retry...
c650f07p27: Could not find ID for firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d to activate, waiting 10 seconds and retry...
c650f07p27: Could not find ID for firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d to activate, waiting 10 seconds and retry...
c650f07p27: Could not find ID for firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d to activate, waiting 10 seconds and retry...
c650f07p27: Could not find ID for firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d to activate, waiting 10 seconds and retry...
c650f07p27: Error: Could not find firmware ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d after waiting 60 seconds.
**Work-around:** Use one of the following methods:
* Reboot the BMC before flashing firmware: ``rpower <> bmcreboot``
* ssh into bmc and run: ``systemctl restart xyz.openbmc_project.Software.Version.service``
@@ -1,84 +0,0 @@
SW406771 - Duplicate FW ID or 2 BMC firmware active at the same time
====================================================================
* **Issue:** `SW407037 <https://w3.rchland.ibm.com/projects/bestquest/?defect=SW407037>`_
* **Reported:** 1740A (ibm-v1.99.10-0-r11-0-g9c65260)
* **Fixed:** 1742 or higher
**Issue:**
At some point after 1740A firmware, ``ibm-v1.99.10-0-r11-0-g9c65260``, the hashing algorithm to create the ID on the BMC was chagned by the Firmware team. This allows for the same firmware to potentially have two different IDs resulting in two active running BMC firmware.
**Work-around**
Upgrade from 1740A
------------------
If you are running 1740A, you will need to get two BMC firmware levels from your IBM representative.
This example will cover flashing from 1740A to 1742D, using 1742C as the recovery flash level.
#. Identify the issue where the IDs are not using the correct hash ::
mid05tor12cn13: ID Purpose State Version
mid05tor12cn13: -------------------------------------------------------
mid05tor12cn13: 9e55358e BMC Active(*) ibm-v1.99.10-0-r11-0-g9c65260
mid05tor12cn13: 6e71e1af BMC Ready ibm-v1.99.10-113-g65edf7d-r10-0-gcdf7635 <--- bad hash for 1742D
mid05tor12cn16: ID Purpose State Version
mid05tor12cn16: -------------------------------------------------------
mid05tor12cn16: efc8a851 BMC Ready ibm-v1.99.10-113-g65edf7d-r10-0-gcdf7635 <--- correct hash for 1742D
mid05tor12cn16: b48d27e1 BMC Active(*) ibm-v1.99.10-113-g65edf7d-r3-0-g9e4f715
#. Flash up to 1742D, activate and reboot: ::
mid05tor12cn13: ID Purpose State Version
mid05tor12cn13: -------------------------------------------------------
mid05tor12cn13: 9e55358e BMC Active ibm-v1.99.10-0-r11-0-g9c65260
mid05tor12cn13: 221d9020 Host Active(*) IBM-witherspoon-redbud-ibm-OP9_v1.19_1.33
mid05tor12cn13: 6e71e1af BMC Active(*) ibm-v1.99.10-113-g65edf7d-r10-0-gcdf7635 <--- bad hash, active
mid05tor12cn13:
#. Flash down to 1742C, activate and reboot: ::
mid05tor12cn13: ID Purpose State Version
mid05tor12cn13: -------------------------------------------------------
mid05tor12cn13: 9e55358e BMC Active ibm-v1.99.10-0-r11-0-g9c65260
mid05tor12cn13: 221d9020 Host Active(*) IBM-witherspoon-redbud-ibm-OP9_v1.19_1.33
mid05tor12cn13: 6e71e1af BMC Active(*) ibm-v1.99.10-113-g65edf7d-r10-0-gcdf7635
mid05tor12cn13: f6590ce0 BMC Active(+) ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d <--- 1742C
mid05tor12cn13:
#. Delete the bad hash firmware: ``rflash <node> -d 6e71e1af``
**Note:** This is optional because the BMC only allows 2 firmware max, so it would get pushed out.
#. Flash back up to 1742D (with correct hash), activate and reboot: ::
mid05tor12cn13: ID Purpose State Version
mid05tor12cn13: -------------------------------------------------------
mid05tor12cn13: 221d9020 Host Active(*) IBM-witherspoon-redbud-ibm-OP9_v1.19_1.33
mid05tor12cn13: efc8a851 BMC Active(*) ibm-v1.99.10-113-g65edf7d-r10-0-gcdf7635 <--- good hash
mid05tor12cn13: f6590ce0 BMC Active ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d
mid05tor12cn13:
Two active BMCs
---------------
If you have two active BMCs::
[root@mgt03 ~]# rflash f7n02 -l
f7n02: ID Purpose State Version
f7n02: -------------------------------------------------------
f7n02: b5273d71 BMC Active(*) ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d
f7n02: 30ee1c48 Host Active(*) IBM-witherspoon-ibm-OP9_v1.19_1.112
f7n02: 4f33e0f4 Host Failed(+) IBM-witherspoon-ibm-OP9_v1.19_1.109
f7n02: f6590ce0 BMC Active(*) ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d
f7n02:
There's no way to de-activate one manually, recover by doing the following:
#. Flash the BMC to the previous level of the firmware and reboot BMC
#. Delete the duplicate firmware using ``rflash <node> -d <ID>``
#. Re-flash the BMC to the target level and reboot the BMC.
@@ -1,38 +0,0 @@
SW407037 - bmcsetup does not successfully configure the IP (Sev1)
=================================================================
* **Issue:** `SW407037 <https://w3.rchland.ibm.com/projects/bestquest/?defect=SW407037>`_
* **Reported:** 1742C (ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d)
* **Fixed:** Fixed in xCAT after 11/07/17 `#4242 <https://github.com/xcat2/xcat-core/issues/4242>`_
**Issue:**
OpenBMC firmware has problems with ipmi inband support of the ``access on`` comamnd and the work around is to use the ``raw 0x06 0x40`` instead. In early Sept, we switched to using ``access on`` because the implementation looked like it was working, since then we have found some issues with it and recommendation is to revert back to the raw command.
See related issues describing potential problems:
* https://github.com/openbmc/openbmc/issues/2493
* https://github.com/openbmc/openbmc/issues/2492
This problem is very severe because if the network is not configured correctly, the access to the BMC is lost.
**Work-around**
Use one of the following work arounds:
#. Install a version of xCAT built after November, 07, 2017 which includes the fix. (**Recommended**)
#. Manually patch bmcsetup using changes in PR: https://github.com/xcat2/xcat-core/pull/4247, then run ``mknb ppc64``
#. Patch the system with provided patch:
#. Download patch file: https://github.com/xcat2/xcat-core/files/1451181/bmcsetup.4242.patch.txt
#. If file name is ``/tmp/bmcsetup.4242.patch.txt``
#. ``cd /opt/xcat/share/xcat/netboot/genesis/ppc64/fs/usr/bin``
#. ``patch -p0 < /tmp/bmcsetup.4242.patch.txt``
#. ``mknb ppc64``
@@ -1,47 +0,0 @@
OpenBMC Management Issues
=========================
xCAT
----
2.13.8
``````
Please see the `2.13.8 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.8_Release_Notes>`_ for the full list of known issues.
.. toctree::
:maxdepth: 2
2_13_8.rst
Firmware
--------
The following versions indicate the level of firmware the issue was reported.
1742C - ibm-v1.99.10-113-g65edf7d-r8-0-g713d86d
```````````````````````````````````````````````
.. toctree::
:maxdepth: 1
SW407037.rst
1740A - ibm-v1.99.10-0-r11
``````````````````````````
.. toctree::
:maxdepth: 1
SW406771.rst
1738A - ibm-v1.99.10-0-r7
``````````````````````````
.. toctree::
:maxdepth: 1
SW404161.rst
SW402273.rst
+7 -1
View File
@@ -232,7 +232,8 @@ sub submit_request {
$pclient = IO::Socket::INET6->new(
%connargs,
);
} else {
}
unless ($pclient) {
$pclient = IO::Socket::INET->new(
PeerAddr => $xcathost,
Timeout => 15,
@@ -1036,6 +1037,11 @@ sub populate_site_hash {
foreach (@records) {
$::XCATSITEVALS{ $_->{key} } = $_->{value};
}
unless (exists($::XCATSITEVALS{'httpport'}) and ($::XCATSITEVALS{'httpport'} ne "")){
$::XCATSITEVALS{'httpport'}="80";
}
}
+128 -87
View File
@@ -92,19 +92,20 @@ sub getObjectsOfType
}
# if this is type "group" we need to check the nodelist table
my @nodeGroupList = ();
if ($type eq 'group') {
my $table = "nodelist";
my %ext_groups = ();
my @TableRowArray = xCAT::DBobjUtils->getDBtable($table);
foreach (@TableRowArray) {
my @tmplist = split(',', $_->{'groups'});
push(@nodeGroupList, @tmplist);
}
foreach my $n (@nodeGroupList) {
if (!grep(/^$n$/, @objlist)) {
push(@objlist, $n);
foreach my $r (@TableRowArray) {
my @tmplist = split(',', $r->{'groups'});
foreach (@tmplist) {
$ext_groups{$_} = 1 unless exists($ext_groups{$_}) ;
}
}
foreach (@objlist) {
$ext_groups{$_} = 1 unless exists($ext_groups{$_}) ;
}
@objlist = sort keys %ext_groups;
}
@{ $::saveObjList{$type} } = @objlist;
@@ -142,7 +143,6 @@ sub getobjattrs
my $class = shift;
my $ref_hash = shift;
my @attrs;
# The $attrs is an optional argument
if (ref $_[0]) {
@attrs = @{ shift() };
@@ -164,35 +164,18 @@ sub getobjattrs
# go through each object type and look up all the info for each object
foreach my $objtype (keys %objtypelist) {
# only do node type for now
if ($objtype eq 'node') {
# only do node and nodegroup type for now
if ($objtype eq 'node' || $objtype eq 'group') {
# find the list of tables and corresponding attrs
# - for this object type
# get the object type decription from Schema.pm
my $datatype = $xCAT::Schema::defspec{$objtype};
foreach my $this_attr (@{ $datatype->{'attrs'} }) {
my $attr = $this_attr->{attr_name};
if (scalar(@attrs) > 0) { # Only query specific attributes
if (!grep(/^$attr$/, @attrs)) {
next; # This attribute is not needed
}
}
# table_attr is the attr that actually appears in the
# table which could possibly be different then the attr
# used in the node def
# ex. 'nodetype.arch'
my ($lookup_table, $table_attr) = split('\.', $this_attr->{tabentry});
if (!grep(/^$table_attr$/, @{ $tableattrs{$lookup_table} })) {
push @{ $tableattrs{$lookup_table} }, $table_attr;
}
}
# get the object type description from Schema.pm
my %tableattrs = xCAT::DBobjUtils->gettbldesc($objtype, \@attrs);
my @objlist = @{ $objtypelist{$objtype} };
# foreach table look up the list of attrs for this
# list of object names
foreach my $table (keys %tableattrs) {
next if ($table eq 'nodegroup'); #getNodesAttribs cannot handle this table now
# open the table
# with autocommit => 0, it does not work on Ubuntu running mysql
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 1);
@@ -203,9 +186,14 @@ sub getobjattrs
next;
}
my @objlist = @{ $objtypelist{$objtype} };
my $rec = $thistable->getNodesAttribs(\@objlist, @{ $tableattrs{$table} });
my $rec;
if ($objtype eq 'node') {
$rec = $thistable->getNodesAttribs(\@objlist, @{$tableattrs{$table}});
} else {
my %options = ();
$options{keep_raw} = 1;
$rec = $thistable->getNodesAttribs(\@objlist, \@{$tableattrs{$table}}, %options);
}
# fill in %tabhash with any values that are set
foreach my $n (@objlist) {
@@ -232,6 +220,62 @@ sub getobjattrs
#----------------------------------------------------------------------------
=head3 gettbldesc
Get required table and columns from the Schema for specified definition type.
$objtype: definition type
$attrs_ref: only get the specific attributes,
this can be useful especially for performance considerations
Arguments:
Returns:
undef - error
hash ref - $tblattrshash{tablename} = [col1, col2]
Globals:
Error:
Example:
To get the table attributes for object type
ex.
xCAT::DBobjUtils->gettbldesc('node', @attr);
Comments:
=cut
#-----------------------------------------------------------------------------
sub gettbldesc {
my ($class, $objtype) = @_;
my @attrs;
# The $attrs is an optional argument
if (ref $_[0]) {
@attrs = @{ shift() };
}
my %tableattrs = ();
my $datatype = $xCAT::Schema::defspec{$objtype};
foreach my $this_attr (@{ $datatype->{'attrs'} }) {
my $attr = $this_attr->{attr_name};
if (scalar(@attrs) > 0) { # Only query specific attributes
if (!grep(/^$attr$/, @attrs)) {
next; # This attribute is not needed
}
}
# table_attr is the attr that actually appears in the
# table which could possibly be different then the attr
# used in the node def
# ex. 'nodetype.arch'
my ($lookup_table, $table_attr) = split('\.', $this_attr->{tabentry});
if (!grep(/^$table_attr$/, @{ $tableattrs{$lookup_table} })) {
push @{ $tableattrs{$lookup_table} }, $table_attr;
}
}
return %tableattrs;
}
#----------------------------------------------------------------------------
=head3 getobjdefs
Get object definitions from the DB.
@@ -263,13 +307,14 @@ sub getobjattrs
sub getobjdefs
{
my ($class, $hash_ref, $verbose, $attrs_ref, $chname_ref) = @_;
my %objhash;
my %typehash = %$hash_ref;
my %tabhash;
my @attrs;
my @attrs; # required attributes
if (ref($attrs_ref)) {
@attrs = @$attrs_ref;
}
my %objhash; # fetched result will be stored in this hash
my %tabhash; # used to cache the some result for node/group
@::foundTableList = ();
@@ -283,40 +328,7 @@ sub getobjdefs
return %objhash;
}
# see if we need to get any objects of type 'node'
my $getnodes = 0;
foreach my $objname (keys %typehash) {
if ($typehash{$objname} eq 'node') {
$getnodes = 1;
}
}
# if so then get node info from tables now
# still may need to look up values in some tables using
# other keys - also need to figure out what tables to take
# values from when using 'only_if' - see below
# - but this saves lots of time
if ($getnodes) {
if (scalar(@attrs) > 0) { # Only get specific attributes of the node
# find the onlyif key for the attributes
REDO: my $datatype = $xCAT::Schema::defspec{'node'};
foreach my $this_attr (@{ $datatype->{'attrs'} }) {
my $attr = $this_attr->{attr_name};
if (exists($this_attr->{only_if})) {
my ($onlyif_key, $onlyif_value) = split('\=', $this_attr->{only_if});
if (!grep (/^$onlyif_key$/, @attrs)) {
push @attrs, $onlyif_key;
goto REDO;
}
}
}
%tabhash = xCAT::DBobjUtils->getobjattrs(\%typehash, \@attrs);
} else {
%tabhash = xCAT::DBobjUtils->getobjattrs(\%typehash);
}
}
# Classify the nodes with type
# Classify the objects with type, for example, {'node' => ['cn1', 'cn2']}
my %type_obj = ();
foreach my $objname (keys %typehash) {
push @{ $type_obj{ $typehash{$objname} } }, $objname;
@@ -422,10 +434,38 @@ sub getobjdefs
# get the object type decription from Schema.pm
my $datatype = $xCAT::Schema::defspec{$objtype};
# if so then get objects info from tables now
# still may need to look up values in some tables using
# other keys - also need to figure out what tables to take
# values from when using 'only_if' - see below
# - but this saves lots of time
if ($objtype eq 'node' or $objtype eq 'group') {
if (scalar(@attrs) > 0) {
# Only get specific attributes of the object
# find the onlyif key for the attributes
REDO:
foreach my $this_attr (@{$datatype->{'attrs'}}) {
my $attr = $this_attr->{attr_name};
if (exists($this_attr->{only_if})) {
my ($onlyif_key, $onlyif_value) = split('\=', $this_attr->{only_if});
if (!grep (/^$onlyif_key$/, @attrs)) {
push @attrs, $onlyif_key;
goto REDO;
}
}
}
%tabhash = xCAT::DBobjUtils->getobjattrs(\%typehash, \@attrs);
}
else {
%tabhash = xCAT::DBobjUtils->getobjattrs(\%typehash);
}
}
# get the key to look for, for this object type
my $objkey = $datatype->{'objkey'};
# go through the list of valid attrs
foreach my $this_attr (@{ $datatype->{'attrs'} }) {
my $ent;
my $attr = $this_attr->{attr_name};
@@ -435,7 +475,7 @@ sub getobjdefs
}
# skip the attributes that does not needed for node type
if ($getnodes) {
if ($objtype eq 'node') {
if (scalar(@attrs) > 0 && !grep(/^$attr$/, @attrs)) {
next;
}
@@ -449,33 +489,33 @@ sub getobjdefs
# ex. noderes.nfsdir
my ($tab, $tabattr) = split('\.', $this_attr->{tabentry});
foreach my $objname (sort @{ $type_obj{$objtype} }) {
my $check_attr = undef;
my $check_value = undef;
if (exists $this_attr->{only_if}) {
($check_attr, $check_value) = split('\=', $this_attr->{only_if});
}
foreach my $objname (sort @{ $type_obj{$objtype} }) {
# get table lookup info from Schema.pm
# !!!! some tables depend on the value of certain attrs
# we need to look up attrs in the correct order or we will
# not be able to determine what tables to look
# in for some attrs.
if (exists($this_attr->{only_if})) {
my ($check_attr, $check_value) = split('\=', $this_attr->{only_if});
if (defined($check_attr) && defined($check_value)) {
# if the object value is not the value we need
# to match then try the next only_if value
next if (!($objhash{$objname}{$check_attr} =~ /\b$check_value\b/));
}
$objhash{$objname}{'objtype'} = $objtype;
my %tabentry = ();
my %tabentry = ();
# def commands need to support multiple keys in one table
# the subroutine parse_access_tabentry is used for supporting multiple keys
my $rc = xCAT::DBobjUtils->parse_access_tabentry($objname,
$this_attr->{access_tabentry}, \%tabentry);
my $rc = xCAT::DBobjUtils->parse_access_tabentry($objname, $this_attr->{access_tabentry}, \%tabentry);
if ($rc != 0) {
my $rsp;
$rsp->{data}->[0] =
"access_tabentry \'$this_attr->{access_tabentry}\' is not valid.";
$rsp->{data}->[0] = "access_tabentry \'$this_attr->{access_tabentry}\' is not valid.";
xCAT::MsgUtils->message("E", $rsp, $::callback);
next;
}
@@ -490,7 +530,8 @@ sub getobjdefs
# The %tabhash is for performance considerations
my $tabspec = $xCAT::Schema::tabspec{$lookup_table};
my $nodecol = $tabspec->{'nodecol'} if defined($tabspec->{'nodecol'});
if (($lookup_attr eq 'node' && $objtype eq 'node') || (defined($nodecol) && $objtype eq 'node' && $lookup_table ne 'ppcdirect')) {
if (($lookup_attr eq 'node' && ($objtype eq 'node' || $objtype eq 'group')) ||
(defined($nodecol) && ($objtype eq 'node' || $objtype eq 'group') && $lookup_table ne 'ppcdirect')) {
if (defined($tabhash{$lookup_table}{$objname}{$tabattr})) {
if ($verbose == 1) {
$objhash{$objname}{$attr} = "$tabhash{$lookup_table}{$objname}{$tabattr}\t(Table:$lookup_table - Key:$lookup_attr - Column:$tabattr)";
@@ -509,7 +550,6 @@ sub getobjdefs
$notsearched = 1;
}
}
# Not in tabhash,
# Need to lookup the table
if ($intabhash == 0 && $notsearched == 1) {
@@ -580,7 +620,8 @@ sub getDBtable
# save this table info - in case this subr gets called multiple times
# --nocache flag specifies not to use cahe
if (grep(/^$table$/, @::foundTableList) && !$::opt_nc) {
#if (grep(/^$table$/, @::foundTableList) && !$::opt_nc) {
if (exists $::TableHash{$table} && !$::opt_nc) {
# already have this
@rows = @{ $::TableHash{$table} };
@@ -600,7 +641,7 @@ sub getDBtable
# keep track of the fact that we checked this table
# - even if it's empty!
push(@::foundTableList, $thistable->{tabname});
#push(@::foundTableList, $thistable->{tabname});
@{ $::TableHash{$table} } = @rows;
+12 -1
View File
@@ -6313,7 +6313,18 @@ sub run_always_rsync_postscripts
# build xdsh queue
# build host and all scripts to execute
push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host);
# EXECUTEALWAYS will only execute the syncfile in the syncfile list
foreach my $key (keys %{$$options{'destDir_srcFile'}{$host}}) {
foreach my $key1 (keys %{ $$options{'destDir_srcFile'}{$host}{$key} }) {
my $index = 0;
while (my $src_file = $$options{'destDir_srcFile'}{$host}{$key}{$key1}->[$index]) {
if ($src_file eq $tmppostfile) {
push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host);
}
$index++;
}
}
}
}
}
+2 -1
View File
@@ -8,7 +8,6 @@ use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
use xCAT::PPCpower;
use xCAT::FSPUtils;
use xCAT::GlobalDef;
use xCAT_monitoring::monitorctrl;
#use Data::Dumper;
@@ -183,6 +182,7 @@ sub powercmd_boot {
}
}
if (%newnodestatus) {
require xCAT_monitoring::monitorctrl;
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%newnodestatus, 1);
}
return (\@output);
@@ -364,6 +364,7 @@ sub powercmd {
}
if (%newnodestatus) {
require xCAT_monitoring::monitorctrl;
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%newnodestatus, 1);
}
return (\@output);
+1
View File
@@ -614,6 +614,7 @@ sub rnetboot {
my $newstat = $::STATUS_POWERING_ON;
my %newnodestatus = ();
$newnodestatus{$newstat} = [$node];
require xCAT_monitoring::monitorctrl;
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%newnodestatus, 1);
return ([ [ $node, "Success", $Rc ] ]);
}
+2 -1
View File
@@ -9,7 +9,6 @@ use xCAT::MsgUtils;
use xCAT::FSPpower;
use xCAT::GlobalDef;
use xCAT_monitoring::monitorctrl;
##########################################################################
# Parse the command line for options and operands
@@ -301,6 +300,7 @@ sub powercmd_boot {
}
}
require xCAT_monitoring::monitorctrl;
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%newnodestatus, 1);
return (\@output);
}
@@ -423,6 +423,7 @@ sub powercmd {
}
}
}
require xCAT_monitoring::monitorctrl;
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%newnodestatus, 1);
return (\@result);
}
+29 -15
View File
@@ -2797,20 +2797,21 @@ sub getNodeAttribs
unless (scalar keys %{ $data[0] }) {
return undef;
}
my $attrib;
foreach $datum (@data) {
foreach $attrib (@attribs)
{
unless (defined $datum->{$attrib}) {
#skip undefined values, save time
next;
}
my $retval;
if (defined($retval = transRegexAttrs($node, $datum->{$attrib}))) {
$datum->{$attrib} = $retval;
} else {
delete $datum->{$attrib};
if (!exists($options{keep_raw})){
my $attrib;
foreach $datum (@data) {
foreach $attrib (@attribs) {
unless (defined $datum->{$attrib}) {
#skip undefined values, save time
next;
}
my $retval;
if (defined($retval = transRegexAttrs($node, $datum->{$attrib}))) {
$datum->{$attrib} = $retval;
}
else {
delete $datum->{$attrib};
}
}
}
}
@@ -2984,6 +2985,9 @@ sub getNodeAttribs_nosub_returnany
}
@results = $self->getAttribs({ $nodekey => $node }, @attribs);
# return the DB without any rendering, this is for fetch attributes of group
return @results if (exists($options{keep_raw}));
my %attribsToDo;
for (@attribs) {
$attribsToDo{$_} = 0
@@ -4326,8 +4330,10 @@ sub delimitcol {
#--------------------------------------------------------------------------------
sub buildWhereClause {
my $attrvalstr = shift; # array of atr<op>val strings
my $getkeysonly = shift;
my $whereclause; # Where Clause
my $firstpass = 1;
my @gotkeys = ();
foreach my $m (@{$attrvalstr})
{
my $attr;
@@ -4368,6 +4374,9 @@ sub buildWhereClause {
($attr, $val) = split />/, $m, 2;
$operator = ' > ';
} else {
if (defined($getkeysonly)) {
return "Unsupported operator:$m on -w flag input";
}
xCAT::MsgUtils->message("S", "Unsupported operator:$m on -w flag input, could not build a Where Clause.");
$whereclause = "";
return $whereclause;
@@ -4382,7 +4391,12 @@ sub buildWhereClause {
#$whereclause .="\')";
$whereclause .= "\'";
if (defined($getkeysonly)) {
push @gotkeys, $attr;
}
}
if (defined($getkeysonly)) {
return \@gotkeys;
}
return $whereclause;
+56 -54
View File
@@ -114,7 +114,7 @@ sub check_pr_format{
unless ($pr_url_resp) {
print "[check_pr_format] After $retries retries, not able to get response from $pr_url \n";
# Failed after trying a few times, return error
return 1;
return $counter;
}
my $pr_content = decode_json($pr_url_resp);
my $pr_title = $pr_content->{title};
@@ -271,19 +271,19 @@ sub send_back_comment{
#--------------------------------------------------------
sub build_xcat_core{
my @output;
my @cmds = ("gpg --list-keys",
"sed -i '/SignWith: /d' $ENV{'PWD'}/build-ubunturepo");
foreach my $cmd (@cmds){
print "[build_xcat_core] running $cmd\n";
@output = runcmd("$cmd");
if($::RUNCMD_RC){
print "[build_xcat_core] $cmd ....[Failed]\n";
send_back_comment("> **BUILD ERROR** : $cmd failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information");
return 1;
}
}
#my @cmds = ("gpg --list-keys",
# "sed -i '/SignWith: /d' $ENV{'PWD'}/build-ubunturepo");
#foreach my $cmd (@cmds){
# print "[build_xcat_core] running $cmd\n";
# @output = runcmd("$cmd");
# if($::RUNCMD_RC){
# print "[build_xcat_core] $cmd ....[Failed]\n";
# send_back_comment("> **BUILD ERROR** : $cmd failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information");
# return 1;
# }
#}
my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1";
my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1 GPGSIGN=0";
@output = runcmd("$cmd");
print ">>>>>Dumper the output of '$cmd'\n";
print Dumper \@output;
@@ -321,8 +321,8 @@ sub install_xcat{
my @cmds = ("cd ./../../xcat-core && sudo ./mklocalrepo.sh",
"sudo chmod 777 /etc/apt/sources.list",
"sudo echo \"deb [arch=amd64] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep trusty main\" >> /etc/apt/sources.list",
"sudo echo \"deb [arch=ppc64el] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep trusty main\" >> /etc/apt/sources.list",
"sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list",
"sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list",
"sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -",
"sudo apt-get -qq update");
my @output;
@@ -339,7 +339,7 @@ sub install_xcat{
}
}
my $cmd = "sudo apt-get install xcat --force-yes";
my $cmd = "sudo apt-get install xcat --allow-remove-essential --allow-unauthenticated";
@output = runcmd("$cmd");
#print ">>>>>Dumper the output of '$cmd'\n";
#print Dumper \@output;
@@ -448,7 +448,7 @@ sub check_syntax{
# Return code:
#--------------------------------------------------------
sub run_fast_regression_test{
my $cmd = "sudo apt-get install xcat-test --force-yes";
my $cmd = "sudo apt-get install xcat-test --allow-remove-essential --allow-unauthenticated";
my @output = runcmd("$cmd");
if($::RUNCMD_RC){
print RED "[run_fast_regression_test] $cmd ....[Failed]\n";
@@ -488,43 +488,20 @@ sub run_fast_regression_test{
@output = runcmd("cat $conf_file");
print Dumper \@output;
$cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -s \"ci_test\" -l'";
my @caseslist = runcmd("$cmd");
if($::RUNCMD_RC){
print RED "[run_fast_regression_test] $cmd ....[Failed]\n";
print "[run_fast_regression_test] error dumper:\n";
print Dumper \@caseslist;
return 1;
}else{
print "[run_fast_regression_test] $cmd .....:\n";
print Dumper \@caseslist;
}
# $cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -s \"mn_only-wait_fix\" -l'";
# my @caseslist = runcmd("$cmd");
# if($::RUNCMD_RC){
# print RED "[run_fast_regression_test] $cmd ....[Failed]\n";
# print "[run_fast_regression_test] error dumper:\n";
# print Dumper \@caseslist;
# return 1;
# }else{
# print "[run_fast_regression_test] $cmd .....:\n";
# print Dumper \@caseslist;
# }
#
# #This is a black list for CI test
# #It is useful for debug or development
# #please ignore during common work
## {
## sub array_filter {
## my $src_array_ref = shift;
## my $filter_array_ref = shift;
##
## my @left_array;
## foreach my $item (@{$src_array_ref}) {
## my $hit = 0;
## foreach my $f (@{$filter_array_ref}) {
## $hit = 1 if ($f eq $item);
## }
## push @left_array, $item unless ($hit);
## }
## @$src_array_ref = @left_array;
## }
##
## #my @filter_cases=("testtest");
## #array_filter(\@caseslist, \@filter_cases);
## }
my @caseslist = runcmd("sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -l caselist -b MN_basic.bundle'");
#my @caseslist = runcmd("sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -l caselist -b MN_basic.bundle'");
my $casenum = @caseslist;
my $x = 0;
my @failcase;
@@ -613,13 +590,28 @@ my @disk = runcmd("df -h");
print "Disk information:\n";
print Dumper \@disk;
# Hacking the netmask. Not sure if we need to recover it after finish xcattest
# Note: Here has an assumption from Travis VM: only 1 UP Ethernet interface available (CHANGEME if it not as is)
my @intfinfo = runcmd("ip -o link |grep 'link/ether'|grep 'state UP' |awk -F ':' '{print \$2}'|head -1");
foreach my $nic (@intfinfo) {
print "Hacking the netmask length to 16 if it is 32: $nic\n";
runcmd("ip -4 addr show $nic|grep 'inet'|grep -q '/32' && sudo ip addr add \$(hostname -I|awk '{print \$1}')/16 dev $nic");
}
my @ipinfo = runcmd("ip addr");
print "Networking information:\n";
print Dumper \@ipinfo;
#Start to check the format of pull request
$last_func_start = timelocal(localtime());
print GREEN "\n------ Checking Pull Request Format ------\n";
$rst = check_pr_format();
my $redo_check_pr = 0;
if($rst){
print RED "Check of pull request format failed\n";
exit $rst;
if($rst <= $retries) {
print RED "Check of pull request format failed\n";
exit $rst;
}
$redo_check_pr = 1;
}
mark_time("check_pr_format");
@@ -660,4 +652,14 @@ if($rst){
}
mark_time("run_fast_regression_test");
if ($redo_check_pr) {
print GREEN "\n------ Checking Pull Request Format ------\n";
$rst = check_pr_format();
if($rst){
print RED "Check of pull request format failed\n";
exit $rst;
}
mark_time("check_pr_format");
}
exit 0;
+3 -3
View File
@@ -6,7 +6,7 @@ B<rinstall> - Begin OS provision on a noderange
B<rinstall> I<noderange> [B<boot> | B<shell> | B<runcmd=>I<command>] [B<-c>|B<--console>] [B<-V>|B<--verbose>]
B<rinstall> I<noderange> B<osimage>[=I<imagename>] [B<--noupdateinitrd>][B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>]
B<rinstall> I<noderange> [B<osimage>[=I<imagename>]] [B<--noupdateinitrd>][B<--ignorekernelchk>] [B<-c>|B<--console>] [B<-u>|B<--uefimode>] [B<-V>|B<--verbose>]
B<rinstall> I<noderange> B<runimage=>I<task>
@@ -16,9 +16,9 @@ B<rinstall> [B<-h>|B<--help>|B<-v>|B<--version>]
B<rinstall> is a convenience command to begin OS provision on a noderange.
If B<osimage>=I<imagename> is specified or B<osimage> is specified and nodetype.provmethod=B<osimage> is set, provision the noderange with the osimage specified/configured.
If B<osimage>=I<imagename> is specified or B<osimage> is specified and nodetype.provmethod=I<osimage> is set, provision the noderange with the osimage specified/configured. If no task specified, default is B<osimage>.
If B<-c> is specified, it will then run B<rcons> on the node. This is allowed only if one node is in the noderange. If consoles are needed on multiple nodes, see L<winstall(8)|winstall.8>.
If B<-c> is specified, B<rinstall> will run B<rcons> on the node. This is allowed only if one node is in the noderange. If consoles are needed on multiple nodes, see L<winstall(8)|winstall.8>.
=head1 B<Options>
+16 -9
View File
@@ -72,7 +72,7 @@ end
local function remove_directory(directory, level, prefix)
local num_dirs = 0
local num_files = 0
if posix.access(directory,"rw") then
if posix.access(directory, "rw") then
local files = posix.dir(directory)
local last_file_index = table.getn(files)
table.sort(files)
@@ -89,7 +89,7 @@ local function remove_directory(directory, level, prefix)
posix.unlink(full_name)
end
-- printf('%s%s%s%s\n', prefix, prefix2, name, link)
-- printf('%s%s%s%s\n', prefix, prefix2, name, link)
if info.type == 'directory' then
local indent = is_tail and tail_leaf_indent or leaf_indent
@@ -112,11 +112,18 @@ local function remove_directory_deep(directory)
-- print(directory)
num_dirs, num_files = remove_directory(directory, 0, '')
if posix.access(directory, "rw") then
local info = assert(posix.stat(directory))
if info.type == 'directory' then
num_dirs, num_files = remove_directory(directory, 0, '')
-- printf('\ndropped %d directories, %d files\n', num_dirs, num_files)
-- printf('\ndropped %d directories, %d files\n', num_dirs, num_files)
posix.rmdir(directory)
posix.rmdir(directory)
else
posix.unlink(directory)
end
end
end
remove_directory_deep("/opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/bin")
@@ -127,13 +134,13 @@ remove_directory_deep("/opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/var/run"
%post
if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going to work...
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
. /etc/profile.d/xcat.sh
#mknb %{tarch}
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
. /etc/profile.d/xcat.sh
#mknb %{tarch}
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch>' manually"
mkdir -p /etc/xcat
touch /etc/xcat/genesis-base-updated
fi
fi
fi
%Files
@@ -379,6 +379,8 @@ rmdir \"/tmp/$userid\" \n")
except (SelfServerException, SelfClientException) as e:
self.callback.error(e.message, node)
self.callback.info("%s: BMC password changed. Update 'bmcpasswd' for the node or the 'passwd' table with the new password." % node)
def _set_apis_values(self, key, value, **kw):
node = kw['node']
obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback,
@@ -430,8 +432,8 @@ rmdir \"/tmp/$userid\" \n")
def _print_bmc_netinfo(self, node, ip, netmask, gateway, vlan):
self.callback.info('%s: BMC IP: %s'% (node, ip))
self.callback.info('%s: BMC Netmask: %s' % (node, netmask))
self.callback.info('%s: BMC IP: %s' % (node, ip))
self.callback.info('%s: BMC Netmask: %s' % (node, netmask))
self.callback.info('%s: BMC Gateway: %s' % (node, gateway))
if vlan:
self.callback.info('%s: BMC VLAN ID: %s' % (node, vlan))
@@ -440,6 +442,7 @@ rmdir \"/tmp/$userid\" \n")
node = kw['node']
node_info = kw['nodeinfo']
zeroconf = "Unknown"
obmc = openbmc.OpenBMCRest(name=node, nodeinfo=node_info, messager=self.callback,
debugmode=self.debugmode, verbose=self.verbose)
@@ -451,7 +454,7 @@ rmdir \"/tmp/$userid\" \n")
return
if not netinfo:
return self.callback.error("No network information get", node)
return self.callback.error("Can not get network information", node)
if 'error' in netinfo:
return self.callback.info('%s: %s' % (node, netinfo['error']))
@@ -470,6 +473,7 @@ rmdir \"/tmp/$userid\" \n")
origin_type = netinfo[origin_nic]['ipsrc']
origin_ip_obj = netinfo[origin_nic]['ipobj']
zeroconf = netinfo[origin_nic]['zeroconf']
if vlan:
pre_nic = nic.split('_')[0]
@@ -482,6 +486,8 @@ rmdir \"/tmp/$userid\" \n")
nic = pre_nic + '_' + vlan
try:
# Display Zero Config information in case IP setting fails or set IP is not accessible
self.callback.info('%s: Setting BMC IP configuration... [Zero Config IP: %s]' % (node, zeroconf))
obmc.set_netinfo(nic, ip, prefix, gateway)
sleep( 5 )
nic_netinfo = obmc.get_nic_netinfo(nic)
@@ -490,7 +496,7 @@ rmdir \"/tmp/$userid\" \n")
return
if not nic_netinfo:
return self.callback.error('Did not get info for NIC %s' % nic, node)
return self.callback.error('Can not get info for NIC %s' % nic, node)
set_success = False
for net_id, attr in nic_netinfo.items():
@@ -500,7 +506,7 @@ rmdir \"/tmp/$userid\" \n")
set_success = True
if not set_success:
return self.callback.error('Config BMC IP failed', node)
return self.callback.error('Setting BMC IP configuration failed. [Zero Config IP: %s]' % zeroconf, node)
try:
if origin_type == 'DHCP':
@@ -508,7 +514,7 @@ rmdir \"/tmp/$userid\" \n")
elif origin_type == 'Static':
obmc.delete_ip_object(origin_nic, origin_ip_obj)
else:
self.callback.error('Get wrong Origin type %s for NIC %s IP object %s' % (origin_type, nic, origin_ip_obj), node)
self.callback.error('Got wrong origin type %s for NIC %s IP object %s' % (origin_type, nic, origin_ip_obj), node)
except (SelfServerException, SelfClientException) as e:
self.callback.error(e.message, node)
@@ -525,7 +531,7 @@ rmdir \"/tmp/$userid\" \n")
self.callback.error(e.message, node)
return
if not netinfo:
return self.callback.error("No network information get", node)
return self.callback.error("Can not get network information", node)
defaultgateway = "n/a"
bmchostname = ""
if 'defaultgateway' in netinfo:
@@ -60,7 +60,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand):
continue
firm_info.append('%s Firmware Product: %s (%s)%s' %
(firm_obj_dict[key].purpose,
(firm_obj_dict[key].purpose.upper(),
firm_obj_dict[key].version,
firm_obj_dict[key].active,
flag))
@@ -70,7 +70,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand):
for extended in extendeds:
firm_info.append('%s Firmware Product: ' \
'-- additional info: %s' % \
(firm_obj_dict[key].purpose, extended))
(firm_obj_dict[key].purpose.upper(), extended))
return firm_info
@@ -900,13 +900,15 @@ class OpenBMCRest(object):
continue
dev,match,netid = k.partition("/ipv4/")
if netid:
if 'LinkLocal' in v["Origin"] or v["Address"].startswith("169.254"):
msg = "Found LinkLocal address %s for interface %s, Ignoring..." % (v["Address"], dev)
self._print_record_log(msg, 'get_netinfo')
continue
nicid = dev.split('/')[-1]
if nicid not in netinfo:
netinfo[nicid] = {}
if 'LinkLocal' in v["Origin"] or v["Address"].startswith("169.254"):
msg = "Found LinkLocal address %s for interface %s, Ignoring..." % (v["Address"], dev)
self._print_record_log(msg, 'get_netinfo')
# Save Zero Conf information
netinfo[nicid]["zeroconf"] = v["Address"]
continue
if 'ip' in netinfo[nicid]:
msg = "%s: Another valid ip %s found." % (node, v["Address"])
self._print_record_log(msg, 'get_netinfo')
+16 -5
View File
@@ -286,10 +286,21 @@ sub is_firewall_open {
sub is_http_ready {
my $mnip = shift;
$mnip = shift if (($mnip) && ($mnip =~ /probe_utils/));
my $httpport = shift;
my $installdir = shift;
my $errormsg_ref = shift;
my $http = "http://$mnip/$installdir/postscripts/syslog";
my $http_status = `netstat -tunlp | grep -e "httpd" -e "apache" | grep "LISTEN" 2>&1`;
if (!$http_status) {
$$errormsg_ref = "No HTTP listening status get by command 'netstat'";
return 0;
} elsif ($http_status !~ /\S*\s+\S*\s+\S*\s+\S*$httpport\s+.+/) {
$$errormsg_ref = "The port defined in 'site' table HTTP is not listening";
return 0;
}
my $test_file = "efibootmgr";
my $http = "http://$mnip:$httpport/$installdir/postscripts/$test_file";
my %httperror = (
"400" => "The request $http could not be understood by the server due to malformed syntax",
"401" => "The request requires user authentication.",
@@ -320,12 +331,12 @@ sub is_http_ready {
$$errormsg_ref = "Prepare test environment error: $!";
return 0;
}
my @outputtmp = `wget -O $tmpdir/syslog $http 2>&1`;
my @outputtmp = `wget -O $tmpdir/$test_file $http 2>&1`;
my $rst = $?;
$rst = $rst >> 8;
if ((!$rst) && (-e "$tmpdir/syslog")) {
unlink("$tmpdir/syslog");
if ((!$rst) && (-e "$tmpdir/$test_file")) {
unlink("$tmpdir/$test_file");
rmdir ("$tmpdir");
return 1;
} elsif ($rst == 4) {
@@ -345,7 +356,7 @@ sub is_http_ready {
$$errormsg_ref = "Unknown return code of wget <$returncode>.";
}
}
unlink("$tmpdir/syslog");
unlink("$tmpdir/$test_file");
if(! rmdir ("$tmpdir")){
$$errormsg_ref .= " Clean test environment error(rmdir $tmpdir): $!";
}
+37 -15
View File
@@ -585,9 +585,15 @@ sub check_genesis_file {
}
}
my $tftpdir = `tabdump site | awk -F',' '/^"tftpdir",/ { gsub(/"/, "", \$2) ; print \$2 }'`;
chomp($tftpdir);
$tftpdir =~ s/"//g;
my $site_info = `lsdef -t site -i tftpdir,httpport -c`;
my $tftpdir = "";
my $httpport = 80;
if ($site_info =~ /clustersite: tftpdir=(\S*)/) {
$tftpdir = $1;
}
if ($site_info =~ /clustersite: httpport=(\S*)/) {
$httpport = $1;
}
my $genesis_folder;
my @genesis_files;
my $genesis_line;
@@ -623,14 +629,22 @@ sub check_genesis_file {
if ($genesis_line =~ /^initrd/) {
@initrd_info = split(' ', $genesis_line);
$initrd_path = $initrd_info[1];
$wget_rst = system("wget -q --spider $initrd_path -T 0.5 -t 3");
if ($wget_rst) {
push @errors, "'initrd' cannot be downloaded from $initrd_path.";
$rst = 1;
}
if ($initrd_path =~ /http:\/\/.+:80(\/.+)/) {
my $initrd_file = $1;
if ($initrd_path =~ /http:\/\/.+:(\d*)(\/.+)/) {
my $initrd_port = $1;
my $initrd_file = $2;
if ($initrd_port != $httpport) {
push @errors, "The http port for initrd file in '$file' is not the same with defined in 'site' table.";
$rst = 1;
} else {
$wget_rst = system("wget -q --spider $initrd_path -T 0.5 -t 3");
if ($wget_rst) {
push @errors, "'initrd' cannot be downloaded from $initrd_path.";
$rst = 1;
}
}
my $initrd_time = `stat $initrd_file | grep Modify | cut -d ' ' -f 2-3`;
if ($genesis_time and $initrd_time < $genesis_time) {
$genesis_update_flag_p = 1;
@@ -641,10 +655,18 @@ sub check_genesis_file {
if ($genesis_line =~ /^kernel/) {
@kernel_info = split(' ', $genesis_line);
$kernel_path = $kernel_info[1];
$wget_rst = system("wget -q --spider $kernel_path -T 0.5 -t 3");
if ($wget_rst) {
push @errors, "kernel cannot be downloaded from $kernel_path.";
$rst = 1;
if ($kernel_path =~ /http:\/\/.+:(\d*)\/.+/) {
my $kernel_port = $1;
if ($kernel_port != $httpport) {
push @errors, "The http port for kernel file in '$file' is not the same with defined in 'site' table.";
$rst = 1;
} else {
$wget_rst = system("wget -q --spider $kernel_path -T 0.5 -t 3");
if ($wget_rst) {
push @errors, "kernel cannot be downloaded from $kernel_path.";
$rst = 1;
}
}
}
}
}
@@ -703,7 +725,7 @@ sub check_genesis_file {
next;
}
$host_ip .= ":80";
$host_ip .= ":$httpport";
while ($genesis_line = <FILE>) {
chomp($genesis_line);
$genesis_line =~ s/^\s+|\s+$//g;
+6 -5
View File
@@ -1169,10 +1169,11 @@ sub handle_cluster_msg {
my $log_msg = $log_ref->{msg};
my @split_log = split(/\s+/, $log_msg);
if ($split_log[1] eq "Allowing") {
my $command = $split_log[2];
my $nodes_str = $split_log[4];
my $sub_command = $split_log[5];
# As xcat log message will in both messages.log and cluster.log, need to filter one to avoid the duplication
if ($split_log[1] eq "xCAT:" && $split_log[2] eq "Allowing") {
my $command = $split_log[3];
my $nodes_str = $split_log[5];
my $sub_command = $split_log[6];
if ($command eq "rinstall" or $command eq "rnetboot" or ($command eq "rpower" and $sub_command =~ /on|boot|reset/) or ($command eq "xdsh" and $log_msg =~ /reboot|shutdown -r/)) {
my @nodes = probe_utils->parse_node_range($nodes_str);
@@ -1188,7 +1189,7 @@ sub handle_cluster_msg {
}
}
}
} elsif ($log_ref->{msg} =~ /(.+)\s+status:\s+(.+)\s+statustime:/) {
} elsif ($log_ref->{msg} =~ /INFO xcat.updatestatus - (.+):\s+changing status=(.+)/) {
my $nodes = $1;
my $status = $2;
my $record = "Node status is changed to $status";
+12 -4
View File
@@ -715,10 +715,18 @@ sub check_http_service {
push @$error_ref, "HTTP check need 'wget' tool, please install 'wget' tool and try again";
} else {
{
my $installdir = `lsdef -t site -i installdir -c 2>&1 | awk -F'=' '{print \$2}'`;
chomp($installdir);
my $httpinfo = `lsdef -t site -i installdir,httpport -c 2>&1`;
my $installdir = "";
my $httpport = 80;
if ($httpinfo =~ /clustersite: installdir=(\S*)/) {
$installdir = $1;
}
if ($httpinfo =~ /clustersite: httpport=(\S*)/) {
$httpport = $1;
}
unless($installdir){
push @$error_ref, "HTTP work path(installdir) isn't configured in 'sit' table";
push @$error_ref, "HTTP work path(installdir) isn't configured in 'site' table";
last;
}
@@ -728,7 +736,7 @@ sub check_http_service {
}
my $errormsg;
unless(probe_utils->is_http_ready("$serverip", $installdir, \$errormsg)) {
unless(probe_utils->is_http_ready("$serverip", $httpport, $installdir, \$errormsg)) {
push @$error_ref, "$errormsg";
last;
}
+19 -11
View File
@@ -139,7 +139,14 @@ sub subvars {
}
$ENV{INSTALLDIR} = $installroot;
my $httpport;
$httpport = xCAT::TableUtils->get_site_attribute("httpport");
if (!defined($httpport)) {
$httpport = "80";
}
$ENV{HTTPPORT} = $httpport;
my $httpportsuffix=":$httpport";
#replace the env with the right value so that correct include files can be found
$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;
my $res;
@@ -282,6 +289,7 @@ sub subvars {
$inc =~ s/#INCLUDE:([^#^\n]+)#/includefile($1, 0, 0)/eg;
}
#support multiple paths of osimage in rh/sles diskfull installation
my @pkgdirs;
if (defined($media_dir)) {
@@ -295,11 +303,11 @@ sub subvars {
if ($c == 0) {
# After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x
# the rhels5.9 will not be installed successfully. So put in kickstart directly.
$source_in_pre .= "echo 'url --url http://'\$nextserver'/$pkgdir' >> /tmp/repos";
$source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #For rhels5.9
$source_in_pre .= "echo 'url --url http://'\$nextserver'$httpportsuffix/$pkgdir' >> /tmp/repos";
$source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir\n"; #For rhels5.9
} else {
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'/$pkgdir' >> /tmp/repos";
$source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #for rhels5.9
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'$httpportsuffix/$pkgdir' >> /tmp/repos";
$source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir\n"; #for rhels5.9
}
my $distrepofile="/install/postscripts/repos/$pkgdir/local-repository.tmpl";
if( -f "$distrepofile"){
@@ -309,13 +317,13 @@ sub subvars {
open($repofd,"<","$distrepofile");
$repo_in_post = <$repofd>;
close($repofd);
$repo_in_post =~ s#baseurl=#baseurl=http://$master/#g;
$repo_in_post =~ s#baseurl=#baseurl=http://$master$httpportsuffix/#g;
$writerepo .= "\ncat >/etc/yum.repos.d/local-repository-$c.repo << 'EOF'\n";
$writerepo .="$repo_in_post\n";
$writerepo .="EOF\n";
}
} elsif ($platform =~ /^(sles|suse)/) {
my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir";
my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir";
$source .= " <listentry>
<media_url>$http</media_url>
<product>SuSE-Linux-pkg$c</product>
@@ -323,7 +331,7 @@ sub subvars {
<ask_on_error config:type=\"boolean\">false</ask_on_error> <!-- available since openSUSE 11.0 -->
<name>SuSE-Linux-pkg$c</name> <!-- available since openSUSE 11.1/SLES11 (bnc#433981) -->
</listentry>";
$source_in_pre .= "<listentry><media_url>http://'\$nextserver'$pkgdir</media_url><product>SuSE-Linux-pkg$c</product><product_dir>/</product_dir><ask_on_error config:type=\"boolean\">false</ask_on_error><name>SuSE-Linux-pkg$c</name></listentry>";
$source_in_pre .= "<listentry><media_url>http://'\$nextserver'$httpportsuffix$pkgdir</media_url><product>SuSE-Linux-pkg$c</product><product_dir>/</product_dir><ask_on_error config:type=\"boolean\">false</ask_on_error><name>SuSE-Linux-pkg$c</name></listentry>";
} elsif ($platform =~ /^sle15*/) {
if ( -d "$pkgdir") {
opendir(DIR,$pkgdir);
@@ -339,7 +347,7 @@ sub subvars {
$product_name=$subdir;
}
if (defined($product_name) && defined($product_dir)){
$source .="<listentry><media_url>http://XCATNEXTSERVERHOOK$pkgdir</media_url><product>$product_name</product><product_dir>/$product_dir</product_dir></listentry>";
$source .="<listentry><media_url>http://XCATNEXTSERVERHOOK$httpportsuffix$pkgdir</media_url><product>$product_name</product><product_dir>/$product_dir</product_dir></listentry>";
}
}
}
@@ -392,7 +400,7 @@ sub subvars {
$inc =~ s/#UNCOMMENTOENABLESSH#/ /g;
}
my $sles_sdk_media = "http://" . $tmpl_hash->{tftpserver} . $media_dir . "/sdk1";
my $sles_sdk_media = "http://" . $tmpl_hash->{tftpserver}.$httpportsuffix . $media_dir . "/sdk1";
$inc =~ s/#SLES_SDK_MEDIA#/$sles_sdk_media/eg;
@@ -531,7 +539,7 @@ sub subvars {
}
}
elsif ("ubuntu" eq $platform) {
my $default_script = " wget http://`cat /tmp/xcatserver`" . $ENV{INSTALLDIR} . "/autoinst/getinstdisk; chmod u+x getinstdisk; ./getinstdisk;";
my $default_script = " wget http://`cat /tmp/xcatserver`".':'.$ENV{HTTPPORT} . $ENV{INSTALLDIR} . "/autoinst/getinstdisk; chmod u+x getinstdisk; ./getinstdisk;";
$inc =~ s/#INCLUDE_GET_INSTALL_DISK_SCRIPT#/$default_script/;
}
else {
@@ -1117,7 +1125,7 @@ sub mirrorspec {
if (!$pkgdir) {
$pkgdir = $_;
} else {
my $osuurl = "http://" . $masternode . $_ . " ./";
my $osuurl = "http://" . $masternode.':'.$ENV{httpport} . $_ . " ./";
push @mirrors, $osuurl;
}
}
@@ -627,7 +627,7 @@ sub getNodeStatusFromNodesetState {
Arguments:
status -- a hash pointer of the node status. A key is a status string. The value is
an array pointer of nodes that have the same status.
for example: {alive=>["node1", "node1"], unreachable=>["node5","node100"]}
for example: {alive=>["node1", "node2"], unreachable=>["node5","node100"]}
force -- 1 force the input values to be set.
-- 0 make sure if the input value is the next valid value.
Returns:
@@ -637,7 +637,7 @@ sub getNodeStatusFromNodesetState {
#--------------------------------------------------------------------------------
sub setNodeStatusAttributes {
print "monitorctrl::setNodeStatusAttributes called\n";
#print "monitorctrl::setNodeStatusAttributes called\n";
my $temp = shift;
if ($temp =~ /xCAT_monitoring::monitorctrl/) {
$temp = shift;
@@ -703,8 +703,12 @@ sub setNodeStatusAttributes {
if (@$nodes > 0) {
$updates{'status'} = $_;
$updates{'statustime'} = $currtime;
my $nodestate = "@$nodes status: $updates{'status'} statustime: $updates{'statustime'}";
xCAT::MsgUtils->message('S', "$nodestate");
#my $nodestate = "@$nodes status: $updates{'status'} statustime: $updates{'statustime'}";
foreach my $node (@$nodes) {
# To make the log clear, iterate for each node. This might be potential performance issue!
my $nodestate = "xcat.updatestatus - $node: changing status=$updates{'status'}";
xCAT::MsgUtils->message('S', "$nodestate");
}
my $where_clause;
my $dbname = xCAT::Utils->get_DBName();
+2 -2
View File
@@ -759,7 +759,7 @@ sub configSwitch {
my $table = xCAT::Table->new('switches', -create => 0);
if ($table) {
my @tmp1 = $table->getAllAttribs(('switch'));
if (defined(@tmp1) && (@tmp1 > 0)) {
if (scalar @tmp1 > 0) {
foreach (@tmp1) {
my @switches_tmp = noderange($_->{switch});
if (@switches_tmp == 0) { push @switches_tmp, $_->{switch}; }
@@ -1360,7 +1360,7 @@ sub getNodesMonServers
my $table = xCAT::Table->new('switches', -create => 0);
if ($table) {
my @tmp1 = $table->getAllAttribs(('switch'));
if (defined(@tmp1) && (@tmp1 > 0)) {
if (scalar @tmp1 > 0) {
foreach (@tmp1) {
my @switches_tmp = noderange($_->{switch});
if (@switches_tmp == 0) { push @switches_tmp, $_->{switch}; }
+33 -7
View File
@@ -1709,9 +1709,11 @@ sub defmk
$objTypeListsHash{$objk}{$obj} = 1;
}
}
my $numobjrequest = 0;
OBJ: foreach my $obj (keys %::FINALATTRS)
{
$numobjrequest++;
my $type = $::FINALATTRS{$obj}{objtype};
# check to make sure we have type
@@ -2034,16 +2036,19 @@ sub defmk
if ($error)
{
my $rsp;
$rsp->{data}->[0] = "One or more errors occured when attempting to create or modify xCAT \nobject definitions.";
$rsp->{data}->[0] = "One or more errors occured when attempting to create or modify xCAT object definitions.";
$rsp->{numofnodes}->[0] = $numobjrequest;
xCAT::MsgUtils->message("E", $rsp, $::callback);
return 1;
}
else
{
my $nodenum = 0;
my $totalnumobj = 0;
my $ret = 0;
my @nodes_updated = ();
foreach my $node (keys %::FINALATTRS) {
$totalnumobj++;
if ($::FINALATTRS{$node}{updated}) {
$nodenum++;
push @nodes_updated, $node;
@@ -2065,6 +2070,7 @@ sub defmk
$rsp->{data}->[$n] = "$o";
$n++;
}
$rsp->{numofnodes}->[0] = $totalnumobj;
if ($n > 1) {
# Some objects were created ($n was increased), report as success
$rsp->{data}->[0] = "The database was updated for the following objects:";
@@ -2078,6 +2084,7 @@ sub defmk
}
my $rsp;
$rsp->{data}->[0] = "$nodenum object definitions have been created or modified.";
$rsp->{numofnodes}->[0] = $totalnumobj;
if ($nodenum > 0) {
# Some objects were created, report as success
xCAT::MsgUtils->message("I", $rsp, $::callback);
@@ -2384,9 +2391,10 @@ sub defch
}
my $nodewithdomain;
my $invalidobjname = ();
my $numobjrequest = 0;
foreach my $obj (keys %::FINALATTRS)
{
$numobjrequest++;
my $isDefined = 0;
my $type = $::FINALATTRS{$obj}{objtype};
my %attrhash;
@@ -2918,7 +2926,8 @@ sub defch
if ($error)
{
my $rsp;
$rsp->{data}->[0] = "One or more errors occured when attempting to create or modify xCAT \nobject definitions.";
$rsp->{data}->[0] = "One or more errors occured when attempting to create or modify xCAT object definitions.";
$rsp->{numofnodes}->[0] = $numobjrequest;
xCAT::MsgUtils->message("E", $rsp, $::callback);
return 1;
}
@@ -2927,7 +2936,9 @@ sub defch
my $nodenum = 0;
my $ret = 0;
my @nodes_updated = ();
my $totalnumobj = 0;
foreach my $node (keys %::FINALATTRS) {
$totalnumobj++;
if ($::FINALATTRS{$node}{updated}) {
$nodenum++;
push @nodes_updated, $node;
@@ -2954,6 +2965,7 @@ sub defch
} else {
$rsp->{data}->[0] = "No database was updated";
}
$rsp->{numofnodes}->[0] = $totalnumobj;
xCAT::MsgUtils->message("I", $rsp, $::callback);
}
else
@@ -2965,6 +2977,7 @@ sub defch
} else {
$rsp->{data}->[0] = "No object definitions have been created or modified.";
}
$rsp->{numofnodes}->[0] = $totalnumobj;
xCAT::MsgUtils->message("I", $rsp, $::callback);
if (scalar(keys %newobjects) > 0)
{
@@ -3784,6 +3797,8 @@ sub defls
my $numobjects = 0; # keep track of how many object we want to display
# for each type
my $totalnumobj = 0;
foreach my $type (@::clobjtypes)
{
# Check if -i specifies valid attributes
@@ -3902,6 +3917,7 @@ sub defls
# for each object
foreach my $obj (sort keys %defhash)
{
$totalnumobj++; # include all the obj
unless ($obj)
{
@@ -4155,7 +4171,15 @@ sub defls
# Display the definition of objects
if (defined($rsp_info->{data}) && scalar(@{ $rsp_info->{data} }) > 0) {
$rsp_info->{numofnodes}->[0] = $totalnumobj;
xCAT::MsgUtils->message("I", $rsp_info, $::callback);
} else {
if ( $totalnumobj > 0) {
my $rsp;
$rsp->{data}->[0] = "No object definitions have been found";
$rsp->{numofnodes}->[0] = $totalnumobj;
xCAT::MsgUtils->message("I", $rsp, $::callback);
}
}
return 0;
@@ -4303,9 +4327,11 @@ sub defrm
# the memberlist nodes must be updated.
my $numobjects = 0;
my $totalnumobj = 0;
my %objTypeLists;
foreach my $obj (keys %objhash)
{
$totalnumobj++;
my $objtype = $objhash{$obj};
if (!defined($objTypeLists{$objtype})) # Do no call getObjectsOfType for the same objtype more than once.
{
@@ -4501,11 +4527,11 @@ sub defrm
{
if ($numobjects > 0)
{
my $rsp;
if ($::verbose)
{
# give results
my $rsp;
$rsp->{data}->[0] = "The following objects were removed:";
xCAT::MsgUtils->message("I", $rsp, $::callback);
@@ -4515,15 +4541,14 @@ sub defrm
$rsp->{data}->[$n] = "$o";
$n++;
}
xCAT::MsgUtils->message("I", $rsp, $::callback);
}
else
{
my $rsp;
my $nodenum = scalar(keys %objhash);
$rsp->{data}->[0] = "$nodenum object definitions have been removed.";
xCAT::MsgUtils->message("I", $rsp, $::callback);
}
$rsp->{numofnodes}->[0] = $totalnumobj;
xCAT::MsgUtils->message("I", $rsp, $::callback);
# Give a warning message to the user to remove the children of the node.
for my $tn (keys %objhash) {
@@ -4537,6 +4562,7 @@ sub defrm
else
{
my $rsp;
$rsp->{numofnodes}->[0] = $totalnumobj;
$rsp->{data}->[0] = "No objects have been removed from the xCAT database.";
xCAT::MsgUtils->message("I", $rsp, $::callback);
}
+3 -1
View File
@@ -652,7 +652,7 @@ sub mknetboot
$kcmdline .= $statemnt . " ";
$kcmdline .= "XCAT=$xcatmasterip:$xcatdport ";
if ($rootfstype ne "ramdisk") {
@@ -694,6 +694,8 @@ sub mknetboot
$kcmdline .= " nonodestatus ";
}
$kcmdline .= "XCATHTTPPORT=$httpport ";
if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) {
#for use in postscript and postbootscript in xcatdsklspost in the rootimg
$kcmdline .= " LOGSERVER=$xcatmasterip ";
+13 -6
View File
@@ -322,22 +322,29 @@ sub bmcdiscovery_processargs {
######################################
# check if there is nmap or not
######################################
if (-x '/usr/bin/nmap')
{
if (-x '/usr/bin/nmap') {
$nmap_path = "/usr/bin/nmap";
}
elsif (-x '/usr/local/bin/nmap')
{
elsif (-x '/usr/local/bin/nmap') {
$nmap_path = "/usr/local/bin/nmap";
}
else
{
else {
my $rsp;
push @{ $rsp->{data} }, "\tThere is no nmap in /usr/bin/ or /usr/local/bin/. \n ";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
return 1;
}
######################################
# check if there is ipmitool-xcat or not
######################################
unless (-x '/opt/xcat/bin/ipmitool-xcat') {
my $rsp;
push @{ $rsp->{data} }, "\tThere is no ipmitool-xcat in /opt/xcat/bin/, make sure that package ipmitool-xcat is installed successfully.\n ";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
return 1;
}
if ($::opt_T) {
my $msg = "The -t option is deprecated and will be ignored";
my $rsp = {};
+14 -8
View File
@@ -770,7 +770,7 @@ sub mkinstall {
if ($arch =~ /ppc64/i and !(-e "$pkgdir/install/netboot/initrd.gz") and
!(-e "$pkgdir/install/netboot/ubuntu-installer/$darch/initrd.gz")) {
xCAT::MsgUtils->report_node_error($callback, $node,
xCAT::MsgUtils->report_node_error($callback, $node,
"The network boot initrd.gz is not found in $pkgdir/install/netboot. This is provided by Ubuntu, please download and retry."
);
next;
@@ -788,7 +788,7 @@ sub mkinstall {
($arch =~ /x86/ and
(
(-r "$pkgdir/install/hwe-netboot/ubuntu-installer/$darch/linux"
and $kernpath = "$pkgdir/hwe-install/netboot/ubuntu-installer/$darch/linux"
and $kernpath = "$pkgdir/install/hwe-netboot/ubuntu-installer/$darch/linux"
and -r "$pkgdir/install/hwe-netboot/ubuntu-installer/$darch/initrd.gz"
and $initrdpath = "$pkgdir/install/hwe-netboot/ubuntu-installer/$darch/initrd.gz"
) or
@@ -859,11 +859,17 @@ sub mkinstall {
$instserver = '!myipfn!';
}
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
if ($ent and $ent->{nfsserver}) {
$instserver = $ent->{nfsserver};
}
my $kcmdline = "nofb utf8 auto url=http://" . $instserver . "/install/autoinst/" . $node;
my $kcmdline = "nofb utf8 auto url=http://" . $instserver . ":$httpport/install/autoinst/" . $node;
$kcmdline .= " xcatd=" . $instserver;
$kcmdline .= " mirror/http/hostname=" . $instserver;
@@ -927,7 +933,7 @@ sub mkinstall {
#from 12.10, the live install changed, so add the live-installer
if (-r "$pkgdir/install/filesystem.squashfs") {
$kcmdline .= " live-installer/net-image=http://${instserver}${pkgdir}/install/filesystem.squashfs";
$kcmdline .= " live-installer/net-image=http://${instserver}:$httpport${pkgdir}/install/filesystem.squashfs";
}
xCAT::MsgUtils->trace($verbose_on_off, "d", "debian->mkinstall: kcmdline=$kcmdline kernal=$rtftppath/vmlinuz initrd=$rtftppath/initrd.img");
@@ -1326,12 +1332,10 @@ sub mknetboot
$kcmdline = "NFSROOT=$nfssrv:$nfsdir STATEMNT=";
}
} else {
$kcmdline = "imgurl=http://$imgsrv/$rootimgdir/rootimg-statelite.gz STATEMNT=";
$kcmdline = "imgurl=http://$imgsrv:$httpport/$rootimgdir/rootimg-statelite.gz STATEMNT=";
}
# add support for subVars in the value of "statemnt"
my $statemnt = "";
if (exists($stateHash->{$node})) {
@@ -1384,16 +1388,18 @@ sub mknetboot
else
{
$kcmdline =
"imgurl=http://$imgsrv/$rootimgdir/$compressedrootimg ";
"imgurl=http://$imgsrv:$httpport/$rootimgdir/$compressedrootimg ";
$kcmdline .= "XCAT=$xcatmaster:$xcatdport ";
}
# if site.nodestatus='n', add "nonodestatus" to kcmdline to inform the node not to update nodestatus during provision
if (($nodestatus eq "n") or ($nodestatus eq "N") or ($nodestatus eq "0")) {
$kcmdline .= " nonodestatus ";
}
$kcmdline .=" XCATHTTPPORT=$httpport ";
if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) {
my ($host, $ipaddr) = xCAT::NetworkUtils->gethostnameandip($xcatmaster);
+21 -10
View File
@@ -488,6 +488,12 @@ sub addnode
my $ntent;
my $tftpserver;
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
if ($chainents and $chainents->{$node}) {
$chainent = $chainents->{$node}->[0];
}
@@ -680,12 +686,12 @@ sub addnode
if (proxydhcp($nrent)) { #proxy dhcp required in uefi invocation
$lstatements = 'if option client-architecture = 00:00 or option client-architecture = 00:07 or option client-architecture = 00:09 { filename = \"\"; option vendor-class-identifier \"PXEClient\"; } else { filename = \"\"; }' . $lstatements; #If proxydhcp daemon is enable, use it.
} else {
$lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { always-broadcast on; filename = \"http://' . $nxtsrv . '/tftpboot/xcat/xnba/nodes/' . $node . '\"; } else if option client-architecture = 00:07 or option client-architecture = 00:09 { filename = \"\"; option vendor-class-identifier \"PXEClient\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }' . $lstatements; #Only PXE compliant clients should ever receive xNBA
$lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { always-broadcast on; filename = \"http://' . $nxtsrv . ':' . $httpport . '/tftpboot/xcat/xnba/nodes/' . $node . '\"; } else if option client-architecture = 00:07 or option client-architecture = 00:09 { filename = \"\"; option vendor-class-identifier \"PXEClient\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }' . $lstatements; #Only PXE compliant clients should ever receive xNBA
}
} elsif ($douefi and $chainent->{currstate} ne "boot" and $chainent->{currstate} ne "iscsiboot") {
$lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { always-broadcast on; filename = \"http://' . $nxtsrv . '/tftpboot/xcat/xnba/nodes/' . $node . '\"; } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { filename = \"http://' . $nxtsrv . '/tftpboot/xcat/xnba/nodes/' . $node . '.uefi\"; } else if option client-architecture = 00:07 { filename = \"xcat/xnba.efi\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }' . $lstatements; #Only PXE compliant clients should ever receive xNBA
$lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { always-broadcast on; filename = \"http://' . $nxtsrv . ':' . $httpport . '/tftpboot/xcat/xnba/nodes/' . $node . '\"; } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { filename = \"http://' . $nxtsrv .':' . $httpport . '/tftpboot/xcat/xnba/nodes/' . $node . '.uefi\"; } else if option client-architecture = 00:07 { filename = \"xcat/xnba.efi\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }' . $lstatements; #Only PXE compliant clients should ever receive xNBA
} else {
$lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { filename = \"http://' . $nxtsrv . '/tftpboot/xcat/xnba/nodes/' . $node . '\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }' . $lstatements; #Only PXE compliant clients should ever receive xNBA
$lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { filename = \"http://' . $nxtsrv .':' . $httpport . '/tftpboot/xcat/xnba/nodes/' . $node . '\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }' . $lstatements; #Only PXE compliant clients should ever receive xNBA
}
}
} #TODO: warn when windows
@@ -702,7 +708,7 @@ sub addnode
} elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'grub2') {
$lstatements = 'filename = \"/boot/grub2/grub2-' . $node . '\";' . $lstatements;
} elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'petitboot') {
$lstatements = 'option conf-file \"http://' . $nxtsrv . '/tftpboot/petitboot/' . $node . '\";' . $lstatements;
$lstatements = 'option conf-file \"http://' . $nxtsrv .':' . $httpport . '/tftpboot/petitboot/' . $node . '\";' . $lstatements;
} elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'onie') {
my $provmethod = $ntent->{provmethod};
if ($provmethod) {
@@ -714,7 +720,7 @@ sub addnode
my $validpkgdir;
foreach my $mypkgdir (@pkgdirs){
if (-f $mypkgdir) {
$lstatements = 'if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { option www-server = \"http://' . $nxtsrv . $mypkgdir . '\";}' . $lstatements;
$lstatements = 'if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { option www-server = \"http://' . $nxtsrv .':' . $httpport . $mypkgdir . '\";}' . $lstatements;
$validpkgdir = 1;
last;
}
@@ -2383,6 +2389,11 @@ sub addnet
my $mask = shift;
my $nic;
my $domain;
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
my $firstoctet = $net;
$firstoctet =~ s/^(\d+)\..*/$1/;
if ($net eq "169.254.0.0" or ($firstoctet >= 224 and $firstoctet <= 239)) {
@@ -2666,7 +2677,7 @@ sub addnet
}
}
#for cumulus ZTP process
push @netent, " option cumulus-provision-url \"http://$tftp/install/postscripts/cumulusztp\";\n";
push @netent, " option cumulus-provision-url \"http://$tftp.':' . $httpport/install/postscripts/cumulusztp\";\n";
my $ddnserver = $nameservers;
$ddnserver =~ s/,.*//;
@@ -2706,9 +2717,9 @@ sub addnet
# $lstatements = 'if exists gpxe.bus-id { filename = \"\"; } else if exists client-architecture { filename = \"xcat/xnba.kpxe\"; } '.$lstatements;
push @netent, " if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { #x86, xCAT Network Boot Agent\n";
push @netent, " always-broadcast on;\n";
push @netent, " filename = \"http://$tftp/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n";
push @netent, " filename = \"http://$tftp.':' . $httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n";
push @netent, " } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { #x86, xCAT Network Boot Agent\n";
push @netent, " filename = \"http://$tftp/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n";
push @netent, " filename = \"http://$tftp.':' . $httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n";
push @netent, " } else if option client-architecture = 00:00 { #x86\n";
push @netent, " filename \"xcat/xnba.kpxe\";\n";
push @netent, " } else if option vendor-class-identifier = \"Etherboot-5.4\" { #x86\n";
@@ -2724,10 +2735,10 @@ sub addnet
push @netent, " filename \"elilo.efi\";\n";
push @netent,
" } else if option client-architecture = 00:0e { #OPAL-v3\n ";
push @netent, " option conf-file = \"http://$tftp/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n";
push @netent, " option conf-file = \"http://$tftp.':' . $httpport/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n";
push @netent,
" } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n";
push @netent, " option www-server = \"http://$tftp/install/onie/onie-installer\";\n";
push @netent, " option www-server = \"http://$tftp.':' . $httpport/install/onie/onie-installer\";\n";
push @netent,
" } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n ";
push @netent, " filename \"/yaboot\";\n";
+1 -1
View File
@@ -54,7 +54,7 @@ sub process_request
if ($client) { ($client) = noderange($client) }
unless ($client) { #Not able to do identify the host in question
xCAT::MsgUtils->message("S", "Received syncfiles from $client, which couldn't be correlated to a node (domain mismatch?)");
xCAT::MsgUtils->message("S", "Received getpartition from $client, which couldn't be correlated to a node (domain mismatch?)");
return;
}
+20 -10
View File
@@ -46,6 +46,12 @@ sub process_request {
$xcatdport = $t_entry;
}
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
@entries = xCAT::TableUtils->get_site_attribute("dhcpinterfaces");
$t_entry = $entries[0];
if (defined($t_entry)) {
@@ -247,6 +253,10 @@ sub process_request {
copy("/usr/lib/syslinux/pxelinux.0", "$tftpdir/pxelinux.0");
} elsif (-r "/usr/share/syslinux/pxelinux.0") {
copy("/usr/share/syslinux/pxelinux.0", "$tftpdir/pxelinux.0");
} elsif ("/usr/lib/PXELINUX/pxelinux.0") {
copy("/usr/lib/PXELINUX/pxelinux.0", "$tftpdir/pxelinux.0");
} else {
copy("/opt/xcat/share/xcat/netboot/syslinux/pxelinux.0", "$tftpdir/pxelinux.0");
}
if (-r "$tftpdir/pxelinux.0") {
chmod(0644, "$tftpdir/pxelinux.0");
@@ -289,15 +299,15 @@ sub process_request {
open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net");
print $cfg "#!gpxe\n";
if ($invisibletouch) {
print $cfg 'imgfetch -n kernel http://${next-server}/tftpboot/xcat/genesis.kernel.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/machyp}' . "\n";
print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.kernel.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/machyp}' . "\n";
if ($lzma_exit_value) {
print $cfg 'imgfetch -n nbfs http://${next-server}/tftpboot/xcat/genesis.fs.' . "$arch.gz\n";
print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.gz\n";
} else {
print $cfg 'imgfetch -n nbfs http://${next-server}/tftpboot/xcat/genesis.fs.' . "$arch.lzma\n";
print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.lzma\n";
}
} else {
print $cfg 'imgfetch -n kernel http://${next-server}/tftpboot/xcat/nbk.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline\n";
print $cfg 'imgfetch -n nbfs http://${next-server}/tftpboot/xcat/nbfs.' . "$arch.gz\n";
print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/nbk.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline\n";
print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/nbfs.' . "$arch.gz\n";
}
print $cfg "imgload kernel\n";
print $cfg "imgexec kernel\n";
@@ -317,7 +327,7 @@ sub process_request {
close($cfg);
open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net.uefi");
print $cfg "#!gpxe\n";
print $cfg 'chain http://${next-server}/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nets/' . "$net.elilo\n";
print $cfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nets/' . "$net.elilo\n";
close($cfg);
}
} elsif ($arch =~ /ppc/) {
@@ -325,8 +335,8 @@ sub process_request {
print $cfgfile "default \"xCAT Genesis (" . $normnets->{$_} . ")\"\n";
print $cfgfile " delay=10\n";
print $cfgfile " label \"xCAT Genesis (" . $normnets->{$_} . ")\"\n";
print $cfgfile " kernel http://" . $normnets->{$_} . ":80/$tftpdir/xcat/genesis.kernel.$arch\n";
print $cfgfile " initrd http://" . $normnets->{$_} . ":80/$initrd_file\n";
print $cfgfile " kernel http://" . $normnets->{$_} . ":$httpport/$tftpdir/xcat/genesis.kernel.$arch\n";
print $cfgfile " initrd http://" . $normnets->{$_} . ":$httpport/$initrd_file\n";
print $cfgfile ' append "quiet xcatd=' . $normnets->{$_} . ":$xcatdport $consolecmdline\"\n";
close($cfgfile);
}
@@ -363,8 +373,8 @@ sub process_request {
print $cfgfile "default \"xCAT Genesis (" . $normnets->{$_} . ")\"\n";
print $cfgfile " delay=10\n";
print $cfgfile " label \"xCAT Genesis (" . $normnets->{$_} . ")\"\n";
print $cfgfile " kernel http://" . $hexnets->{$_} . ":80/$tftpdir/xcat/genesis.kernel.$arch\n";
print $cfgfile " initrd http://" . $hexnets->{$_} . ":80/$initrd_file\n";
print $cfgfile " kernel http://" . $hexnets->{$_} . ":$httpport/$tftpdir/xcat/genesis.kernel.$arch\n";
print $cfgfile " initrd http://" . $hexnets->{$_} . ":$httpport/$initrd_file\n";
print $cfgfile ' append "quiet xcatd=' . $hexnets->{$_} . ":$xcatdport $consolecmdline\"\n";
close($cfgfile);
}
+28 -10
View File
@@ -1230,7 +1230,7 @@ sub parse_args {
my $option_s;
GetOptions( 's' => \$option_s );
return ([ 1, "The -s option is not supported for OpenBMC." ]) if ($option_s);
if ( "resolved" ~~ @ARGV) {
if ( "resolved=" ~~ @ARGV) {
return ([ 1, "$usage_errormsg $reventlog_no_id_resolved_errormsg" ]);
}
return ([ 1, "Only one option is supported at the same time for $command" ]);
@@ -1243,7 +1243,7 @@ sub parse_args {
if ($command eq "rbeacon") {
unless ($subcommand =~ /^on$|^off$|^stat$/) {
return ([ 1, "Only 'on', 'off' or 'stat' are supported for OpenBMC managed nodes."]);
return ([ 1, "Only 'on', 'off' and 'stat' are supported for OpenBMC managed nodes."]);
}
} elsif ($command eq "rpower") {
unless ($subcommand =~ /^on$|^off$|^softoff$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) {
@@ -1291,6 +1291,22 @@ sub parse_args {
if ($::RSPCONFIG_CONFIGURED_API_KEY ne -1) {
return ([ 1, "Can not query $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{subcommand} information with other options at the same time" ]) if ($#ARGV > 1);
# subcommand defined in the configured API hash, return from here, the RSPCONFIG_CONFIGURED_API_KEY is the key into the hash
if ($subcommand =~ /(\w+)=(.*)/) {
my $subcommand_key = $1;
my $subcommand_value = $2;
my $error_msg = "Invalid value '$subcommand_value' for '$subcommand_key'";
my @valid_values = sort (keys %{ $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value} });
if (!@valid_values) {
if ($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{type} eq "boolean") {
@valid_values = (0, 1);
} else {
return ([1, "$error_msg"]);
}
}
if (! grep { $_ eq $subcommand_value } @valid_values ) {
return ([1, "$error_msg, Valid values: " . join(",", @valid_values)]);
}
}
return;
}
elsif ($subcommand =~ /^(\w+)=(.*)/) {
@@ -1729,14 +1745,16 @@ sub parse_command_status {
}
else {
# Everything else is invalid
xCAT::SvrUtils::sendmsg([1, "Invalid value '$subcommand_value' for '$subcommand_key'"], $callback);
my $error_msg = "Invalid value '$subcommand_value' for '$subcommand_key'";
my @valid_values = keys %{ $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value} };
if (!@valid_values) {
if ($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{type} eq "boolean") {
xCAT::SvrUtils::sendmsg([1, "Valid values: 0,1"], $callback);
xCAT::SvrUtils::sendmsg([1, "$error_msg, Valid values: 0,1"], $callback);
} else {
xCAT::SvrUtils::sendmsg([1, "$error_msg"], $callback);
}
} else {
xCAT::SvrUtils::sendmsg([1, "Valid values: " . join(",", @valid_values)], $callback);
xCAT::SvrUtils::sendmsg([1, "$error_msg, Valid values: " . join(",", @valid_values)], $callback);
}
return 1;
}
@@ -1782,7 +1800,7 @@ sub parse_command_status {
$next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE";
$status_info{RSPCONFIG_SET_HOSTNAME_REQUEST}{data} = $1;
$status_info{RSPCONFIG_SET_RESPONSE}{argv} = "Hostname";
$status_info{RSPCONFIG_SET_RESPONSE}{argv} = "BMC Hostname";
$status_info{RSPCONFIG_GET_RESPONSE}{argv} = "hostname";
return 0;
}
@@ -2530,7 +2548,7 @@ sub deal_with_response {
$cur_url = $status_info{REVENTLOG_RESOLVED_REQUEST}{init_url};
}
my $log_id = (split ('/', $cur_url))[5];
$error = "Invalid ID=$log_id provided to be resolved. [$::RESPONSE_FORBIDDEN]";
$error = "Invalid ID: $log_id provided to be resolved. [$::RESPONSE_FORBIDDEN]";
} else{
$error = "$::RESPONSE_FORBIDDEN - Requested endpoint does not exist or may indicate function is not yet supported by OpenBMC firmware.";
}
@@ -3320,7 +3338,7 @@ sub reventlog_response {
}
else {
# Return if there are no entries with callout data
xCAT::SvrUtils::sendmsg("There are no event log entries contributing to LED fault", $callback, $node);
xCAT::SvrUtils::sendmsg([1, "No event log entries needed to be resolved"], $callback, $node);
$wait_node_num--;
return;
}
@@ -3878,7 +3896,7 @@ sub rspconfig_api_config_response {
my $last_component = $attr_value[-1];
my @valid_values = values %{ $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value} };
if ($value) {
xCAT::SvrUtils::sendmsg($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . " : $last_component", $callback, $node);
xCAT::SvrUtils::sendmsg($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . ": $last_component", $callback, $node);
my $found = grep(/$value/, @valid_values);
if ($found eq 0) {
# Received data value not expected
@@ -4113,7 +4131,7 @@ sub rspconfig_dump_response {
if ($node_info{$node}{cur_status} eq "RSPCONFIG_DUMP_CLEAR_RESPONSE") {
if ($response_info->{'message'} eq $::RESPONSE_OK) {
my $dump_id = $status_info{RSPCONFIG_DUMP_CLEAR_RESPONSE}{argv};
xCAT::MsgUtils->message("I", { data => ["[$dump_id] clear"] }, $callback) unless ($next_status{ $node_info{$node}{cur_status} });
xCAT::MsgUtils->message("I", { data => ["$node: [$dump_id] clear"] }, $callback) unless ($next_status{ $node_info{$node}{cur_status} });
} else {
my $error_msg = "Could not clear BMC diagnostics successfully (". $response_info->{'message'} . ")";
xCAT::MsgUtils->message("W", { data => ["$node: $error_msg"] }, $callback) if ($next_status{ $node_info{$node}{cur_status} });
+1 -1
View File
@@ -202,7 +202,7 @@ sub parse_args {
if ($command eq "rbeacon") {
unless ($subcommand =~ /^on$|^off$|^stat$/) {
return ([ 1, "Only 'on', 'off' or 'stat' is supported for OpenBMC managed nodes."]);
return ([ 1, "Only 'on', 'off' and 'stat' are supported for OpenBMC managed nodes."]);
}
} elsif ($command eq "rflash") {
my ($activate, $check, $delete, $directory, $list, $upload) = (0) x 6;
+8 -13
View File
@@ -478,24 +478,19 @@ sub process_request {
}
#end prescripts code
if (!-r "$tftpdir/pxelinux.0") {
unless (-r "/usr/lib/syslinux/pxelinux.0" or -r "/usr/share/syslinux/pxelinux.0") {
$::PXE_callback->({ error => ["Unable to find pxelinux.0 "], errorcode => [1] });
return;
my @pxelinuxpaths=("/usr/lib/syslinux/pxelinux.0","/usr/share/syslinux/pxelinux.0","/usr/lib/PXELINUX/pxelinux.0","/opt/xcat/share/xcat/netboot/syslinux/pxelinux.0");
foreach $path (@pxelinuxpaths) {
if (-r "$path") {
copy("$path","$globaltftpdir/pxelinux.0");
chmod(0644, "$globaltftpdir/pxelinux.0");
last;
}
if (-r "/usr/lib/syslinux/pxelinux.0") {
copy("/usr/lib/syslinux/pxelinux.0", "$tftpdir/pxelinux.0");
} else {
copy("/usr/share/syslinux/pxelinux.0", "$tftpdir/pxelinux.0");
}
chmod(0644, "$tftpdir/pxelinux.0");
}
unless (-r "$tftpdir/pxelinux.0") {
$::PXE_callback->({ errror => ["Unable to find pxelinux.0 from syslinux"], errorcode => [1] });
unless (-r "$globaltftpdir/pxelinux.0") {
$::PXE_callback->({ errror => ["Unable to find pxelinux.0 from syslinux or pxelinux"], errorcode => [1] });
return;
}
$errored = 0;
my %bphash;
my $inittime = 0;
+14 -8
View File
@@ -257,12 +257,6 @@ sub rinstall {
push @parameter, "osimage=$OSIMAGE";
if ($ignorekernelchk) {
push @parameter, "--ignorekernelchk";
}
if ($noupdateinitrd) {
push @parameter, "--noupdateinitrd";
}
}
elsif ($STATES) {
push @parameter, "$STATES";
@@ -318,6 +312,18 @@ sub rinstall {
#only provision the normal nodes
@nodes = @validnodes;
push @parameter, "osimage";
}
if ( grep( /osimage/, @parameter ) ) {
# Task is osimage, check --ignorekernelchk and --noupdateinitrd flags and set if needed
if ($ignorekernelchk) {
push @parameter, "--ignorekernelchk";
}
if ($noupdateinitrd) {
push @parameter, "--noupdateinitrd";
}
}
if (scalar(@nodes) == 0) {
@@ -406,7 +412,7 @@ sub rinstall {
$::RUNCMD_RC = 0;
my @nodes = @{ $hmhash{$hmkey} };
unless ($hmkey =~ /^(ipmi|blade|hmc|ivm|fsp|kvm|esx|rhevm|openbmc)$/) {
$rsp->{error}->[0] = "@nodes: rinstall only support nodehm.mgt type 'ipmi', 'blade', 'hmc', 'ivm', 'fsp', 'kvm', 'esx', 'rhevm'.";
$rsp->{error}->[0] = "@nodes: rinstall only support nodehm.mgt type 'ipmi', 'blade', 'hmc', 'ivm', 'fsp', 'kvm', 'esx', 'rhevm', 'openbmc'.";
$rsp->{errorcode}->[0] = 1;
xCAT::MsgUtils->message("E", $rsp, $callback);
next;
@@ -598,7 +604,7 @@ sub usage {
my $rsp = {};
$rsp->{data}->[0] = "Usage:";
$rsp->{data}->[1] = " $command <noderange> [boot | shell | runcmd=<command>] [-c|--console] [-u|--uefimode] [-V|--verbose]";
$rsp->{data}->[2] = " $command <noderange> osimage[=<imagename>] [--noupdateinitrd] [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]";
$rsp->{data}->[2] = " $command <noderange> [osimage[=<imagename>]] [--noupdateinitrd] [--ignorekernelchk] [-c|--console] [-u|--uefimode] [-V|--verbose]";
$rsp->{data}->[3] = " $command <noderange> runimage=<task>";
$rsp->{data}->[4] = " $command [-h|--help|-v|--version]";
xCAT::MsgUtils->message("I", $rsp, $callback);
+3 -2
View File
@@ -459,7 +459,7 @@ sub mknetboot
$kcmdline = "NFSROOT=$nfssrv:$nfsdir STATEMNT=";
}
} else {
$kcmdline = "imgurl=$httpmethod://$imgsrv/$rootimgdir/rootimg-statelite.gz STATEMNT=";
$kcmdline = "imgurl=$httpmethod://$imgsrv:$httpport/$rootimgdir/rootimg-statelite.gz STATEMNT=";
}
# add support for subVars in the value of "statemnt"
@@ -512,9 +512,10 @@ sub mknetboot
else
{
$kcmdline =
"imgurl=$httpmethod://$imgsrv/$rootimgdir/$compressedrootimg ";
"imgurl=$httpmethod://$imgsrv:$httpport/$rootimgdir/$compressedrootimg ";
}
$kcmdline .= "XCAT=$xcatmaster:$xcatdport quiet ";
$kcmdline .= " XCATHTTPPORT=$httpport ";
#if site.nodestatus="n", append "nonodestatus" to kcmdline
#to inform the statelite/stateless node not to update the nodestatus during provision
+44 -4
View File
@@ -732,6 +732,18 @@ sub tabdump
foreach my $w (@{$OPTW}) { # get each attr=val
push @attrarray, $w;
}
my $keys = xCAT::Table::buildWhereClause(\@attrarray, "1");
if (ref($keys) ne 'ARRAY') {
$cb->({ error => ["$keys"], errorcode => [1] });
return;
} else {
foreach my $k (@$keys) {
unless (grep /$k/, @{ $xCAT::Schema::tabspec{$table}->{cols} }) {
$cb->({ error => ["No column \"$k\" in table \"$table\""], errorcode => [1] });
return;
}
}
}
@ents = $tabh->getAllAttribsWhere(\@attrarray, 'ALL');
@$recs = ();
foreach my $e (@ents) {
@@ -1882,6 +1894,8 @@ sub nodels
my $VERSION;
my $HELP;
my $nodenum;
my $nodels_usage = sub
{
my $exitcode = shift @_;
@@ -2154,6 +2168,7 @@ sub nodels
}
}
$callback->($rsp);
$nodenum = scalar (@$nodes);
}
else
{
@@ -2205,8 +2220,12 @@ sub nodels
#}
}
$nodenum = scalar (@nodes);
}
}
my $rsp_info;
$rsp_info->{numofnodes}->[0] = $nodenum;
$callback->($rsp_info);
return 0;
}
@@ -2297,6 +2316,7 @@ sub tabch {
my %rsp;
$rsp{data}->[0] = "Incorrect argument \"$_\".\n";
$rsp{data}->[1] = "Check man tabch or tabch -h\n";
$rsp{errorcode}->[0] = 1;
$callback->(\%rsp);
return 1;
}
@@ -2318,14 +2338,23 @@ sub tabch {
my %rsp;
$rsp{data}->[0] = "Missing table name.\n";
$rsp{data}->[1] = "Check man tabch or tabch -h\n";
$rsp{errorcode}->[0] = 1;
$callback->(\%rsp);
return 1;
}
for (@tables_to_del)
{
$tables{$_} = xCAT::Table->new($_, -create => 1, -autocommit => 0);
$tables{$_}->delEntries(\%keyhash);
$tables{$_}->commit;
my $tab = xCAT::Table->new($_, -create => 1, -autocommit => 0);
unless ($tab) {
my %rsp;
$rsp{data}->[0] = "Table $_ does not exist.";
$rsp{errorcode}->[0] = 1;
$callback->(\%rsp);
next;
}
$tab->delEntries(\%keyhash);
$tab->commit;
}
}
else {
@@ -2347,11 +2376,22 @@ sub tabch {
} else {
my %rsp;
$rsp{data}->[0] = "Table $table does not exist.\n";
$rsp{errorcode}->[0] = 1;
$callback->(\%rsp);
return 1;
}
}
my $err_found = 0;
for my $k (keys %keyhash) {
unless (grep /$k/, @{ $xCAT::Schema::tabspec{$table}->{cols} }) {
$callback->({ error => ["No column \"$k\" in table \"$table\""], errorcode => [1] });
$err_found = 1;
}
}
if ($err_found) {
return 1;
}
#splice assignment
if (grep /\+=/, $temp) {
@@ -2386,7 +2426,7 @@ sub tabch {
}
unless (grep /$column/, @{ $xCAT::Schema::tabspec{$table}->{cols} }) {
$callback->({ error => "$table.$column not a valid table.column description", errorcode => [1] });
return;
return 1;
}
$tableupdates{$table}{$column} = $value;
}
+24 -7
View File
@@ -1564,6 +1564,11 @@ sub updatenoderunps
if ($fc[0] && ($fc[0] =~ /1|Yes|yes|YES|Y|y/)) {
$flowcontrol = 1;
}
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
# if running postscript report status here, if requested.
if ((defined($request->{status})) && ($request->{status} eq "yes")) {
@@ -1625,10 +1630,10 @@ sub updatenoderunps
if ($::SETSERVER) { # update the xcatinfo file on the node and run setuppostbootscripts
$runpscmd =
"$installdir/postscripts/xcatdsklspost $mode -M $snkey '$postscripts' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4 -c";
"$installdir/postscripts/xcatdsklspost $mode -M $snkey:$httpport '$postscripts' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4 -c";
} else {
$runpscmd =
"$installdir/postscripts/xcatdsklspost $mode -m $snkey '$postscripts' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4 -c"
"$installdir/postscripts/xcatdsklspost $mode -m $snkey:$httpport '$postscripts' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4 -c"
}
# add flowcontrol flag
@@ -2084,6 +2089,12 @@ sub updatenodesoftware
$flowcontrol = 1;
}
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
# this drives getdata to report status complete for software updatees
$::TYPECALL = "S";
@@ -2117,7 +2128,7 @@ sub updatenodesoftware
my $cmd;
my $args1;
$cmd =
"$installdir/postscripts/xcatdsklspost 2 -m $snkey 'ospkgs,otherpkgs,syscloneimgupdate' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4 -c";
"$installdir/postscripts/xcatdsklspost 2 -m $snkey:$httpport 'ospkgs,otherpkgs,syscloneimgupdate' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4 -c";
# add flowcontrol flag
if ($flowcontrol == 1) {
@@ -3301,6 +3312,12 @@ sub updateOS
# Get install directory
my $installDIR = xCAT::TableUtils->getInstallDir();
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
# Get HTTP server
my $http;
my @httpd = xCAT::NetworkUtils->my_ip_facing($node);
@@ -3372,7 +3389,7 @@ sub updateOS
{
# SUSE repository path - http://10.1.100.1/install/sles10.3/s390x/1/
$path = "http://$http$installDIR/$os/$arch/1/";
$path = "http://$http:$httpport$installDIR/$os/$arch/1/";
if (!(-e "$installDIR/$os/$arch/1/"))
{
push @{ $rsp->{data} },
@@ -3406,7 +3423,7 @@ sub updateOS
{
# SUSE repository path - http://10.1.100.1/install/sles10.3/s390x/1/
$path = "http://$http$installDIR/$os/$arch/1/";
$path = "http://$http$httpport$installDIR/$os/$arch/1/";
if (!(-e "$installDIR/$os/$arch/1/"))
{
push @{ $rsp->{data} },
@@ -3438,7 +3455,7 @@ sub updateOS
my $verifyOS = $os;
$verifyOS =~ s/^\D+([\d.]+)$/$1/;
if (xCAT::Utils->version_cmp($verifyOS, "7.0") < 0) {
$path = "http://$http$installDIR/$os/$arch/Server/";
$path = "http://$http:$httpport$installDIR/$os/$arch/Server/";
if (!(-e "$installDIR/$os/$arch/Server/"))
{
push @{ $rsp->{data} },
@@ -3449,7 +3466,7 @@ sub updateOS
}
else
{
$path = "http://$http$installDIR/$os/$arch/";
$path = "http://$http:$httpport$installDIR/$os/$arch/";
if (!(-e "$installDIR/$os/$arch/"))
{
push @{ $rsp->{data} },
+14 -8
View File
@@ -111,6 +111,12 @@ sub setstate {
my $imgaddkcmdline = $linuximghashref->{'addkcmdline'};
my $imgboottarget = $linuximghashref->{'boottarget'};
my $httpport="80";
my @hports=xCAT::TableUtils->get_site_attribute("httpport");
if ($hports[0]){
$httpport=$hports[0];
}
# get kernel and initrd from boottarget table
my $bttab;
my $btentry;
@@ -246,8 +252,8 @@ sub setstate {
my $kernel;
($kernel, $hypervisor) = split /!/, $kern->{kernel};
print $pcfg " set 209:string xcat/xnba/nodes/$node.pxelinux\n";
print $pcfg " set 210:string http://" . '${next-server}' . "/tftpboot/\n";
print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . "/tftpboot/xcat/pxelinux.0\n";
print $pcfg " set 210:string http://" . '${next-server}'. ':' . $httpport . "/tftpboot/\n";
print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . ':' . $httpport . "/tftpboot/xcat/pxelinux.0\n";
print $pcfg " imgload pxelinux.0\n";
print $pcfg " imgexec pxelinux.0\n";
close($pcfg);
@@ -257,8 +263,8 @@ sub setstate {
} else {
if ($kern->{kernel} =~ /\.c32\z/ or $kern->{kernel} =~ /memdisk\z/) { #gPXE comboot support seems insufficient, chain pxelinux instead
print $pcfg " set 209:string xcat/xnba/nodes/$node.pxelinux\n";
print $pcfg " set 210:string http://" . '${next-server}' . "/tftpboot/\n";
print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . "/tftpboot/xcat/pxelinux.0\n";
print $pcfg " set 210:string http://" . '${next-server}' . ':' . $httpport . "/tftpboot/\n";
print $pcfg " imgfetch -n pxelinux.0 http://" . '${next-server}' . ':' . $httpport . "/tftpboot/xcat/pxelinux.0\n";
print $pcfg " imgload pxelinux.0\n";
print $pcfg " imgexec pxelinux.0\n";
close($pcfg);
@@ -286,11 +292,11 @@ sub setstate {
$kern->{kcmdline} =~ s/xcat\/netboot/\/tftpboot\/xcat\/netboot/;
}
print $ucfg "#!gpxe\n";
print $ucfg 'chain http://${next-server}/tftpboot/xcat/esxboot-x64.efi ' . $kern->{kcmdline} . "\n";
print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/esxboot-x64.efi ' . $kern->{kcmdline} . "\n";
close($ucfg);
}
} else { #other than comboot/multiboot, we won't have need of pxelinux
print $pcfg "imgfetch -n kernel http://" . '${next-server}/tftpboot/' . $kern->{kernel} . "\n";
print $pcfg "imgfetch -n kernel http://" . '${next-server}:' . $httpport.'/tftpboot/' . $kern->{kernel} . "\n";
print $pcfg "imgload kernel\n";
if ($kern->{kcmdline}) {
print $pcfg "imgargs kernel " . $kern->{kcmdline} . ' BOOTIF=01-${netX/machyp}' . "\n";
@@ -298,14 +304,14 @@ sub setstate {
print $pcfg "imgargs kernel BOOTIF=" . '${netX/mac}' . "\n";
}
if ($kern->{initrd}) {
print $pcfg "imgfetch http://" . '${next-server}' . "/tftpboot/" . $kern->{initrd} . "\n";
print $pcfg "imgfetch http://" . '${next-server}:' . "$httpport/tftpboot/" . $kern->{initrd} . "\n";
}
print $pcfg "imgexec kernel\n";
if ($kern->{kcmdline} and $kern->{initrd}) { #only a linux kernel/initrd pair should land here, write elilo config and uefi variant of xnba config file
my $ucfg;
open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi");
print $ucfg "#!gpxe\n";
print $ucfg 'chain http://${next-server}/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n";
print $ucfg 'chain http://${next-server}:'.$httpport.'/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/' . $node . ".elilo\n";
close($ucfg);
open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".elilo");
print $ucfg 'default="xCAT"' . "\n";
+23 -1
View File
@@ -30,6 +30,8 @@ my $udpctl;
my $pid_UDP;
my $pid_MON;
my $numofnodes=0;
# ----used for command log start---------
my $cmdlog_svrpid;
@@ -507,7 +509,12 @@ sub do_installm_service {
node => [$node],
arg => ["$newstat"],
);
xCAT::MsgUtils->trace(0, "I", "xcatd: triggering \'updatenodestat $node $newstat\'...");
# TODO, better to use constant here for the specified status
if ($newstat eq 'installing') {
xCAT::MsgUtils->trace(0, "I", "xcat.updatestatus - $node: provisioning detected...");
} elsif ($newstat eq 'netbooting') {
xCAT::MsgUtils->trace(0, "I", "xcat.updatestatus - $node: provisioning detected...");
}
# node should be blocked, race condition may occur otherwise
#my $pid=xCAT::Utils->xfork();
#unless ($pid) { # fork off the nodeset and potential slowness
@@ -2165,6 +2172,7 @@ sub plugin_command {
}
}
}
}
my $dispatch_parentfd;
@@ -2622,6 +2630,10 @@ sub populate_site_hash {
foreach (@records) {
$::XCATSITEVALS{ $_->{key} } = $_->{value};
}
unless (exists($::XCATSITEVALS{'httpport'}) and ($::XCATSITEVALS{'httpport'} ne "")){
$::XCATSITEVALS{'httpport'}="80";
}
}
sub populate_vpd_hash {
@@ -2661,6 +2673,9 @@ sub send_response {
if ( (ref($rsp) eq 'ARRAY') && scalar(@$rsp) > 0 ) {
foreach (@$rsp) {
$_->{xcatdsource}->[0] = $MYXCATSERVER unless ($_->{xcatdsource});
if ($_->{numofnodes}) {
$numofnodes = $_->{numofnodes}->[0];
}
}
}
}
@@ -2803,6 +2818,12 @@ sub service_connection {
if ($enable_perf) {
xCAT::MsgUtils->perf_log_process('immediate', $req);
}
if (exists($req->{noderange}) && defined($req->{noderange}->[0])) {
my @nnodes = xCAT::NodeRange::noderange($req->{noderange}->[0]);
$numofnodes = (scalar(@nnodes));
}
# ----used for command log start----------
$cmdlog_starttime = time();
my ($sec, $min, $hour, $mday, $mon, $year) = localtime($cmdlog_starttime);
@@ -3018,6 +3039,7 @@ sub service_connection {
}
# ----used for command log start-------
$cmdlog_alllog .= "[NumberNodes] $numofnodes \n";
my $reqhandletime = sprintf("%.3f", time()-$cmdlog_starttime);
$cmdlog_alllog .= "[ElapsedTime] $reqhandletime s\n";
cmdlog_submitlog();
@@ -331,11 +331,13 @@ EOF
env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}"
#force openibd load all modules in need, restart again
sleep 1
service openibd restart
if [ "$?" != "0" ] ;then
echo "[Error] service openibd restart failed."
exit 1
if [ "$NODESETSTATE" = "boot" ]; then
sleep 1
service openibd restart
if [ "$?" != "0" ]; then
echo "[Error] service openibd restart failed."
exit 1
fi
fi
fi
@@ -34,9 +34,13 @@ export MASTER_IP="#XCATVAR:XCATMASTER#"
export MASTER_IPS="#XCATVAR:XCATMASTER#"
export MASTER="#XCATVAR:XCATMASTER#"
export INSTALLDIR=#TABLE:site:key=installdir:value#
export HTTPPORT=#TABLEBLANKOKAY:site:key=httpport:value#
if [ -z "$INSTALLDIR" ]; then
INSTALLDIR="/install"
fi
if [ -z "$HTTPPORT" ]; then
HTTPPORT="80"
fi
cd /tmp
RAND=$(perl -e 'print int(rand(50)). "\n"')
sleep $RAND
@@ -45,7 +49,7 @@ do
GOTIT=0
for i in $MASTER_IPS
do
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -e robots=off -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 0 -T 60 http://$i$INSTALLDIR/postscripts/ -P /xcatpost
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -e robots=off -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 0 -T 60 http://${i}:${HTTPPORT}${INSTALLDIR}/postscripts/ -P /xcatpost
#wget --wait=10 --random-wait --waitretry=10 --retry-connrefused -t 0 -T 60 http://$i/install/autoinst/xcatpost.tar.gz
if [ "$?" = "0" ]
then
@@ -95,6 +99,14 @@ do
else
echo "XCATSERVER=$i" >> /opt/xcat/xcatinfo
fi
grep 'HTTPPORT' /opt/xcat/xcatinfo > /dev/null 2>&1
if [ $? -eq 0 ]; then
sed -i "s/HTTPPORT=.*/HTTPPORT=$HTTPPORT/" /opt/xcat/xcatinfo
else
echo "HTTPPORT=$HTTPPORT" >> /opt/xcat/xcatinfo
fi
break
fi
RAND=$(perl -e 'print int(rand(5)). "\n"')
@@ -8,6 +8,7 @@ export XCATIPORT=#TABLE:site:key=xcatiport:value#
export INSTALLDIR=#TABLE:site:key=installdir:value#
export TFTPDIR=#TABLE:site:key=tftpdir:value#
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
export HTTPPORT="#TABLEBLANKOKAY:site:key=httpport:value#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
@@ -27,6 +28,9 @@ fi
if [[ $TFTPDIR != /* ]]; then
TFTPDIR="/"$TFTPDIR
fi
if [ -z "$HTTPPORT" ]; then
HTTPPORT="80"
fi
NODESTATUS=$(echo "$NODESTATUS"| tr -d \'\"| tr A-Z a-z)
@@ -74,6 +78,13 @@ else
echo "INSTALLDIR=$INSTALLDIR" >> /opt/xcat/xcatinfo
fi
grep 'HTTPPORT' /opt/xcat/xcatinfo > /dev/null 2>&1
if [ $? -eq 0 ]; then
sed -i "s/HTTPPORT=.*/HTTPPORT=$HTTPPORT/" /opt/xcat/xcatinfo
else
echo "HTTPPORT=$HTTPPORT" >> /opt/xcat/xcatinfo
fi
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
msgutil_r "$MASTER_IP" "debug" "/opt/xcat/xcatinfo generated" "/var/log/xcat/xcat.log" "$log_label"
fi
@@ -88,7 +99,7 @@ if [ ! -x /usr/bin/wget ]; then
sleep 36500d
fi
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -e robots=off -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 20 -T 60 http://$MASTER_IP$INSTALLDIR/postscripts/ -P /xcatpost 2> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -e robots=off -nH --cut-dirs=2 --reject "index.html*" --no-parent -t 20 -T 60 http://${MASTER_IP}:${HTTPPORT}${INSTALLDIR}/postscripts/ -P /xcatpost 2> /tmp/wget.log
if [ "$?" != "0" ]; then
msgutil_r "$MASTER_IP" "error" "failed to download postscripts from http://$MASTER_IP$INSTALLDIR/postscripts/,check /tmp/wget.log on the node, halt ..." "/var/log/xcat/xcat.log" "$log_label"
/tmp/updateflag $MASTER $XCATIPORT "installstatus failed"
@@ -105,7 +116,7 @@ export NODE=#TABLE:nodelist:THISNODE:node#
msgutil_r "$MASTER_IP" "info" "trying to get mypostscript from $MASTER_IP..." "/var/log/xcat/xcat.log" "$log_label"
wget -N --waitretry=10 --random-wait --retry-connrefused -t 20 -T 60 http://$MASTER_IP$TFTPDIR/mypostscripts/mypostscript.$NODE -P /xcatpost 2> /tmp/wget.log
wget -N --waitretry=10 --random-wait --retry-connrefused -t 20 -T 60 http://${MASTER_IP}:${HTTPPORT}${TFTPDIR}/mypostscripts/mypostscript.$NODE -P /xcatpost 2> /tmp/wget.log
if [ "$?" = "0" ]; then
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
msgutil_r "$MASTER_IP" "debug" "precreated mypostscript downloaded successfully" "/var/log/xcat/xcat.log" "$log_label"
@@ -196,9 +207,10 @@ run_ps () {
if [ -z \"\$scriptype\" ]; then
scriptype=\"postscript\"
fi
log_label=\"xcat.deployment.\"\$scriptype
export LOGLABEL=\$log_label
if [ -f \$1 ]; then
msgutil_r \"\$MASTER_IP\" \"info\" "\"Running \$scriptype: \$1\"" \"\$logfile\" \"xcat.mypostscript\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"\$scriptype start..: \$1\"" \"\$logfile\" \"\$log_label\"
if [ \"\$XCATDEBUGMODE\" = \"1\" ] || [ \"\$XCATDEBUGMODE\" = \"2\" ]; then
local compt=\$(file \$1)
local reg=\"shell script\"
@@ -206,7 +218,7 @@ run_ps () {
bash -x ./\$@ 2>&1
ret_local=\$?
else
./\$@ 2>&1 | logger -t xcat -p debug
./\$@ 2>&1 | logger -t \$log_label -p debug
ret_local=\${PIPESTATUS[0]}
fi
else
@@ -217,9 +229,9 @@ run_ps () {
if [ \"\$ret_local\" -ne \"0\" ]; then
return_value=\$ret_local
fi
msgutil_r \"\$MASTER_IP\" \"info\" "\"\$scriptype \$1 return with \$ret_local\"" \"\$logfile\" \"xcat.mypostscript\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"\$scriptype end...: \$1 return with \$ret_local\"" \"\$logfile\" \"\$log_label\"
else
msgutil_r \"\$MASTER_IP\" \"error\" "\"\$scriptype \$1 does NOT exist.\"" \"\$logfile\" \"xcat.mypostscript\"
msgutil_r \"\$MASTER_IP\" \"error\" "\"\$scriptype \$1 does NOT exist.\"" \"\$logfile\" \"\$log_label\"
return_value=-1
fi
@@ -242,9 +242,9 @@ run_ps () {
if [ -z \"\$scriptype\" ]; then
scriptype=\"postscript\"
fi
log_label=\"xcat.deployment.\"\$scriptype
if [ -f \$1 ]; then
msgutil_r \"\$MASTER_IP\" \"info\" "\"Running \$scriptype: \$1\"" \"\$logfile\" \"xcat.mypostscript\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"Running \$scriptype: \$1\"" \"\$logfile\" \"\$log_label\"
if [ \"\$XCATDEBUGMODE\" = \"1\" ] || [ \"\$XCATDEBUGMODE\" = \"2\" ]; then
local compt=\$(file \$1)
local reg=\"shell script\"
@@ -263,9 +263,9 @@ run_ps () {
if [ \"\$ret_local\" -ne \"0\" ]; then
return_value=\$ret_local
fi
msgutil_r \"\$MASTER_IP\" \"info\" "\"\$scriptype \$1 return with \$ret_local\"" \"\$logfile\" \"xcat.mypostscript\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"\$scriptype \$1 return with \$ret_local\"" \"\$logfile\" \"\$log_label\"
else
msgutil_r \"\$MASTER_IP\" \"error\" "\"\$scriptype \$1 does NOT exist.\"" \"\$logfile\" \"xcat.mypostscript\"
msgutil_r \"\$MASTER_IP\" \"error\" "\"\$scriptype \$1 does NOT exist.\"" \"\$logfile\" \"\$log_label\"
return_value=-1
fi
@@ -2,7 +2,11 @@ export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set -x
fi
export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
log_label="xcat.deployment"
msgutil_r "$MASTER_IP" "info" "============deployment starting============" "/var/log/xcat/xcat.log" "$log_label"
msgutil_r "$MASTER_IP" "info" "Running Anaconda Pre-Installation script..." "/var/log/xcat/xcat.log" "$log_label"
if grep n8r /proc/cmdline > /dev/null 2>&1;
then
stty crtscts
@@ -183,7 +187,7 @@ fi
#also, find first available block device (sda or vda likely)
#TODO: pick a likely non-SAN target if possible
shopt -s nullglob
msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label"
#
# The getinstdisk script is common for RHEL/SLES/PowerKVM/Ubuntu.
# It will attempt to select the install disk and write the selection to /tmp/xcat.install_disk
@@ -204,7 +208,7 @@ else
fi
BOOTFSTYPE=ext3
EFIFSTYPE=vfat
msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label"
if [ `uname -m` = "ppc64" ]; then
echo 'part None --fstype "PPC PReP Boot" --ondisk '$instdisk' --size 8' >> /tmp/partitionfile
fi
@@ -227,7 +231,7 @@ echo "part / --size 1 --grow --ondisk $instdisk --fstype $FSTYPE" >> /tmp/partit
echo "=================The Partition Scheme================"
cat /tmp/partitionfile
echo "====================================================="
msgutil_r "$MASTER_IP" "info" "Generate the repository for the installation" "/var/log/xcat/xcat.log" "$log_label"
# The following code is to generate the repository for the installation
cat /proc/cmdline
@@ -2,7 +2,11 @@ export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
set -x
fi
export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
log_label="xcat.deployment"
msgutil_r "$MASTER_IP" "info" "============deployment starting============" "/var/log/xcat/xcat.log" "$log_label"
msgutil_r "$MASTER_IP" "info" "Running Anaconda Pre-Installation script..." "/var/log/xcat/xcat.log" "$log_label"
if grep n8r /proc/cmdline > /dev/null 2>&1;
then
stty crtscts
@@ -38,7 +42,6 @@ sock.close()
EOF
cat >/tmp/foo.py <<EOF
#!/usr/bin/python
@@ -148,6 +151,7 @@ fi
#TODO: pick a likely non-SAN target if possible
shopt -s nullglob
msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label"
#
# The getinstdisk script is common for RHEL/SLES/PowerKVM/Ubuntu.
# It will attempt to select the install disk and write the selection to /tmp/xcat.install_disk
@@ -174,7 +178,7 @@ if uname -r|grep -q '^3.*el7'; then
FSTYPE=xfs
EFIFSTYPE=efi
fi
msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label"
echo "ignoredisk --only-use=$instdisk" >> /tmp/partitionfile
if [ `uname -m` = "ppc64" -o `uname -m` = "ppc64le" ]; then
echo 'part None --fstype "PPC PReP Boot" --ondisk '$instdisk' --size 8' >> /tmp/partitionfile
@@ -218,6 +222,7 @@ cat /tmp/partitionfile
echo "====================================================="
# The following code is to generate the repository for the installation
msgutil_r "$MASTER_IP" "info" "Generate the repository for the installation" "/var/log/xcat/xcat.log" "$log_label"
cat /proc/cmdline
NEXTSERVER=`cat /proc/cmdline | grep http | head -n 1`
@@ -5,7 +5,11 @@ case "$XCATDEBUGMODE" in
set -x
;;
esac
export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
log_label="xcat.deployment"
msgutil_r "$MASTER_IP" "info" "============deployment starting============" "/var/log/xcat/xcat.log" "$log_label"
msgutil_r "$MASTER_IP" "info" "Running Anaconda Pre-Installation script..." "/var/log/xcat/xcat.log" "$log_label"
if grep -q n8r /proc/cmdline >/dev/null 2>&1
then
stty crtscts
@@ -148,7 +152,7 @@ esac
# also, find first available block device (sda or vda likely)
# TODO: pick a likely non-SAN target if possible
shopt -s nullglob
msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label"
#
# The getinstdisk script is common for RHEL/SLES/PowerKVM/Ubuntu.
# It will attempt to select the install disk and write the selection to /tmp/xcat.install_disk
@@ -162,7 +166,7 @@ fi
BOOTFSTYPE=ext4
FSTYPE=ext4
EFIFSTYPE=efi
msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label"
echo "ignoredisk --only-use=$instdisk" >>/tmp/partitionfile
case "$(uname -m)" in
"ppc64"|"ppc64le")
@@ -171,14 +175,17 @@ case "$(uname -m)" in
esac
if [ -d /sys/firmware/efi ]
then
echo "part /boot/efi --fstype=$EFIFSTYPE --ondisk=$instdisk --size=250" >>/tmp/partitionfile
echo "part /boot/efi --fstype=$EFIFSTYPE --ondisk=$instdisk --size=256" >>/tmp/partitionfile
fi
# TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen...
echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=512" >>/tmp/partitionfile
echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=8192" >>/tmp/partitionfile
echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile
echo "volgroup system --pesize=4096 pv.000997" >>/tmp/partitionfile
echo "logvol / --fstype=$FSTYPE --name=root --vgname=system --grow --size=1024" >>/tmp/partitionfile
echo "logvol / --fstype=$FSTYPE --name=root --vgname=system --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile
echo "logvol /var --fstype=$FSTYPE --name=var --vgname=system --grow --size=2048 --maxsize=8192" >>/tmp/partitionfile
echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=system --grow --size=1024 --maxsize=4096" >>/tmp/partitionfile
echo "logvol /home --fstype=$FSTYPE --name=home --vgname=system --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile
echo "logvol swap --name=swap --vgname=system --recommended" >>/tmp/partitionfile
# Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file
@@ -207,7 +214,7 @@ fi
echo "================ The Partition Scheme ==============="
cat /tmp/partitionfile
echo "====================================================="
msgutil_r "$MASTER_IP" "info" "Generate the repository for the installation" "/var/log/xcat/xcat.log" "$log_label"
# The following code is to generate the repository for the installation
cat /proc/cmdline
@@ -9,6 +9,11 @@
#!/bin/sh
{
export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
log_label="xcat.deployment"
msgutil_r "$MASTER_IP" "info" "============deployment starting============" "/var/log/xcat/xcat.log" "$log_label"
msgutil_r "$MASTER_IP" "info" "Running AutoYaST Pre-Installation script..." "/var/log/xcat/xcat.log" "$log_label"
echo "Running AutoYaST Pre-Installation script..."
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
@@ -119,7 +124,7 @@ fi
/tmp/foo.awk >/tmp/foo.log 2>&1 &
shopt -s nullglob
msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label"
#
# The getinstdisk script is common for RHEL/SLES/PowerKVM/Ubuntu.
# It will attempt to select the install disk and write the selection to /tmp/xcat.install_disk
@@ -129,7 +134,7 @@ if [ -e "/tmp/xcat.install_disk" ]; then
instdisk=`cat /tmp/xcat.install_disk`
fi
msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label"
if [ -d /sys/firmware/efi ]; then
sed -e 's!<device>XCATPARTITIONHOOK</device>!<device>'$instdisk'</device><partitions config:type="list"><partition><filesystem config:type="symbol">vfat</filesystem><mount>/boot/efi</mount><size>128mb</size></partition><partition><mount>swap</mount><size>auto</size></partition><partition><mount>/</mount><size>auto</size></partition></partitions>!' /tmp/profile/autoinst.xml > /tmp/profile/modified.xml
else
@@ -147,7 +152,7 @@ if [ -r "/tmp/partitionfile" ]; then
sed -e '/<drive>/{N;N;s!.*!'$con'!}' /tmp/profile/autoinst.xml > /tmp/profile/modified1.xml
sed -e 's!xcattempspace! !g' /tmp/profile/modified1.xml > /tmp/profile/modified.xml
fi
msgutil_r "$MASTER_IP" "info" "Generate the repository for the installation" "/var/log/xcat/xcat.log" "$log_label"
export nextserver=`cat /proc/cmdline | grep http | awk -F'autoyast=http://' {'print \$2'} | awk -F':' {'print \$1'}`
cp /tmp/profile/modified.xml /tmp/profile/modified1.xml
sed -e 's!XCATNEXTSERVERHOOK!'$nextserver'!' /tmp/profile/modified1.xml > /tmp/profile/modified.xml
@@ -9,6 +9,11 @@
#!/bin/sh
{
export MASTER_IP="#ENV:MASTER_IP#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
log_label="xcat.deployment"
msgutil_r "$MASTER_IP" "info" "============deployment starting============" "/var/log/xcat/xcat.log" "$log_label"
msgutil_r "$MASTER_IP" "info" "Running AutoYaST Pre-Installation script..." "/var/log/xcat/xcat.log" "$log_label"
echo "Running AutoYaST Pre-Installation script..."
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
@@ -119,7 +124,7 @@ fi
/tmp/foo.awk >/tmp/foo.log 2>&1 &
shopt -s nullglob
msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label"
#
# The getinstdisk script is common for RHEL/SLES/PowerKVM/Ubuntu.
# It will attempt to select the install disk and write the selection to /tmp/xcat.install_disk
@@ -129,7 +134,7 @@ if [ -e "/tmp/xcat.install_disk" ]; then
instdisk=`cat /tmp/xcat.install_disk`
fi
msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label"
if [ -d /sys/firmware/efi ]; then
sed -e 's!<device>XCATPARTITIONHOOK</device>!<device>'$instdisk'</device><partitions config:type="list"><partition><filesystem config:type="symbol">vfat</filesystem><mount>/boot/efi</mount><size>128mb</size></partition><partition><mount>swap</mount><size>auto</size></partition><partition><mount>/</mount><size>auto</size></partition></partitions>!' /tmp/profile/autoinst.xml > /tmp/profile/modified.xml
else
@@ -147,7 +152,7 @@ if [ -r "/tmp/partitionfile" ]; then
sed -e '/<drive>/{N;N;s!.*!'$con'!}' /tmp/profile/autoinst.xml > /tmp/profile/modified1.xml
sed -e 's!xcattempspace! !g' /tmp/profile/modified1.xml > /tmp/profile/modified.xml
fi
msgutil_r "$MASTER_IP" "info" "Generate the repository for the installation" "/var/log/xcat/xcat.log" "$log_label"
export nextserver=`cat /proc/cmdline | grep http | awk -F'autoyast=http://' {'print \$2'} | awk -F':' {'print \$1'}`
cp /tmp/profile/modified.xml /tmp/profile/modified1.xml
sed -e 's!<software>!<add-on><add_on_products config:type="list">#INSTALL_SOURCES_IN_PRE#</add_on_products></add-on><software>!' /tmp/profile/modified1.xml > /tmp/profile/modified.xml
@@ -5,11 +5,11 @@ fi
#!/bin/sh
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
killall syslogd
syslogd -R #XCATVAR:XCATMASTER#
fi
killall syslogd
syslogd -R #XCATVAR:XCATMASTER#
log_label="xcat.deployment"
logger -t $log_label -p "info" "============deployment starting============"
logger -t $log_label -p "info" "Running preseeding early_command Installation script..."
if [ ! -c /dev/vcs ]; then
mknod /dev/vcs c 7 0
fi
@@ -187,7 +187,7 @@ base64decode()
))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\""
done
}
logger -t $log_label -p "info" "Generate partition file..."
if [ -d /sys/firmware/efi ]; then
echo "ubuntu-efi ::" > /tmp/partitionfile
echo " 512 512 1024 fat16" >> /tmp/partitionfile
@@ -5,11 +5,10 @@ fi
#!/bin/sh
if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then
killall syslogd
syslogd -R #XCATVAR:XCATMASTER#
fi
killall syslogd
syslogd -R #XCATVAR:XCATMASTER#
logger -t $log_label -p "info" "============deployment starting============"
logger -t $log_label -p "info" "Running preseeding early_command Installation script..."
if [ ! -c /dev/vcs ]; then
mknod /dev/vcs c 7 0
fi
@@ -201,7 +200,7 @@ base64decode()
))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\""
done
}
logger -t $log_label -p "info" "Generate partition file..."
if [ -d /sys/firmware/efi ]; then
echo "ubuntu-efi ::" > /tmp/partitionfile
echo " 512 512 1024 fat16" >> /tmp/partitionfile
@@ -75,9 +75,9 @@ xCATCmd () {
}
doconfigure () {
echo "DEBUG: enable=[$enable]; enablepart=[$enablepart]; disk=[$disk]; localspace=[$localspace]; swapspace=[$swapspace]; dev=[$dev]; parts=[$parts]; clear=[$clear];" >>$LOG
# run the configure script
if [ $isscript -eq 1 ]; then
echo "DEBUG: localdisk is run in script mode ..." >>$LOG
# run the script
chmod +x $SCRIPTFILE
$SCRIPTFILE
@@ -85,8 +85,10 @@ doconfigure () {
fi
if [ x"$enable" != x"yes" ]; then
echo "WARN: localdisk is not enabled, enable=[$enable]" >>$LOG
exit 1
fi
echo "DEBUG: enablepart=[$enablepart]; disk=[$disk]; localspace=[$localspace]; swapspace=[$swapspace]; dev=[$dev]; parts=[$parts]; clear=[$clear]; ptype=[$ptype]" >>$LOG
if [ $disk -eq 1 ]; then
if [ x"$enablepart" != x"yes" ]; then
return
@@ -105,7 +107,7 @@ doconfigure () {
# To recreate the disk label when clear=yes, this action is used to resolve the issue
# that the disk has been formatted by AIX
if [ x$clear != x ]; then
`parted -s $dev mklabel msdos`
`parted -s $dev mklabel $ptype`
fi
# remove all the partitions on the device
@@ -125,8 +127,8 @@ doconfigure () {
if [ x$devname = x"$dev" ]; then
#create the label
`parted -s $dev mklabel msdos`
echo "parted -s $dev mklabel msdos" >>$LOG
`parted -s $dev mklabel $ptype`
echo "parted -s $dev mklabel $ptype" >>$LOG
fi
fi
done < $PARTLOG
@@ -261,15 +263,15 @@ do
firstline=$LINE
# the format of first line should be: type=script|format
key=`echo \$firstline |awk -F= '{print \$1}'`
if [ x$key != x"type" ]; then
echo "Error: Cannot recognize the format of the parition configuration file." >>$LOG
if [ x"$key" != x"type" ]; then
echo "Error: Cannot recognize the format of the partition configuration file." >>$LOG
echo "Error to configure localdisk"
exit 1
fi
value=`echo \$firstline |awk -F= '{print \$2}'`
if [ x$value = x"script" ]; then
if [ x"$value" = x"script" ]; then
isscript=1
elif [ x$value = x"format" ]; then
elif [ x"$value" = x"format" ]; then
isformat=1
fi
continue
@@ -288,6 +290,7 @@ do
dev=""
clear=""
parts=""
ptype="msdos"
elif [ x$LINE = x"[localspace]" ]; then
doconfigure
disk=0
@@ -308,6 +311,8 @@ do
dev=$value
elif [ x$key = x"clear" ]; then
clear=$value
elif [ x$key = x"ptype" ]; then
ptype=$value
elif [ x$key = x"parts" ]; then
parts=$value
elif [ x$key = x"fstype" ]; then
@@ -1,6 +1,8 @@
#!/bin/sh
#script to update nodelist.nodestatus during provision
XCAT="$(getarg XCAT=)"
STATEMNT="$(getarg STATEMNT=)"
MASTER=`echo $XCAT |awk -F: '{print $1}'`
getarg nonodestatus
@@ -11,8 +13,12 @@ if [ $? -ne 0 ]; then
XCATIPORT="3002"
fi
log_label="xcat.deployment"
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..."
[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS"
if [ $NODESTATUS -ne 0 ];then
logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
@@ -2,7 +2,7 @@
NEWROOT=$3
RWDIR=.statelite
XCATMASTER=$XCAT
log_label="xcat.deployment"
. /lib/dracut-lib.sh
rootlimit="$(getarg rootlimit=)"
@@ -20,7 +20,7 @@ xcatdebugmode="$(getarg xcatdebugmode=)"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "running xcatroot...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
logger -t $log_label -p local4.info "=============deployment starting===================="
if [ "$NODESTATUS" != "0" ]; then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
@@ -13,8 +13,12 @@ if [ $? -ne 0 ]; then
XCATIPORT="3002"
fi
log_label="xcat.deployment"
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..."
[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS"
if [ $NODESTATUS -ne 0 ];then
logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
@@ -1,9 +1,13 @@
#!/bin/sh
log_label="xcat.deployment"
NEWROOT=/sysroot
SERVER=${SERVER%%/*}
SERVER=${SERVER%:}
RWDIR=.statelite
XCAT="$(getarg XCAT=)"
xcatdebugmode="$(getarg xcatdebugmode=)"
XCATMASTER=$XCAT
MASTER=`echo $XCATMASTER |awk -F: '{print $1}'`
STATEMNT="$(getarg STATEMNT=)"
if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess
SNAPSHOTSERVER=${STATEMNT%:*}
@@ -17,6 +21,9 @@ if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other
fi
fi
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcat-prepivot to set up statelite..."
echo Setting up Statelite
mkdir -p $NEWROOT
@@ -27,14 +34,18 @@ MAXTRIES=7
ITER=0
if [ ! -e "$NEWROOT/$RWDIR" ]; then
echo ""
echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
msg="This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
echo "$msg"
echo ""
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
fi
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
echo ""
echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode"
msg="$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with the -m statelite mode"
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
echo ""
/bin/sh
fi
@@ -59,15 +70,19 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems:
msg="Your are dead, rpower $ME boot to play again.
Possible problems:
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
exit
fi
RS=$(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
@@ -78,13 +93,17 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! umount -l $NEWROOT/$RWDIR/persistent; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
msg="Your are dead, rpower $ME boot to play again.
Cannot umount $NEWROOT/$RWDIR/persistent."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
exit
fi
RS=$(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
@@ -93,20 +112,26 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
msg="Your are dead, rpower $ME boot to play again.
Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
echo $msg
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
/bin/sh
exit
fi
RS=$(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
fi
# TODO: handle the dhclient/resolv.conf/ntp, etc
echo "Get to enable localdisk"
logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..."
echo "Enable localdisk ..."
$NEWROOT/etc/init.d/localdisk
logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..."
$NEWROOT/etc/init.d/statelite
READONLY=yes
export READONLY
@@ -174,3 +199,4 @@ fi
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh
# force udevsettle to break
> $hookdir/initqueue/work
logger $SYSLOGHOST -t $log_label -p local4.info "Exit xcat-prepivot"
@@ -21,7 +21,7 @@ if [ $? -ne 0 ]; then
fi
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcatroot to prepare for netbooting (dracut_33)..."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS"
@@ -168,6 +168,7 @@ elif [ -r /rootimg-statelite.gz ]; then
echo ""
echo "The /$RWDIR directory doesn't exist in the rootimg... "
echo ""
logger $SYSLOGHOST -t $log_label -p local4.err "The /$RWDIR directory doesn't exist in the rootimg..."
/bin/sh
fi
@@ -175,6 +176,7 @@ elif [ -r /rootimg-statelite.gz ]; then
echo ""
echo "$NEWROOT/etc/init.d/statelite doesn't exist... "
echo ""
logger $SYSLOGHOST -t $log_label -p local4.err "$NEWROOT/etc/init.d/statelite doesn't exist... "
/bin/sh
fi
@@ -208,10 +210,12 @@ elif [ -r /rootimg-statelite.gz ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "You are dead, rpower $ME boot to play again."
echo "Possible problems:
msg="You are dead, rpower $ME boot to play again.
Possible problems:
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.err "$msg"
/bin/sh
exit
fi
@@ -227,8 +231,10 @@ elif [ -r /rootimg-statelite.gz ]; then
while ! umount -l $NEWROOT/$RWDIR/persistent; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
msg="Your are dead, rpower $ME boot to play again.
Cannot umount $NEWROOT/$RWDIR/persistent."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.err "$msg"
/bin/sh
exit
fi
@@ -242,8 +248,10 @@ elif [ -r /rootimg-statelite.gz ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
msg="Your are dead, rpower $ME boot to play again.
Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.err "$msg"
/bin/sh
exit
fi
@@ -253,7 +261,9 @@ elif [ -r /rootimg-statelite.gz ]; then
done
fi
logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..."
$NEWROOT/etc/init.d/localdisk
logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..."
$NEWROOT/etc/init.d/statelite
fastboot=yes
export fastboot
@@ -1,5 +1,4 @@
#!/bin/bash
set -x
#!/bin/sh
#script to update nodelist.nodestatus during provision
XCAT="$(getarg XCAT=)"
@@ -14,8 +13,12 @@ if [ $? -ne 0 ]; then
XCATIPORT="3002"
fi
log_label="xcat.deployment"
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..."
[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS"
if [ $NODESTATUS -ne 0 ];then
logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
@@ -1,10 +1,13 @@
#!/bin/bash
set -x
log_label="xcat.deployment"
NEWROOT=/sysroot
SERVER=${SERVER%%/*}
SERVER=${SERVER%:}
RWDIR=.statelite
XCAT="$(getarg XCAT=)"
xcatdebugmode="$(getarg xcatdebugmode=)"
XCATMASTER=$XCAT
MASTER=`echo $XCATMASTER |awk -F: '{print $1}'`
STATEMNT="$(getarg STATEMNT=)"
if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess
SNAPSHOTSERVER=${STATEMNT%:*}
@@ -18,6 +21,9 @@ if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other
fi
fi
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcat-prepivot to set up statelite..."
echo Setting up Statelite
mkdir -p $NEWROOT
@@ -28,14 +34,18 @@ MAXTRIES=7
ITER=0
if [ ! -e "$NEWROOT/$RWDIR" ]; then
echo ""
echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
msg="This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
echo "$msg"
echo ""
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
fi
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
echo ""
echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode"
msg="$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with the -m statelite mode"
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
echo ""
/bin/sh
fi
@@ -60,15 +70,19 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems:
msg="Your are dead, rpower $ME boot to play again.
Possible problems:
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
exit
fi
RS=$(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
@@ -79,13 +93,17 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! umount -l $NEWROOT/$RWDIR/persistent; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
msg="Your are dead, rpower $ME boot to play again.
Cannot umount $NEWROOT/$RWDIR/persistent."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
exit
fi
RS=$(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
@@ -94,20 +112,26 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
msg="Your are dead, rpower $ME boot to play again.
Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
echo $msg
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
/bin/sh
exit
fi
RS=$(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
fi
# TODO: handle the dhclient/resolv.conf/ntp, etc
echo "Get to enable localdisk"
logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..."
echo "Enable localdisk ..."
$NEWROOT/etc/init.d/localdisk
logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..."
$NEWROOT/etc/init.d/statelite
READONLY=yes
export READONLY
@@ -175,3 +199,4 @@ fi
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh
# force udevsettle to break
> $hookdir/initqueue/work
logger $SYSLOGHOST -t $log_label -p local4.info "Exit xcat-prepivot"
@@ -1,5 +1,4 @@
#!/bin/bash
set -x
log_label="xcat.deployment"
NEWROOT=$3
@@ -22,7 +21,7 @@ if [ $? -ne 0 ]; then
fi
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcatroot to prepare for netbooting (dracut_33)..."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS"
@@ -169,6 +168,7 @@ elif [ -r /rootimg-statelite.gz ]; then
echo ""
echo "The /$RWDIR directory doesn't exist in the rootimg... "
echo ""
logger $SYSLOGHOST -t $log_label -p local4.err "The /$RWDIR directory doesn't exist in the rootimg..."
/bin/sh
fi
@@ -176,6 +176,7 @@ elif [ -r /rootimg-statelite.gz ]; then
echo ""
echo "$NEWROOT/etc/init.d/statelite doesn't exist... "
echo ""
logger $SYSLOGHOST -t $log_label -p local4.err "$NEWROOT/etc/init.d/statelite doesn't exist... "
/bin/sh
fi
@@ -209,10 +210,12 @@ elif [ -r /rootimg-statelite.gz ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "You are dead, rpower $ME boot to play again."
echo "Possible problems:
msg="You are dead, rpower $ME boot to play again.
Possible problems:
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.err "$msg"
/bin/sh
exit
fi
@@ -228,8 +231,10 @@ elif [ -r /rootimg-statelite.gz ]; then
while ! umount -l $NEWROOT/$RWDIR/persistent; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
msg="Your are dead, rpower $ME boot to play again.
Cannot umount $NEWROOT/$RWDIR/persistent."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.err "$msg"
/bin/sh
exit
fi
@@ -243,8 +248,10 @@ elif [ -r /rootimg-statelite.gz ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
msg="Your are dead, rpower $ME boot to play again.
Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.err "$msg"
/bin/sh
exit
fi
@@ -254,7 +261,9 @@ elif [ -r /rootimg-statelite.gz ]; then
done
fi
logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..."
$NEWROOT/etc/init.d/localdisk
logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..."
$NEWROOT/etc/init.d/statelite
fastboot=yes
export fastboot
@@ -1,7 +1,7 @@
#!/bin/sh
echo $drivers
dracut_install wget cpio gzip modprobe wc touch echo cut
dracut_install grep ifconfig hostname awk egrep grep dirname expr
dracut_install grep ifconfig hostname awk egrep grep dirname expr logger
dracut_install parted mke2fs bc mkswap swapon chmod
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
inst_hook pre-mount 5 "$moddir/xcat-premount.sh"
@@ -1,6 +1,7 @@
#!/bin/sh
#script to update nodelist.nodestatus during provision
XCAT="$(getarg XCAT=)"
STATEMNT="$(getarg STATEMNT=)"
MASTER=`echo $XCAT |awk -F: '{print $1}'`
getarg nonodestatus
@@ -11,8 +12,13 @@ if [ $? -ne 0 ]; then
XCATIPORT="3002"
fi
log_label="xcat.deployment"
xcatdebugmode="$(getarg xcatdebugmode=)"
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Starting xcat-premount..."
[ "$xcatdebugmode" > "0" ] && logger $SYSLOGHOST -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS"
if [ $NODESTATUS -ne 0 ];then
logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
@@ -1,8 +1,13 @@
#!/bin/sh
log_label="xcat.deployment"
NEWROOT=/sysroot
SERVER=${SERVER%%/*}
SERVER=${SERVER%:}
RWDIR=.statelite
XCAT="$(getarg XCAT=)"
xcatdebugmode="$(getarg xcatdebugmode=)"
XCATMASTER=$XCAT
MASTER=`echo $XCATMASTER |awk -F: '{print $1}'`
if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess
SNAPSHOTSERVER=${STATEMNT%:*}
SNAPSHOTROOT=${STATEMNT#*/}
@@ -14,7 +19,8 @@ if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other
SNAPSHOTSERVER=
fi
fi
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcat-prepivot to set up statelite..."
echo Setting up Statelite
mkdir -p $NEWROOT
@@ -25,15 +31,18 @@ MAXTRIES=7
ITER=0
if [ ! -e "$NEWROOT/$RWDIR" ]; then
echo ""
echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
msg="This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
echo "$msg"
echo ""
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
fi
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
echo ""
echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode"
msg="$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode"
echo ""
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
fi
@@ -57,15 +66,19 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems:
msg="Your are dead, rpower $ME boot to play again.
Possible problems:
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
exit
fi
RS= $(( $RANDOM % 20 ))
echo "Trying again in $RS seconds..."
msg="Trying again in $RS seconds..."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
sleep $RS
done
@@ -76,8 +89,10 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! umount -l $NEWROOT/$RWDIR/persistent; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
msg="Your are dead, rpower $ME boot to play again.
Cannot umount $NEWROOT/$RWDIR/persistent."
echo "$msg"
logger $SYSLOGHOST -t $log_label -p local4.error "$msg"
/bin/sh
exit
fi
@@ -91,8 +106,10 @@ if [ ! -z $SNAPSHOTSERVER ]; then
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
ITER=$(( ITER + 1 ))
if [ "$ITER" == "$MAXTRIES" ]; then
echo "Your are dead, rpower $ME boot to play again."
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
msg="Your are dead, rpower $ME boot to play again.
Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
echo $msg
logger $SYSLOGHOST -t $log_label -p local4.info "$msg"
/bin/sh
exit
fi
@@ -103,8 +120,10 @@ if [ ! -z $SNAPSHOTSERVER ]; then
fi
# TODO: handle the dhclient/resolv.conf/ntp, etc
echo "Get to enable localdisk"
logger $SYSLOGHOST -t $log_label -p local4.info "Enabling localdisk ..."
echo "Enable localdisk ..."
$NEWROOT/etc/init.d/localdisk
logger $SYSLOGHOST -t $log_label -p local4.info "Preparing mount points ..."
$NEWROOT/etc/init.d/statelite
READONLY=yes
export READONLY
@@ -175,3 +194,4 @@ fi
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh
# force udevsettle to break
> $hookdir/initqueue/work
logger $SYSLOGHOST -t $log_label -p local4.info "Exit xcat-prepivot"
@@ -1,11 +1,12 @@
#!/bin/sh
log_label="xcat.deployment"
NEWROOT=$3
RWDIR=.statelite
XCATMASTER=$XCAT
. /lib/dracut-lib.sh
XCAT="$(getarg XCAT=)"
XCATMASTER=$XCAT
rootlimit="$(getarg rootlimit=)"
@@ -19,25 +20,27 @@ XCATIPORT="3002"
fi
xcatdebugmode="$(getarg xcatdebugmode=)"
[ "$xcatdebugmode" = "1" -o "$xcatdebugmode" = "2" ] && SYSLOGHOST="" || SYSLOGHOST="-n $MASTER"
logger $SYSLOGHOST -t $log_label -p local4.info "=============deployment starting===================="
logger $SYSLOGHOST -t $log_label -p local4.info "Executing xcatroot to prepare for netbooting (dracut_033)..."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "running xcatroot...."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT"
if [ $NODESTATUS -ne 0 ];then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
logger $SYSLOGHOST -t $log_label -p local4.info "Sending request to $MASTER:$XCATIPORT for changing status to netbooting..."
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
fi
if [ ! -z "$imgurl" ]; then
if [ xhttp = x${imgurl%%:*} ]; then
logger $SYSLOGHOST -t $log_label -p local4.info "Downloading rootfs image from $imgurl..."
NFS=0
FILENAME=${imgurl##*/}
while [ ! -r "$FILENAME" ]; do
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl...."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "downloading $imgurl...."
echo Getting $imgurl...
if ! wget -nv $imgurl; then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl failed,retrying...."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "downloading $imgurl failed,retrying...."
rm -f $FILENAME
sleep 27
fi
@@ -68,7 +71,7 @@ if [ -r /rootimg.sfs ]; then
mount --move /ro $NEWROOT/ro
mount --move /rw $NEWROOT/rw
elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg downloaded,setting up RAM-root tmpfs...."
logger $SYSLOGHOST -t $log_label -p local4.info "Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]..."
echo Setting up RAM-root tmpfs.
if [ -z $rootlimit ];then
mount -t tmpfs -o mode=755 rootfs $NEWROOT
@@ -77,7 +80,7 @@ elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then
fi
cd $NEWROOT
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "Extracting root filesystem:"
echo -n "Extracting root filesystem:"
if [ -r /rootimg.cpio.gz ]; then
if [ -x /bin/cpio ]; then
@@ -93,10 +96,10 @@ elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then
fi
fi
$NEWROOT/etc/init.d/localdisk
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "Done...."
echo Done
elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg downloaded,setting up RAM-root tmpfs...."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "rootimg downloaded,setting up RAM-root tmpfs...."
echo Setting up RAM-root tmpfs.
if [ -z $rootlimit ];then
mount -t tmpfs -o mode=755 rootfs $NEWROOT
@@ -105,7 +108,7 @@ elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then
fi
cd $NEWROOT
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "Extracting root filesystem:"
echo -n "Extracting root filesystem:"
if [ -r /rootimg.tar.gz ]; then
tar --selinux --xattrs-include='*' -zxf /rootimg.tar.gz
@@ -119,7 +122,7 @@ elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then
fi
fi
$NEWROOT/etc/init.d/localdisk
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "Done...."
echo Done
elif [ -r /rootimg-statelite.gz ]; then
echo Setting up RAM-root tmpfs for statelite mode.
@@ -244,18 +247,18 @@ elif [ -r /rootimg-statelite.gz ]; then
mount -n --bind /sys $NEWROOT/sys
else
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Failed to download image, panicing in 5..."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "Failed to download image, panicing in 5..."
echo -n Failed to download image, panicing in 5...
for i in 4 3 2 1 0; do
/bin/sleep 1
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "$i..."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "$i..."
echo -n $i...
done
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "You're dead. rpower nodename reset to play again."
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "You're dead. rpower nodename reset to play again."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs"
echo
echo "You're dead. rpower nodename reset to play again.
@@ -296,7 +299,7 @@ if [ -z $STATEMNT ]; then
netif=${lf#*.}
netif=${netif%.*}
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
done
if [ ! -z "$ifname" ]; then
@@ -312,10 +315,10 @@ if [ -z $STATEMNT ]; then
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
if [ ! -e $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX ]; then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX"
touch $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
fi
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes"
echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network/ifcfg-$ETHX
@@ -323,18 +326,18 @@ if [ -z $STATEMNT ]; then
fi
fi
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/etc/resolv.conf"
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "saving $NEWROOT/etc/resolv.conf"
cp /etc/resolv.conf "$NEWROOT/etc/"
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "disable selinux ..."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "disable selinux ..."
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
fi
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "setting hostname..."
[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p debug "setting hostname..."
echo `hostname` > $NEWROOT/etc/hostname
[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "exiting xcatroot..."
logger $SYSLOGHOST -t $log_label -p debug "Exiting xcatroot..."
# inject new exit_if_exists
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh
@@ -6,7 +6,6 @@ linux-image-generic-lts-xenial
openssh-server
openssh-client
wget
vim
ntp
rsyslog
rsync
@@ -7,7 +7,6 @@ linux-image-generic
openssh-server
openssh-client
wget
vim
ntp
ntpdate
rsync
@@ -7,7 +7,6 @@ linux-image-generic
openssh-server
openssh-client
wget
vim
ntp
ntpdate
rsync
+24 -26
View File
@@ -1023,7 +1023,7 @@ sub mkinitrd {
NEWROOT="/sysroot"
SHELL="/bin/sh"
RWDIR=".statelite"
log_label="xcat.deployment"
# Define some colors
RESET="\033[0m"
@@ -1229,17 +1229,16 @@ ifconfig lo up
XCATMASTER=`echo \$XCATSERVER|awk -F: '{print \$1}'`
if [ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]; then
PORT="514"
syslogd -R \$XCATMASTER:\$PORT
fi
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t xcat -p debug "running init script..."
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t xcat -p debug "MASTER=\$XCATMASTER XCATIPORT=\$XCATIPORT"
PORT="514"
syslogd -R \$XCATMASTER:\$PORT
MASTER=`echo \$XCATMASTER |awk -F: '{print \$1}'`
logger -t \$log_label -p info "=============deployment starting===================="
logger -t \$log_label -p info "Executing init to prepare for netbooting"
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t \$log_label -p debug "MASTER=\$XCATMASTER XCATIPORT=\$XCATIPORT"
#update nodelist.nodestatus to "netbooting"
if [ \$NODESTATUS != 'n' ]; then
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t xcat -p debug "nodestatus: netbooting,reporting..."
logger -t \$log_label -p info "Sending request to \$XCATMASTER:\$XCATIPORT for changing status to netbooting..."
/tmp/updateflag \$XCATMASTER \$XCATIPORT "installstatus netbooting"
fi
@@ -1256,10 +1255,10 @@ for i in `cat /proc/cmdline`; do
MAXTRIES=5
ITER=0
while [ ! -r "\$FILENAME" ]; do
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t xcat -p debug "downloading \$VALUE..."
logger -t \$log_label -p info "Downloading rootfs image from \$VALUE..."
echo Getting \$VALUE...
if ! /usr/bin/wget \$VALUE; then
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t xcat -p debug "downloading \$VALUE failed,retrying..."
([ "\$xcatdebugmode" = "1" ] || [ "\$xcatdebugmode" = "2" ]) && logger -t \$log_label -p debug "downloading \$VALUE failed,retrying..."
ST=`expr \$RANDOM % 5`
sleep \$ST
rm -f \$FILENAME
@@ -1338,6 +1337,7 @@ if [ "\$STATELITE" = "1" ]; then
# for statelite mode on top of the ramdisk
EOMS
print $inifile " if [ -r /rootimg-statelite.gz ]; then\n";
print $inifile " logger -t \$log_label -p info \"Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]...\"\n";
print $inifile " echo Setting up RAM-root tmpfs.\n";
if ($rootlimit) {
print $inifile " mount -o \"size=$rootlimit,mode=755\" -t tmpfs rootfs \$NEWROOT \n";
@@ -1463,7 +1463,7 @@ if [ -r /rootimg.sfs ]; then
mount --move /rw \$NEWROOT/rw
EOMS
print $inifile "elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"rootimg downloaded,setting up RAM-root tmpfs...\"\n";
print $inifile " logger -t \$log_label -p info \"Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]...\"\n";
print $inifile " echo Setting up RAM-root tmpfs.\n";
if ($rootlimit) {
print $inifile " mount -o \"size=$rootlimit,mode=755\" -t tmpfs rootfs \$NEWROOT\n";
@@ -1471,7 +1471,7 @@ EOMS
print $inifile " mount -o mode=755 -t tmpfs rootfs \$NEWROOT\n";
}
print $inifile " cd \$NEWROOT\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Extracting root filesystem:\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"Extracting root filesystem:\"\n";
print $inifile " echo -n \"Extracting root filesystem:\"\n";
print $inifile " if [ -r /rootimg.cpio.gz ]; then\n";
print $inifile " if [ -x /bin/cpio ]; then\n";
@@ -1486,10 +1486,9 @@ EOMS
print $inifile " xz -cd /rootimg.cpio.xz |cpio -idum\n";
print $inifile " fi\n";
print $inifile " fi\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Done...\"\n";
print $inifile " echo Done\n";
print $inifile "elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"rootimg downloaded,setting up RAM-root tmpfs...\"\n";
print $inifile " logger -t \$log_label -p info \"Setting up RAM-root tmpfs on downloaded rootimg.cpio.[gz/xz]...\"\n";
print $inifile " echo Setting up RAM-root tmpfs.\n";
if ($rootlimit) {
@@ -1498,27 +1497,26 @@ EOMS
print $inifile " mount -o mode=755 -t tmpfs rootfs \$NEWROOT\n";
}
print $inifile " cd \$NEWROOT\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Extracting root filesystem:\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"Extracting root filesystem:\"\n";
print $inifile " echo -n \"Extracting root filesystem:\"\n";
print $inifile " if [ -r /rootimg.tar.gz ]; then\n";
print $inifile " /bin/tar --selinux --xattrs --xattrs-include='*' -zxf /rootimg.tar.gz\n";
print $inifile " elif [ -r /rootimg.tar.xz ]; then\n";
print $inifile " /bin/tar --selinux --xattrs --xattrs-include='*' -Jxf /rootimg.tar.xz\n";
print $inifile " fi\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Done...\"\n";
print $inifile " echo Done\n";
print $inifile "else\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Failed to download image, panicing in 5...\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"Failed to download image, panicing in 5...\"\n";
print $inifile " echo -n Failed to download image, panicing in 5...\n";
print $inifile " for i in 4 3 2 1 0; do\n";
print $inifile " /bin/sleep 5\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"\$i...\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"\$i...\"\n";
print $inifile " echo -n \$i...\n";
print $inifile " done\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"You're dead. rpower nodename reset to play again.\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"* Did you packimage with -m cpio, -m squashfs, or -m nfs?\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"You're dead. rpower nodename reset to play again.\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"* Did you packimage with -m cpio, -m squashfs, or -m nfs?\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop\"\n";
print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs\"\n";
print $inifile " echo\n";
print $inifile <<EOMS;
echo "You're dead. rpower nodename reset to play again.
@@ -1537,9 +1535,9 @@ EOMS
print $inifile "fi\n";
print $inifile "cd /\n";
print $inifile "cp /etc/hostname \$NEWROOT/etc/hostname\n";
print $inifile "([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"saving \$NEWROOT/etc/resolv.conf\"\n";
print $inifile "([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t \$log_label -p debug \"saving \$NEWROOT/etc/resolv.conf\"\n";
print $inifile "rm -f \$NEWROOT/etc/resolv.conf; cp /etc/resolv.conf \$NEWROOT/etc/resolv.conf\n";
print $inifile "([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"exiting init script...\"\n";
print $inifile "logger -t \$log_label -p info \"Exiting init ...\"\n";
print $inifile "mount --move /dev \$NEWROOT/dev \n";
print $inifile "mount --move /proc \$NEWROOT/proc \n";
print $inifile "mount --move /sys \$NEWROOT/sys \n";
@@ -1644,7 +1642,7 @@ EOMS
}
}
# add rsync for statelite
# add extra commands for initrd
foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevd", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/xz", "bin/gzip", "bin/tar") {
getlibs($_);
push @filestoadd, $_;
@@ -1,3 +1,4 @@
#!/bin/bash
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# To create certficate for docker host
echo "$0 xcatdockerhost"
@@ -1,3 +1,4 @@
#!/bin/bash
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# set up credentials for user to be able to run xCAT commands
# Must be run by root
+496 -144
View File
@@ -2,7 +2,7 @@
#
# go-xcat - Install xCAT automatically.
#
# Version 1.0.29
# Version 1.0.34
#
# Copyright (C) 2016, 2017, 2018 International Business Machines
# Eclipse Public License, Version 1.0 (EPL-1.0)
@@ -18,6 +18,9 @@
# - Use curl when it is available. Otherwise fall back to use wget
# - Improved tarball file extension handling
# - Disable xCAT-core.repo and xCAT-dep.repo if they exist
# 2018-09-28 GONG Jie <gongjie@linux.vnet.ibm.com>
# - Revised debug log
# - xCAT uninstallation
#
function usage()
@@ -50,6 +53,9 @@ function usage()
and xcat-dep packages from the repository
update updates installed xcat-core packages to the
latest version from the repository
uninstall removes xCAT from this system
completely uninstall removes xCAT from this system and cleans up
all the traces xCAT made
Examples:
${script}
@@ -62,8 +68,10 @@ function usage()
--xcat-dep=/path/to/xcat-dep.tar.bz2 install
${script} --xcat-core=http://xcat.org/path/to/xcat-core.tar.bz2 \\
--xcat-dep=http://xcat.org/path/to/xcat-dep.tar.bz2 install
${script} uninstall
${script} completely uninstall
xCAT: http://xcat.org
xCAT: http://xcat.org/
Full documentation at: http://xcat-docs.readthedocs.io/en/stable
EOF
}
@@ -96,16 +104,13 @@ function verbose_usage()
-h, --help display a simply version of help and exit
--long-help display this help and exit
EOF
println 12
println 16
while read -r ; do echo "${REPLY}" ; done <<-EOF
check check the version of the installed packages
of xCAT and packages in the repository
smoke test preform basic tests of the xCAT installation
EOF
println 2
while read -r ; do echo "${REPLY}" ; done <<-EOF
smoke-test preform basic tests of the xCAT installation
EOF
println 10
println 11
while read -r ; do echo "${REPLY}" ; done <<-EOF
${script} --xcat-core=/path/to/xcat-core.repo install
${script} --xcat-core=/path/to/xcat-core install
@@ -122,6 +127,11 @@ function verbose_usage()
${script} --xcat-core=/path/to/xcat-core \\
--xcat-dep=/path/to/xcat-dep install
EOF
println 4
while read -r ; do echo "${REPLY}" ; done <<-EOF
${script} check
${script} smoke test
EOF
println 999999 # Print out all the rest of lines
exec 42<&-
@@ -159,6 +169,14 @@ GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client
xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server
conserver-xcat elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat
xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi)
# The package list of all the packages should be installed
GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}"
goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder
xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps)
# For Debian/Ubuntu, it will need a sight different package list
type dpkg >/dev/null 2>&1 &&
GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}"
goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn)
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
export PATH
@@ -295,8 +313,10 @@ function internal_cleanup()
#
function custom_setup()
{
check_exec_or_exit awk cat comm grep printf sleep tee
check_exec_or_exit awk cat comm grep printf sleep
check_root_or_exit
debug_log_setup
}
#
@@ -304,7 +324,7 @@ function custom_setup()
#
function custom_cleanup()
{
:
debug_log_cleanup
}
#
@@ -319,6 +339,109 @@ function cleanup_n_exec()
exec "$@"
}
function debug_log_setup()
{
local script="${0##*/}"
local -a argv=()
set -- "${BASH_ARGV[@]}"
while [ "$#" -gt "0" ]
do
argv=("$1" "${argv[@]}")
shift
done
GO_XCAT_DEBUG_LOG="${TMP_DIR}/go-xcat.log"
GO_XCAT_LOG="/tmp/go-xcat.log"
# Global debug log file descriptor
: >"${GO_XCAT_DEBUG_LOG}"
ln -f "${GO_XCAT_DEBUG_LOG}" "${GO_XCAT_LOG}"
# Log all the command line arguments
{
echo " ."
echo " ."
echo " . :."
echo " .:"
echo " ::."
echo " :.::"
echo " ::::."
echo " :::::"
echo " :::::"
echo " :::::"
echo " :::::"
echo " :::::"
echo "..:::::.."
echo " ':::::'"
echo " ':'"
echo -n "|->"
printf " %q" "${script}" "${argv[@]}"
echo
echo
} | debug_logger debug
}
function debug_log_cleanup()
{
local rc="$?"
local script="${0##*/}"
if [[ -n "${GO_XCAT_DEBUG_LOG}" && -n "${GO_XCAT_LOG}" ]]
then
{
printf "\n|-> %-24s ... exited with %s\n" "${script}" "${rc}"
echo " ......"
echo " :::::"
echo " ::::::."
echo " ' ':::::."
echo " ':::::."
echo " '::"
echo " '"
} | debug_logger debug
[[ "${rc}" -eq "0" ]] && rm -f "${GO_XCAT_LOG}"
fi
}
function debug_logger()
{
local level="$1"
while read -r
do
case "${level}" in
"debug")
;;
*)
echo "${REPLY}"
;;
esac
echo "${REPLY}" >&2
done 2>>"${GO_XCAT_DEBUG_LOG}"
}
function debug_trace()
{
local rc="$?"
# Log the function name and all the command line arguments
{
echo
echo -n ".->"
printf " %q" "$@"
echo
echo "'========"
} | debug_logger debug
# BUG - The command "$@" will be run in a subshell
"$@" 2>&1 | debug_logger
rc="${PIPESTATUS[0]}"
printf ".========\n'-> %-24s ... returned with %s\n" "${1}" "${rc}" |
debug_logger debug
return "${rc}"
}
internal_setup
# Check operating system
@@ -415,7 +538,7 @@ function check_package_version_rpm()
else
echo "${ver}"
fi
done < <(rpm -q --qf '%{version}-%{release}\n' "$@" 2>/dev/null)
done < <(LC_ALL="C" rpm -q --qf '%{version}-%{release}\n' "$@" 2>/dev/null)
return 0
}
@@ -811,6 +934,31 @@ function add_repo_by_file_yum()
cp "${tmp}" "/etc/yum.repos.d/${repo_id}.repo"
}
# Dirty workaround on SLES11 SP4
# For SLES11, set gpgcheck=0
#
# $1 repo file
function github_issue_5503_workaround2()
{
[[ "${GO_XCAT_LINUX_DISTRO}" = "sles" ]] || return 0
[[ "${GO_XCAT_LINUX_VERSION}" =~ ^11(\.[0-4]){0,1}$ ]] || return 0
local repo_file="$1"
local tmp="${TMP_DIR}/tmp_repo_file_${repo_id}.repo.$$"
cp "${repo_file}" "${tmp}"
exit_if_bad "$?" "Copy file failed \`${repo_file}' -> \`${tmp}'"
while read -r
do
case "${REPLY}" in
"gpgcheck=1")
echo "gpgcheck=0"
;;
*)
echo "${REPLY}"
;;
esac
done <"${tmp}" >"${repo_file}"
}
# $1 repo file
# $2 repo id
function add_repo_by_file_zypper()
@@ -831,6 +979,8 @@ function add_repo_by_file_zypper()
echo "[${repo_id}]"
grep -v '^\[' "${repo_file}"
} >"${tmp}"
# For SLES11, set gpgcheck=0
github_issue_5503_workaround2 "${tmp}"
remove_repo_zypper "${repo_id}" &&
zypper addrepo "${tmp}" >/dev/null 2>&1
}
@@ -894,7 +1044,7 @@ function extract_archive()
gzip -d -c "${archive}" | tar -t -f - | grep -v "^${repo_id}/"
[[ "${PIPESTATUS[0]}" -eq 0 && "${PIPESTATUS[1]}" -eq 0 &&
"${PIPESTATUS[2]}" -eq 1 ]]
exit_if_bad "$?" "${archive}: bad gzipped tarball"
exit_if_bad "$?" "${archive}: bad gzipped tarball" || return 1
rm -rf "${install_path}/${repo_id}"
gzip -d -c "${archive}" | ( cd "${install_path}" && tar -x -f - )
;;
@@ -960,9 +1110,10 @@ function add_repo_by_url_yum_or_zypper()
while read -r ; do echo "${REPLY}" ; done >"${tmp}" <<-EOF
[${repo_id}]
name=${repo_id}
baseurl=${url}
baseurl=${url%/}
enabled=1
gpgcheck=0
gpgcheck=1
gpgkey=${url%/}/repodata/repomd.xml.key
EOF
add_repo_by_file "${tmp}" "${repo_id}"
return "$?"
@@ -995,10 +1146,19 @@ function add_repo_by_url_yum_or_zypper()
while read -r ; do echo "${REPLY}" ; done >"${tmp}" <<-EOF
[${repo_id}]
name=${repo_id}
baseurl=file://${url}
baseurl=file://${url%/}
enabled=1
gpgcheck=0
EOF
if [ -f "${url%/}/repodata/repomd.xml.asc" ]
then
echo "gpgcheck=1" >>"${tmp}"
else
echo "gpgcheck=0" >>"${tmp}"
fi
if [ -f "${url%/}/repodata/repomd.xml.key" ]
then
echo "gpgkey=file://${url%/}/repodata/repomd.xml.key" >>"${tmp}"
fi
add_repo_by_file "${tmp}" "${repo_id}"
return "$?"
fi
@@ -1057,7 +1217,8 @@ function add_repo_by_url_apt()
[[ "${url:0:1}" = "/" ]] || url="${PWD}/${url}"
# directory
tmp="${TMP_DIR}/tmp_repo.list"
echo "deb [arch=$(dpkg --print-architecture)] file://${url} ${codename} main" >"${tmp}"
echo "deb [$([ ! -f "${url}/dists/${codename}/Release.gpg" ] &&
echo "allow-insecure=yes ")arch=$(dpkg --print-architecture)] file://${url} ${codename} main" >"${tmp}"
add_repo_by_file_apt "${tmp}" "${repo_id}"
return "$?"
fi
@@ -1351,6 +1512,72 @@ function install_packages()
function_dispatch "${FUNCNAME}" "$@"
}
function remove_package_dnf()
{
type dnf >/dev/null 2>&1 || return 255
local -a yes=()
[[ "$1" = "-y" ]] && yes=("-y") && shift
dnf --nogpgcheck "${yes[@]}" remove "$@"
}
function remove_package_yum()
{
type yum >/dev/null 2>&1 || return 255
local -a yes=()
[[ "$1" = "-y" ]] && yes=("-y") && shift
yum --nogpgcheck "${yes[@]}" remove "$@"
}
function remove_package_zypper()
{
type zypper >/dev/null 2>&1 || return 255
local -a yes=()
local ret=""
[[ "$1" = "-y" ]] && yes=("-n") && shift
zypper --no-gpg-checks "${yes[@]}" remove --force-resolution "$@"
ret="$?"
case "${ret}" in
"104")
# ZYPPER_EXIT_INF_CAP_NOT_FOUND
ret="0"
;;
esac
return "${ret}"
}
function remove_package_apt()
{
type apt-get >/dev/null 2>&1 || return 255
local -a yes=()
[[ "$1" = "-y" ]] && yes=("-y") && shift
apt-get --allow-unauthenticated remove "${yes[@]}" "$@"
}
function remove_package()
{
function_dispatch "${FUNCNAME}" "$@"
}
# $1 -y
function purge_package_apt()
{
type apt-get >/dev/null 2>&1 || return 255
local -a yes=()
[[ "$1" = "-y" ]] && yes=("-y") && shift
apt-get --allow-unauthenticated purge "${yes[@]}" "$@"
}
function purge_package_others()
{
remove_package "$@"
}
# $1 -y
function purge_package()
{
function_dispatch "${FUNCNAME}" "$@"
}
# $1 -y
function install_xcat()
{
@@ -1381,12 +1608,81 @@ function update_xcat()
install_packages "$@" "${install_list[@]}"
}
# $1 -y
function uninstall_xcat()
{
remove_package "$@" "${GO_XCAT_UNINSTALL_LIST[@]}"
}
function kill_xcat()
{
local f=""
for f in /var/run/xcat{d,/{main,udp,install,cmdlog}service}.pid
do
[[ -f "${f}" ]] && kill -TERM "$(<"${f}")" 2>/dev/null
done
sleep 1
for f in /var/run/xcat{d,/{main,udp,install,cmdlog}service}.pid
do
[[ -f "${f}" ]] && kill -KILL "$(<"${f}")" 2>/dev/null
done
return 0
}
# Remove all xCAT related directories and files
function trash_xcat()
{
rm -f /etc/init.d/xcatpostinit1
rm -f /etc/systemd/system/xcatpostinit1.service
rm -f /etc/systemd/system/multi-user.target.wants/xcatd.service
rm -f /etc/tftpmapfile4xcat.conf
rm -f /etc/profile.d/xcat.{c,}sh
rm -rf /etc/xcat
rm -rf /etc/xcatdockerca
rm -f /etc/apt/sources.list.d/xcat-{core,dep}.list
rm -f /etc/yum.repos.d/xCAT-{core,dep}.repo{,.nouse}
rm -f /etc/yum.repos.d/xcat-{core,dep}.repo
rm -f /etc/zypp/repos.d/xCAT-{core,dep}.repo{,.nouse}
rm -f /etc/zypp/repos.d/xcat-{core,dep}.repo
rm -rf /install/postscripts
rm -rf /opt/xcat
rm -rf /root/.xcat
rm -rf /root/xcat-dbback
rm -rf /tftpboot/xcat
rm -rf /var/lock/xcat
rm -rf /var/log/xcat
rm -rf /xcatpost
# For goconserver
rm -rf /etc/goconserver
rm -rf /var/lib/goconserver
rm -rf /var/log/goconserver
return 0
}
function uninstall_xcat_completely()
{
purge_package -y "${GO_XCAT_UNINSTALL_LIST[@]}"
kill_xcat
trash_xcat
return 0
}
function list_xcat_packages()
{
GO_XCAT_CORE_PACKAGE_LIST=($(get_package_list xcat-core))
exit_if_bad "$?" "Failed to get package list from repository \`xcat-core'."
GO_XCAT_DEP_PACKAGE_LIST=($(get_package_list xcat-dep))
exit_if_bad "$?" "Failed to get package list from repository \`xcat-dep'."
[ "${#GO_XCAT_CORE_PACKAGE_LIST[@]}" -gt "0" ]
warn_if_bad "$?" "Failed to get package list from repository \`xcat-core'." || return 1
[ "${#GO_XCAT_DEP_PACKAGE_LIST[@]}" -gt "0" ]
warn_if_bad "$?" "Failed to get package list from repository \`xcat-dep'." || return 1
local -i cols="$(type tput >/dev/null 2>&1 && tput cols)"
[[ "${cols}" -lt 80 ]] && cols=80
@@ -1438,12 +1734,61 @@ function list_xcat_packages()
42< <(check_repo_version "${GO_XCAT_DEP_PACKAGE_LIST[@]}")
}
#
# ask_to_continue Ask to continue
#
# Exits (not returns) if get negative reply from end user.
# This function is intend to read from STDIN.
#
# $1 -y
# $2 Prompt
#
function ask_to_continue()
{
[[ "$1" = "-y" ]] && return 0
shift
local prompt="$1"
echo
echo "${prompt}"
echo | debug_logger debug
echo ".-> ${prompt}" | debug_logger debug
while :
do
read -r -p "Continue? [y/n] "
echo "'-> Continue? [y/n] ... ${REPLY}" | debug_logger debug
case "${REPLY}" in
"Y"*|"y"*)
break
;;
"N"*|"n"*)
echo "Good-bye!"
exit 0
;;
*)
echo "Invalid response!"
;;
esac
done
return 0
}
# Test case 000
# Check if all the xcat-core packages are on the same version
function test_case_000_version()
{
local ver=""
local -i ret=0
# Call function list_xcat_packages to fill up global array
# GO_XCAT_CORE_PACKAGE_LIST
# And the output will be logged into the debug log.
#
# Missing command `repoquery' may cause list_xcat_packages fail,
# in that case, just skip this test.
list_xcat_packages
while read -r
do
[[ "${REPLY}" = "(not installed)" ]] && continue
@@ -1451,6 +1796,10 @@ function test_case_000_version()
[[ "${ver}" = "${REPLY%%-*}" ]]
(( ret += $? ))
done < <(check_package_version "${GO_XCAT_CORE_PACKAGE_LIST[@]}")
[ "${ret}" -ne "0" ] && echo
warn_if_bad "${ret}" "xCAT packages version mismatch"
return "${ret}"
}
@@ -1460,17 +1809,17 @@ function test_case_001_xcatd()
{
local f=""
local -i ret=0
for f in /var/run/xcat/{main,install,udp}service.pid
for f in /var/run/xcat{d,/{main,udp,install,cmdlog}service}.pid
do
kill -0 "$(<"${f}")"
(( ret += $? ))
done
for f in /var/run/xcat/cmdlogservice.pid
do
[[ -f "${f}" ]] || continue
kill -0 "$(<"${f}")"
[ -f "${f}" ]
warn_if_bad "$?" "${f}: no such file" || continue
kill -0 "$(<"${f}")" >/dev/null 2>&1
warn_if_bad "$?" "Process with an ID $(<${f}) is not running"
(( ret += $? ))
done
return "${ret}"
}
@@ -1478,36 +1827,24 @@ function test_case_001_xcatd()
# Check if command lsdef can be run
function test_case_002_lsdef()
{
(source /etc/profile.d/xcat.sh && lsdef)
(source /etc/profile.d/xcat.sh && lsdef) >/dev/null 2>&1
warn_if_bad "$?" "Attempt of run \`lsdef' failed"
}
# Perform basic smoke test
function perform_smoke_test()
# Perform basic smoke testing
function smoke_testing()
{
local test_case=""
local -i ret=0
for test_case in $(compgen -A function "test_case_")
do
"${test_case}" >"${TMP_DIR}/${test_case}.stdout" \
2>"${TMP_DIR}/${test_case}.stderr"
ret="$?"
if [[ "${ret}" -ne "0" || -s "${TMP_DIR}/${test_case}.stderr" ]]
then
# Something went wrong
echo "-- 8< -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"
echo "==== ${test_case} failed with exit code ${ret} ===="
echo "-- 8< ${test_case} stdout -- --"
while read -r ; do echo "${REPLY}" ; done \
<"${TMP_DIR}/${test_case}.stdout"
echo "-- 8< ${test_case} stderr -- --"
while read -r ; do echo "${REPLY}" ; done \
<"${TMP_DIR}/${test_case}.stderr"
echo "-- 8< -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"
# skip all the remain test cases
return "${ret}"
fi >&2
debug_trace "${test_case}"
warn_if_bad "$?" "Something went wrong. :'(" || return 1
done
echo "It seems everything went well. :)"
echo
echo "It seems everything went well. :-)"
return 0
}
@@ -1559,6 +1896,27 @@ function stop_progress_meters()
echo -n "...... "
}
# $1 0 (pass) or non-zero (fail).
function boo_boo_if_bad()
{
local -i rc="$1"
# Ignore if no problems
[ "${rc}" -eq "0" ] && return 0
debug_logger <<-EOF
Boo-boo
=======
Something went wrong. :(
Please check log file \`${GO_XCAT_LOG}' for more details.
EOF
exit "${rc}"
}
#
# |\/| _.o._ ._ .__ _ .__.._ _ _ _ _ _ |_ _ .__
# | |(_||| | |_)|(_)(_||(_|| | | (_|(_)(/__> | |(/_|(/_ o
@@ -1597,17 +1955,13 @@ do
"--xcat-dep="*)
GO_XCAT_DEP_URL="${1##--xcat-dep=}"
;;
"--xcat-version")
"-x"|"--xcat-version")
shift
GO_XCAT_VERSION="$1"
;;
"--xcat-version="*)
GO_XCAT_VERSION="${1##--xcat-version=}"
;;
"-x")
shift
GO_XCAT_VERSION="$1"
;;
"-y"|"--yes")
GO_XCAT_YES=("-y")
;;
@@ -1621,16 +1975,26 @@ do
warn_if_bad "$?" "redundancy action -- \`$1'"
exit_if_bad "$?" "Try \`$0 --help' for more information"
GO_XCAT_ACTION="$1"
case "$1 $2" in
"completely uninstall")
shift
GO_XCAT_ACTION="away"
;;
"smoke test")
shift
GO_XCAT_ACTION="smoke test"
;;
esac
;;
esac
shift
done
case "${GO_XCAT_ACTION}" in
"check"|"install"|"update")
"away"|"check"|"install"|"uninstall"|"update")
;;
"smoke-test")
perform_smoke_test
"smoke test")
smoke_testing
exit "$?"
;;
"")
@@ -1641,13 +2005,12 @@ case "${GO_XCAT_ACTION}" in
warn_if_bad 1 "invalid action -- \`${GO_XCAT_ACTION}'"
exit_if_bad 1 "Try \`$0 --help' for more information"
;;
esac
esac # case "${GO_XCAT_ACTION}" in
GO_XCAT_OS="$(check_os)"
GO_XCAT_ARCH="$(check_arch)"
while read -r ; do echo "${REPLY}" ; echo "${REPLY}" >&2
done 2>"${TMP_DIR}/go-xcat.log.000" <<EOF
debug_logger <<EOF
Operating system: ${GO_XCAT_OS}
Architecture: ${GO_XCAT_ARCH}
EOF
@@ -1671,8 +2034,7 @@ esac
GO_XCAT_LINUX_DISTRO="$(check_linux_distro)"
GO_XCAT_LINUX_VERSION="$(check_linux_version)"
while read -r ; do echo "${REPLY}" ; echo "${REPLY}" >&2
done 2>"${TMP_DIR}/go-xcat.log.001" <<EOF
debug_logger <<EOF
Linux Distribution: ${GO_XCAT_LINUX_DISTRO}
Version: ${GO_XCAT_LINUX_VERSION}
EOF
@@ -1685,18 +2047,70 @@ case "${GO_XCAT_LINUX_DISTRO}" in
;;
esac
debug_logger debug <<EOF
Host Name: ${HOSTNAME%%.*}
Bash Version: ${BASH_VERSION}
EOF
printf "%-19s %s\n\n" "${0##*/} Version:" "$(version)" | debug_logger
case "${GO_XCAT_ACTION}" in
"away"|"uninstall")
# Remove xCAT
ask_to_continue "${GO_XCAT_YES[0]}" "xCAT is going to be ${GO_XCAT_ACTION/away/trash}ed."
case "${GO_XCAT_ACTION}" in
"away")
debug_trace uninstall_xcat_completely
debug_logger <<-EOF
xCAT has been completely uninstalled!
EOF
;;
"uninstall")
debug_trace uninstall_xcat -y
boo_boo_if_bad "$?"
debug_logger <<-EOF
xCAT has been uninstalled!
==========================
If you intend to install xCAT again, please follow the guideline on the
xcat.org website.
https://xcat.org/download.html
EOF
;;
esac
exit 0
;;
esac # case "${GO_XCAT_ACTION}" in
echo
echo -n "Reading repositories "
show_progress_meters
ERR_MSG="$({
if add_xcat_core_repo -y "${GO_XCAT_CORE_URL}" "${GO_XCAT_VERSION}"
ERR_MSG="$(
{
echo
if [ "check" == "${GO_XCAT_ACTION}" ]
then
if add_xcat_dep_repo -y "${GO_XCAT_DEP_URL}" "${GO_XCAT_VERSION}"
debug_trace update_repo && exit 0
exit 1
fi
if debug_trace add_xcat_core_repo -y \
"${GO_XCAT_CORE_URL}" "${GO_XCAT_VERSION}"
then
if debug_trace add_xcat_dep_repo -y \
"${GO_XCAT_DEP_URL}" "${GO_XCAT_VERSION}"
then
update_repo && exit 0
remove_repo "xcat-dep"
debug_trace update_repo && exit 0
debug_trace remove_repo "xcat-dep"
fi
remove_repo "xcat-core"
debug_trace remove_repo "xcat-core"
fi
exit 1
} 2>&1)"
@@ -1716,95 +2130,33 @@ case "${GO_XCAT_ACTION}" in
;;
"install"|"update")
GO_XCAT_INSTALLER="${GO_XCAT_ACTION}_xcat"
if [[ "${#GO_XCAT_YES[@]}" -eq "0" ]]
then
echo
echo "xCAT is going to be ${GO_XCAT_ACTION/%e/}ed."
while true; do
read -r -p "Continue? [y/n] "
case "${REPLY}" in
"Y"*|"y"*)
break
;;
"N"*|"n"*)
echo "Good-bye!"
exit 0
;;
*)
echo "Invalid response!"
;;
esac
done
fi
# Use `-y' here. Since the STDOUT is redirect to tee.
ask_to_continue "${GO_XCAT_YES[0]}" "xCAT is going to be ${GO_XCAT_ACTION/%e/}ed."
# Use `-y' here. Since the STDOUT is redirected.
# `yum' does not display the prompt message properly when
# working with tee.
"${GO_XCAT_INSTALLER}" -y \
> >(tee "${TMP_DIR}/${GO_XCAT_INSTALLER}.stdout") \
2> >(tee "${TMP_DIR}/${GO_XCAT_INSTALLER}.stderr" >&2)
# working with redirected I/O.
debug_trace "${GO_XCAT_INSTALLER}" -y
RET="$?"
{
# Creating logs
echo "-- 8< -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"
echo "==== ${GO_XCAT_INSTALLER} exited with exit code ${RET} ===="
echo "-- 8< ${GO_XCAT_INSTALLER} stdout -- --"
while read -r ; do echo "${REPLY}" ; done \
<"${TMP_DIR}/${GO_XCAT_INSTALLER}.stdout"
echo "-- 8< ${GO_XCAT_INSTALLER} stderr -- --"
while read -r ; do echo "${REPLY}" ; done \
<"${TMP_DIR}/${GO_XCAT_INSTALLER}.stderr"
echo "-- 8< -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"
} >"${TMP_DIR}/go-xcat.log.005"
if [[ "${RET}" -eq "0" && ! -s "${TMP_DIR}/${GO_XCAT_INSTALLER}.stderr" ]]
if [[ "${RET}" -eq "0" ]]
then
# xCAT has been installed and so far so good
perform_smoke_test >"${TMP_DIR}/perform_smoke_test.stdout" \
2>"${TMP_DIR}/perform_smoke_test.stderr"
smoke_testing >/dev/null 2>&1
RET="$?"
if [[ "${RET}" -ne "0" || -s "${TMP_DIR}/perform_smoke_test.stderr" ]]
then
# Smoke test failed
echo "-- 8< -- -- -- -- vv -- -- -- vv -- -- -- -- 8< --"
echo "==== perform_smoke_test failed with exit code ${RET} ===="
echo "-- 8< perform_smoke_test stdout -- --"
while read -r ; do echo "${REPLY}" ; done \
<"${TMP_DIR}/perform_smoke_test.stdout"
echo "-- 8< perform_smoke_test stderr -- --"
while read -r ; do echo "${REPLY}" ; done \
<"${TMP_DIR}/perform_smoke_test.stderr"
echo "-- 8< -- -- -- -- ^^ -- -- -- ^^ -- -- -- -- 8< --"
fi
fi >"${TMP_DIR}/go-xcat.log.008"
if [[ "${RET}" -ne "0" ]]
then
GO_XCAT_LOG="/tmp/go-xcat.log"
cat "${TMP_DIR}/go-xcat.log."* >"${GO_XCAT_LOG}" 2>/dev/null
while read -r ; do echo "${REPLY}" ; done >&2 <<-EOF
Boo-boo
=======
Something went wrong. :(
Please check log file \`${GO_XCAT_LOG}' for more details.
EOF
exit "${RET}"
[ "${RET}" -ne "0" ] && echo
warn_if_bad "${RET}" "xCAT smoke testing failed."
fi
boo_boo_if_bad "${RET}"
case "${GO_XCAT_ACTION}" in
"install")
# Only print out this message on install
while read -r ; do echo "${REPLY}" ; done <<-EOF
debug_logger <<-EOF
xCAT has been installed!
========================
If this is the very first time xCAT has been installed, run the following
commands to set environment variables into your PATH:
If this is the very first time xCAT has been installed, run one of the
following commands to set the environment variables.
For sh:
source /etc/profile.d/xcat.sh
@@ -1814,7 +2166,7 @@ case "${GO_XCAT_ACTION}" in
EOF
;;
"update")
while read -r ; do echo "${REPLY}" ; done <<-EOF
debug_logger <<-EOF
xCAT has been successfully updated!
EOF
+3 -3
View File
@@ -58,9 +58,9 @@ lsxcatd_a
lsxcatd_d
lsxcatd_h
lsxcatd_null
makeconservercf_d
makeconservercf_noderange
makeconservercf_null
#makeconservercf_d
#makeconservercf_noderange
#makeconservercf_null
#makedhcp_a_d_linux
#makedhcp_a_linux
#makedhcp_d_linux
@@ -269,8 +269,6 @@ makentp_v
makentp_h
nodeset_check_warninginfo
runcmdinstaller_h
runcmdinstaller_command
get_xcat_postscripts_loginfo
updatenode_postscripts_loginfo
xcatd_start
xcatd_stop
@@ -311,10 +309,6 @@ rmimage_diskless
updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
confignetwork_vlan_false
@@ -322,6 +316,12 @@ confignetwork__bridge_false
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
runcmdinstaller_command
get_xcat_postscripts_loginfo
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -272,8 +272,6 @@ makentp_v
makentp_h
nodeset_check_warninginfo
runcmdinstaller_h
runcmdinstaller_command
get_xcat_postscripts_loginfo
updatenode_postscripts_loginfo
bmcdiscover_h
bmcdiscover_nmap_range
@@ -312,12 +310,14 @@ updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
reg_linux_diskless_installation_flat
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
runcmdinstaller_command
get_xcat_postscripts_loginfo
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -234,10 +234,6 @@ updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
confignetwork_vlan_false
@@ -245,6 +241,10 @@ confignetwork__bridge_false
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -315,8 +315,6 @@ makentp_v
makentp_h
nodeset_check_warninginfo
runcmdinstaller_h
runcmdinstaller_command
get_xcat_postscripts_loginfo
updatenode_postscripts_loginfo
bmcdiscover_h
bmcdiscover_nmap_range
@@ -356,12 +354,14 @@ updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
reg_linux_diskless_installation_flat
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
runcmdinstaller_command
get_xcat_postscripts_loginfo
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -357,10 +357,6 @@ rmimage_diskless
updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
confignetwork_vlan_false
@@ -368,6 +364,12 @@ confignetwork__bridge_false
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
runcmdinstaller_command
get_xcat_postscripts_loginfo
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -38,10 +38,6 @@ packimage_o_p_a_m
packimage_imagename
packimage_h
packimage_v
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
pping_h
@@ -298,6 +294,10 @@ confignetwork__bridge_false
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
reg_linux_diskless_installation_flat
reg_linux_statelite_installation_flat
SN_setup_case
@@ -279,12 +279,12 @@ updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
reg_linux_diskless_installation_flat
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -237,15 +237,15 @@ updatenode_diskful_syncfiles_failing
xdcp_nonroot_user
xdsh_permission_denied
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -34,12 +34,6 @@ packimage_o_p_a_m
packimage_imagename
packimage_h
packimage_v
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
pping_h
@@ -254,6 +248,12 @@ xdsh_permission_denied
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
sles_migration1
sles_migration2
reg_linux_statelite_installation_flat
@@ -253,14 +253,14 @@ nodeset_runimg
sles_migration1
sles_migration2
reg_linux_diskless_installation_flat
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy
@@ -25,12 +25,6 @@ packimage_o_p_a_m
packimage_imagename
packimage_h
packimage_v
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
pping_h
@@ -242,6 +236,12 @@ xdsh_permission_denied
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
ubuntu_migration1_p8le
ubuntu_migration2_p8le
@@ -21,12 +21,6 @@ packimage_o_p_a_m
packimage_imagename
packimage_h
packimage_v
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
packimage_m_invalid_archive_method
packimage_m_invalid_compress_method
pping_h
@@ -239,5 +233,11 @@ xdsh_permission_denied
nodeset_shell
nodeset_cmdline
nodeset_runimg
packimage_m_cpio_c_gzip
packimage_m_cpio_c_pigz
packimage_m_cpio_c_xz
packimage_m_tar_c_pigz
packimage_m_tar_c_gzip
packimage_m_tar_c_xz
ubuntu_migration1_vm
ubuntu_migration2_vm
+2
View File
@@ -1,5 +1,6 @@
#only support redhat and postgresql
start:setup_2_new_HA_MN
label:others,HA
os:Linux
#back up
cmd:lsdef -z $$PRIMARYMN > /tmp/node.stanza
@@ -149,6 +150,7 @@ cmd:if [[ -f /install/postscripts/check_node_state.bak ]] ;then mv -f /install/p
end
start:configure_exist_xCAT_MN_to_HA_MN
label:others,HA
os:Linux
#back up
cmd:lsdef -z $$PRIMARYMN > /tmp/node.stanza
@@ -85,6 +85,6 @@ os:Linux
hcp:openbmc
label:cn_bmc_ready,hctrl_openbmc
cmd: rflash $$CN -l | grep \* | grep BMC | awk '{print $2}' | xargs -i{} rflash $$CN --delete {}
check:rc==1
check:rc!=0
check:output=~$$CN: (\[.*?\]: )?Error: Deleting currently active BMC firmware is not supported
end

Some files were not shown because too many files have changed in this diff Show More