xcat2 / xcat-extensions

Repos to store scripts for special user cases
4 stars 8 forks source link

xcatha.py will failed when empty shared data directory was provided #13

Closed neo954 closed 6 years ago

neo954 commented 6 years ago

This bug is against xcatha.py commit 3c0251fe0763f597f098bd16a4d4542c3fe8b9c8.

With a empty shared data directory, the set up procedure will fail. With the error message Error: Configure shared data directory stage.

# ./xcatha.py -s -p /media/u/gongjie/ha-test -i eth0:99 -v 10.3.1.99 -n c910f03c01p99 -m 255.0.0.0 -t sqlite
============================================================================================
2018-06-07 02:35:13,768 - INFO - Check virtual ip stage
2018-06-07 02:35:13,768 - INFO - ping -c 1 -w 10 10.3.1.99
PING 10.3.1.99 (10.3.1.99) 56(84) bytes of data.
From 10.3.1.7 icmp_seq=1 Destination Host Unreachable
From 10.3.1.7 icmp_seq=2 Destination Host Unreachable
From 10.3.1.7 icmp_seq=3 Destination Host Unreachable

--- 10.3.1.99 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2007ms
pipe 3
2018-06-07 02:35:16,768 - INFO - virtual ip can be used.
============================================================================================
2018-06-07 02:35:16,768 - INFO - Check if xCAT data is in shared data directory
2018-06-07 02:35:16,769 - ERROR - There is no xCAT data /media/u/gongjie/ha-test/install in shared data /media/u/gongjie/ha-test
============================================================================================
2018-06-07 02:35:16,769 - INFO - Configure virtual ip as alias ip stage
2018-06-07 02:35:16,771 - INFO - ifconfig eth0:99 10.3.1.99  netmask 255.0.0.0 [Passed]
============================================================================================
2018-06-07 02:35:16,772 - INFO - Save physical hostname and ip
============================================================================================
2018-06-07 02:35:16,772 - INFO - Configure hostname stage for host c910f03c01p99
2018-06-07 02:35:16,774 - INFO - hostname c910f03c01p99 [Passed]
============================================================================================
2018-06-07 02:35:16,774 - INFO - Check xcatd service status
Unit xcatd.service could not be found.
============================================================================================
2018-06-07 02:35:16,778 - INFO - Install xCAT stage
--2018-06-07 02:35:16--  https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.20.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.20.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 46541 (45K) [text/plain]
Saving to: ‘STDOUT’

100%[==================================================================================>] 46,541      --.-K/s   in 0.007s

2018-06-07 02:35:16 (6.76 MB/s) - written to stdout [46541/46541]

2018-06-07 02:35:16,900 - INFO - wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat [Passed]
2018-06-07 02:35:16,902 - INFO - chmod +x /tmp/go-xcat [Passed]
Operating system:   linux
Architecture:       ppc64le
Linux Distribution: rhel
Version:            7.5

Reading repositories ...... done
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package xnba-undi-1.0.3-131028.noarch already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package conserver-xcat.ppc64le 0:8.2.1-1 will be installed
---> Package elilo-xcat.noarch 0:3.14-4 will be installed
---> Package grub2-xcat.noarch 0:2.02-0.16.el7.snap201506090204 will be installed
---> Package ipmitool-xcat.ppc64le 0:1.8.18-0 will be installed
---> Package perl-xCAT.noarch 4:2.14.1-snap201806010300 will be installed
---> Package syslinux-xcat.noarch 0:3.86-2 will be installed
---> Package xCAT.ppc64le 0:2.14.1-snap201806010300 will be installed
--> Processing Dependency: xCAT-probe = 4:2.14.1-snap201806010300 for package: xCAT-2.14.1-snap201806010300.ppc64le
---> Package xCAT-buildkit.noarch 4:2.14.1-snap201806010300 will be installed
---> Package xCAT-client.noarch 4:2.14.1-snap201806010300 will be installed
---> Package xCAT-genesis-base-ppc64.noarch 2:2.14-snap201804041553 will be installed
---> Package xCAT-genesis-base-x86_64.noarch 2:2.14-snap201803282249 will be installed
---> Package xCAT-genesis-scripts-ppc64.noarch 1:2.14.1-snap201806010300 will be installed
---> Package xCAT-genesis-scripts-x86_64.noarch 1:2.14.1-snap201806010300 will be installed
---> Package xCAT-server.noarch 4:2.14.1-snap201806010300 will be installed
---> Package yaboot-xcat.noarch 0:1.3.17-rc1 will be installed
--> Running transaction check
---> Package xCAT-probe.noarch 4:2.14.1-snap201806010300 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                     Arch    Version                    Repository
                                                                           Size
