xcat2 / xcat-extensions

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

Do not change the host name of the node when active a management node with xcatha.py #24

Open neo954 opened 6 years ago

neo954 commented 6 years ago

This bug is against xcatha.py commit 6e4c13e9227f86372b5333947f58e3dbe6281213.

When activate the management node with xcatha.py, the script change the host name of the node to the virtual host name. This behavior is improper. Since the system administrator may need to the actual host name of the node. This is very important.

# hostname
c910f03c01p07
# xcatha.py -a -p /media/u/gongjie/ha-test -i eth0:99 -v 10.3.1.99 -m 255.0.0.0
2018-06-13 02:33:28,617 - INFO - Activating this node as xCAT primary MN
2018-06-13 02:33:28,617 - INFO - ########## Activate stage ##########
2018-06-13 02:33:28,618 - INFO - ===> Check virtual ip stage <===
2018-06-13 02:33:28,618 - DEBUG - 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-13 02:33:31,618 - INFO - virtual ip can be used.
2018-06-13 02:33:31,618 - INFO - ===> Configure virtual ip as alias ip stage <===
2018-06-13 02:33:31,620 - DEBUG - ifconfig eth0:99 10.3.1.99  netmask 255.0.0.0 [Passed]
2018-06-13 02:33:31,632 - INFO - ===> Configure hostname stage <===
2018-06-13 02:33:31,634 - DEBUG - hostname c910f03c01p99 [Passed]
2018-06-13 02:33:31,634 - INFO - Check if xCAT data is in shared data directory
2018-06-13 02:33:31,634 - DEBUG - There is xCAT data /media/u/gongjie/ha-test/install in shared data /media/u/gongjie/ha-test
2018-06-13 02:33:31,634 - INFO - ===> Configure shared data directory stage <===
2018-06-13 02:33:31,783 - DEBUG - systemctl stop goconserver [Passed]
2018-06-13 02:33:31,799 - DEBUG - systemctl stop conserver [Passed]
2018-06-13 02:33:31,864 - DEBUG - systemctl stop ntpd [Passed]
2018-06-13 02:33:31,964 - DEBUG - systemctl stop dhcpd [Passed]
2018-06-13 02:33:31,981 - DEBUG - systemctl stop named [Passed]
2018-06-13 02:33:32,289 - DEBUG - systemctl stop xcatd [Passed]
Failed to stop mariadb.service: Unit mariadb.service not loaded.
2018-06-13 02:33:35,303 - DEBUG - Retry 1 ... ...systemctl stop mariadb
Failed to stop mariadb.service: Unit mariadb.service not loaded.
2018-06-13 02:33:38,318 - DEBUG - Retry 2 ... ...systemctl stop mariadb
Failed to stop mariadb.service: Unit mariadb.service not loaded.
2018-06-13 02:33:38,330 - ERROR - systemctl stop mariadb [Failed]
Failed to stop postgresql.service: Unit postgresql.service not loaded.
2018-06-13 02:33:41,344 - DEBUG - Retry 1 ... ...systemctl stop postgresql
Failed to stop postgresql.service: Unit postgresql.service not loaded.
2018-06-13 02:33:44,358 - DEBUG - Retry 2 ... ...systemctl stop postgresql
Failed to stop postgresql.service: Unit postgresql.service not loaded.
2018-06-13 02:33:44,370 - ERROR - systemctl stop postgresql [Failed]
2018-06-13 02:33:44,371 - INFO - Creating symlink .../install
2018-06-13 02:33:44,371 - INFO - Creating symlink .../etc/xcat
2018-06-13 02:33:44,371 - INFO - Creating symlink .../root/.xcat
2018-06-13 02:33:44,371 - INFO - Creating symlink .../var/lib/pgsql
2018-06-13 02:33:44,371 - INFO - Creating symlink .../var/lib/mysql
2018-06-13 02:33:44,371 - INFO - Creating symlink .../tftpboot
2018-06-13 02:33:44,388 - INFO - ===> Start all services stage <===
2018-06-13 02:33:47,245 - DEBUG - systemctl start xcatd [Passed]
    domain=pok.stglabs.ibm.com
2018-06-13 02:33:47,610 - DEBUG - lsdef -t site -i domain|grep domain [Passed]
2018-06-13 02:33:47,611 - WARNING - Long hostname is not in "/etc/hosts". "named" service will not be started
Renamed existing dhcp configuration file to  /etc/dhcp/dhcpd.conf.xcatbak

Warning: No dynamic range specified for 10.0.0.0. If hardware discovery is being used, a dynamic range is required.
2018-06-13 02:33:48,105 - DEBUG - makedhcp -n [Passed]
2018-06-13 02:33:48,301 - DEBUG - makedhcp -a [Passed]
2018-06-13 02:33:48,344 - DEBUG - systemctl start ntpd [Passed]
2018-06-13 02:33:48,344 - INFO - This machine is set to primary management node successfully...
# hostname
c910f03c01p99
neo954 commented 6 years ago

Refer to xcat2/xcat2-task-management#163

bybai commented 6 years ago

It is partial done in https://github.com/xcat2/xcat-extensions/pull/27, interactive activate and deactivate.