================================================================================
Installing:
 conserver-xcat              ppc64le 8.2.1-1                    xcat-dep  184 k
 elilo-xcat                  noarch  3.14-4                     xcat-dep   75 k
 grub2-xcat                  noarch  2.02-0.16.el7.snap201506090204
                                                                xcat-dep  1.9 M
 ipmitool-xcat               ppc64le 1.8.18-0                   xcat-dep  294 k
 perl-xCAT                   noarch  4:2.14.1-snap201806010300  xcat-core 664 k
 syslinux-xcat               noarch  3.86-2                     xcat-dep  498 k
 xCAT                        ppc64le 2.14.1-snap201806010300    xcat-core 241 k
 xCAT-buildkit               noarch  4:2.14.1-snap201806010300  xcat-core  67 k
 xCAT-client                 noarch  4:2.14.1-snap201806010300  xcat-core 520 k
 xCAT-genesis-base-ppc64     noarch  2:2.14-snap201804041553    xcat-dep   91 M
 xCAT-genesis-base-x86_64    noarch  2:2.14-snap201803282249    xcat-dep   87 M
 xCAT-genesis-scripts-ppc64  noarch  1:2.14.1-snap201806010300  xcat-core  59 k
 xCAT-genesis-scripts-x86_64 noarch  1:2.14.1-snap201806010300  xcat-core  59 k
 xCAT-server                 noarch  4:2.14.1-snap201806010300  xcat-core 1.8 M
 yaboot-xcat                 noarch  1.3.17-rc1                 xcat-dep   97 k
Installing for dependencies:
 xCAT-probe                  noarch  4:2.14.1-snap201806010300  xcat-core  89 k

Transaction Summary
================================================================================
Install  15 Packages (+1 Dependent package)

Total download size: 184 M
Installed size: 652 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                               88 MB/s | 184 MB  00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : syslinux-xcat-3.86-2.noarch                                 1/16
  Installing : grub2-xcat-2.02-0.16.el7.snap201506090204.noarch            2/16
  Installing : 4:xCAT-server-2.14.1-snap201806010300.noarch                3/16
  Installing : 4:perl-xCAT-2.14.1-snap201806010300.noarch                  4/16
  Installing : 4:xCAT-client-2.14.1-snap201806010300.noarch                5/16
  Installing : 4:xCAT-probe-2.14.1-snap201806010300.noarch                 6/16
  Installing : conserver-xcat-8.2.1-1.ppc64le                              7/16
  Installing : elilo-xcat-3.14-4.noarch                                    8/16
  Installing : 2:xCAT-genesis-base-x86_64-2.14-snap201803282249.noarch     9/16
  Installing : 1:xCAT-genesis-scripts-x86_64-2.14.1-snap201806010300.no   10/16
If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch>' manually
  Installing : ipmitool-xcat-1.8.18-0.ppc64le                             11/16
  Installing : 2:xCAT-genesis-base-ppc64-2.14-snap201804041553.noarch     12/16
  Installing : 1:xCAT-genesis-scripts-ppc64-2.14.1-snap201806010300.noa   13/16
If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch>' manually
  Installing : 4:xCAT-buildkit-2.14.1-snap201806010300.noarch             14/16
  Installing : xCAT-2.14.1-snap201806010300.ppc64le                       15/16
Generating new node hostkeys...
Generating SSH2 RSA Key...
Generating SSH2 DSA Key...
Generating SSH2 ECDSA Key...
Copied /root/.ssh/id_rsa.pub to /install/postscripts/_ssh/authorized_keys.

Setting up basic certificates.  Respond with a 'y' when prompted.

# NOTE use "-newkey rsa:2048" if running OpenSSL 0.9.8a or higher
Generating RSA private key, 2048 bit long modulus
......................+++
.+++
e is 65537 (0x10001)
Using configuration from openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Jan  1 01:01:01 1970 GMT
            Not After : Jun  7 06:36:33 2038 GMT
        Subject:
            commonName                = xCAT CA
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                90:70:5A:C0:4A:8D:EB:8F:71:D7:5F:78:27:31:22:97:BA:B0:1C:62
            X509v3 Authority Key Identifier:
                keyid:90:70:5A:C0:4A:8D:EB:8F:71:D7:5F:78:27:31:22:97:BA:B0:1C:62
                DirName:/CN=xCAT CA
                serial:01

            X509v3 Basic Constraints:
                CA:TRUE
            X509v3 Key Usage:
                Certificate Sign, CRL Sign
            Netscape Cert Type:
                SSL CA, S/MIME CA
Certificate is to be certified until Jun  7 06:36:33 2038 GMT (7305 days)
Sign the certificate? [y/n]:

1 out of 1 certificate requests certified, commit? [y/n]Write out database with 1 new entries
Data Base Updated
/
Created xCAT certificate.
Generating RSA private key, 2048 bit long modulus
.......................+++
.................................+++
e is 65537 (0x10001)
/
Using configuration from openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 2 (0x2)
        Validity
            Not Before: Jan  1 01:01:01 1960 GMT
            Not After : Jun  2 06:36:33 2038 GMT
        Subject:
            commonName                = c910f03c01p99
        X509v3 extensions:
            X509v3 Subject Alternative Name:
                DNS:c910f03c01p99, DNS:c910f03c01p99
Certificate is to be certified until Jun  2 06:36:33 2038 GMT (7300 days)
Sign the certificate? [y/n]:

1 out of 1 certificate requests certified, commit? [y/n]Write out database with 1 new entries
Data Base Updated
/
Generating RSA private key, 2048 bit long modulus
.............+++
........+++
e is 65537 (0x10001)
Using configuration from openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 3 (0x3)
        Validity
            Not Before: Jan  1 01:01:01 1960 GMT
            Not After : Jun  2 06:36:33 2038 GMT
        Subject:
            commonName                = root
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Key Usage:
                Digital Signature, Key Encipherment, Key Agreement
            X509v3 Extended Key Usage:
                TLS Web Client Authentication
            Netscape Cert Type:
                SSL Client, S/MIME, Object Signing
            Netscape Comment:
                OpenSSL Generated Client Certificate
            X509v3 Subject Key Identifier:
                BA:1F:7D:50:60:AD:03:3B:9E:25:09:34:2A:B4:D7:58:8C:A6:8C:5C
            X509v3 Authority Key Identifier:
                keyid:90:70:5A:C0:4A:8D:EB:8F:71:D7:5F:78:27:31:22:97:BA:B0:1C:62

Certificate is to be certified until Jun  2 06:36:33 2038 GMT (7300 days)
Sign the certificate? [y/n]:

1 out of 1 certificate requests certified, commit? [y/n]Write out database with 1 new entries
Data Base Updated
Created xCAT certificate.
Restarting xcatd (via systemctl):  [  OK  ]
dns server has been enabled on boot.
httpd has been restarted.
xCAT is now running, it is recommended to tabedit networks
and set a dynamic ip address range on any networks where nodes
are to be discovered. Then, run makedhcp -n to create a new dhcpd
configuration file, and /etc/init.d/dhcpd restart. Either examine sample
configuration templates, or write your own, or specify a value per
node with nodeadd or tabedit.
Running '/opt/xcat/sbin/mknb', triggered by the installation/update of xCAT-genesis-scripts ...
Creating genesis.fs.ppc64.gz in /tftpboot/xcat
The 'mknb ppc64' command completed successfully.
Creating genesis.fs.x86_64.gz in /tftpboot/xcat
The 'mknb x86_64' command completed successfully.
  Installing : yaboot-xcat-1.3.17-rc1.noarch                              16/16
  Verifying  : 4:xCAT-buildkit-2.14.1-snap201806010300.noarch              1/16
  Verifying  : 4:perl-xCAT-2.14.1-snap201806010300.noarch                  2/16
  Verifying  : 4:xCAT-probe-2.14.1-snap201806010300.noarch                 3/16
  Verifying  : 4:xCAT-server-2.14.1-snap201806010300.noarch                4/16
  Verifying  : xCAT-2.14.1-snap201806010300.ppc64le                        5/16
  Verifying  : 2:xCAT-genesis-base-ppc64-2.14-snap201804041553.noarch      6/16
  Verifying  : yaboot-xcat-1.3.17-rc1.noarch                               7/16
  Verifying  : ipmitool-xcat-1.8.18-0.ppc64le                              8/16
  Verifying  : 2:xCAT-genesis-base-x86_64-2.14-snap201803282249.noarch     9/16
  Verifying  : 4:xCAT-client-2.14.1-snap201806010300.noarch               10/16
  Verifying  : elilo-xcat-3.14-4.noarch                                   11/16
  Verifying  : conserver-xcat-8.2.1-1.ppc64le                             12/16
  Verifying  : 1:xCAT-genesis-scripts-ppc64-2.14.1-snap201806010300.noa   13/16
  Verifying  : grub2-xcat-2.02-0.16.el7.snap201506090204.noarch           14/16
  Verifying  : 1:xCAT-genesis-scripts-x86_64-2.14.1-snap201806010300.no   15/16
  Verifying  : syslinux-xcat-3.86-2.noarch                                16/16

Installed:
  conserver-xcat.ppc64le 0:8.2.1-1
  elilo-xcat.noarch 0:3.14-4
  grub2-xcat.noarch 0:2.02-0.16.el7.snap201506090204
  ipmitool-xcat.ppc64le 0:1.8.18-0
  perl-xCAT.noarch 4:2.14.1-snap201806010300
  syslinux-xcat.noarch 0:3.86-2
  xCAT.ppc64le 0:2.14.1-snap201806010300
  xCAT-buildkit.noarch 4:2.14.1-snap201806010300
  xCAT-client.noarch 4:2.14.1-snap201806010300
  xCAT-genesis-base-ppc64.noarch 2:2.14-snap201804041553
  xCAT-genesis-base-x86_64.noarch 2:2.14-snap201803282249
  xCAT-genesis-scripts-ppc64.noarch 1:2.14.1-snap201806010300
  xCAT-genesis-scripts-x86_64.noarch 1:2.14.1-snap201806010300
  xCAT-server.noarch 4:2.14.1-snap201806010300
  yaboot-xcat.noarch 0:1.3.17-rc1

Dependency Installed:
  xCAT-probe.noarch 4:2.14.1-snap201806010300

Complete!

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:

For sh:
    source /etc/profile.d/xcat.sh

For csh:
    source /etc/profile.d/xcat.csh
2018-06-07 02:39:05,784 - INFO - /tmp/go-xcat --yes install [Passed]
xCAT is installed [Passed]
Version 2.14.1 (git commit 70d6e7f93cc9714a127c22df2e7ca53d4996a34c, built Fri Jun  1 03:00:53 EDT 2018)
2018-06-07 02:39:05,965 - INFO - lsxcatd -v [Passed]
============================================================================================
2018-06-07 02:39:05,965 - INFO - Check database type stage
2018-06-07 02:39:05,994 - INFO - ifconfig|grep "inet 10.3.1.7  netmask" > /dev/null [Passed]
============================================================================================
2018-06-07 02:39:06,002 - INFO - Check if xCAT data is in shared data directory
2018-06-07 02:39:06,003 - ERROR - There is no xCAT data /media/u/gongjie/ha-test/install in shared data /media/u/gongjie/ha-test
============================================================================================
2018-06-07 02:39:06,004 - INFO - Installing database package ...
============================================================================================
2018-06-07 02:39:06,015 - INFO - Configure shared data directory stage
2018-06-07 02:39:06,015 - INFO - Copy /install to /media/u/gongjie/ha-test/install
2018-06-07 02:39:06,562 - INFO - chown -R root:root /media/u/gongjie/ha-test/install [Passed]
2018-06-07 02:39:06,562 - INFO - Copy /etc/xcat to /media/u/gongjie/ha-test/etc/xcat
2018-06-07 02:39:06,915 - INFO - chown -R root:root /media/u/gongjie/ha-test/etc/xcat [Passed]
2018-06-07 02:39:06,915 - INFO - Copy /root/.xcat to /media/u/gongjie/ha-test/root/.xcat
2018-06-07 02:39:06,936 - INFO - chown -R root:root /media/u/gongjie/ha-test/root/.xcat [Passed]
2018-06-07 02:39:06,936 - INFO - Copy /var/lib/pgsql to /media/u/gongjie/ha-test/var/lib/pgsql
2018-06-07 02:39:06,936 - ERROR - Error: Configure shared data directory stage
2018-06-07 02:39:06,936 - ERROR - Error encountered, starting to clean up the environment
2018-06-07 02:39:06,941 - INFO - ifconfig|grep "inet 10.3.1.7  netmask" > /dev/null [Passed]
2018-06-07 02:39:06,949 - INFO - ifconfig|grep "inet 10.3.1.7  netmask" > /dev/null [Passed]
============================================================================================
2018-06-07 02:39:06,952 - INFO - Configure hostname stage for host c910f03c01p07
2018-06-07 02:39:06,954 - INFO - hostname c910f03c01p07 [Passed]
============================================================================================
2018-06-07 02:39:06,954 - INFO - Unconfigure shared data directory stage
============================================================================================
2018-06-07 02:39:06,954 - INFO - Remove virtual IP stage
2018-06-07 02:39:06,956 - INFO - ifconfig eth0:99 0.0.0.0 0.0.0.0 &>/dev/null [Failed, OK to ignore]
2018-06-07 02:39:06,959 - INFO - ip addr show |grep 10.3.1.99 &>/dev/null [Failed, OK to ignore]
2018-06-07 02:39:06,959 - INFO - Remove virtual IP [Passed]
neo954 commented 6 years ago

Refer to xcat2/xcat2-task-management#163