xcat2 / xcat-extensions

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

Enhancements for interactive HA deactivate #30

Closed gurevichmark closed 6 years ago

gurevichmark commented 6 years ago

Make interactive_deactivate() its own function. Externalize common questions.

bybai commented 6 years ago

I did the UT: deactivate:

[root@bymn HA]# python xcatha.py -d
2018-06-15 02:24:23,386 - INFO - [xCAT] Shutting down services:
... goconserver
... conserver
... ntpd
... dhcpd
... named
... xcatd
... postgresql
Continue? [[Y]es/[N]o/[D]ryrun]:
Y
2018-06-15 02:24:34,523 - DEBUG - systemctl stop goconserver [Passed]
2018-06-15 02:24:34,535 - DEBUG - systemctl stop conserver [Passed]
2018-06-15 02:24:34,548 - DEBUG - systemctl stop ntpd [Passed]
2018-06-15 02:24:34,562 - DEBUG - systemctl stop dhcpd [Passed]
2018-06-15 02:24:34,575 - DEBUG - systemctl stop named [Passed]
2018-06-15 02:24:35,140 - DEBUG - systemctl stop xcatd [Passed]
2018-06-15 02:24:36,169 - DEBUG - systemctl stop postgresql [Passed]
[xCAT] Disabling services from starting on reboot:
... goconserver
... conserver
... ntpd
... dhcpd
... named
... xcatd
... postgresql
Continue? [[Y]es/[N]o/[D]ryrun]:
Y
2018-06-15 02:24:44,075 - DEBUG - systemctl disable goconserver [Passed]
conserver.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig conserver off
2018-06-15 02:24:44,136 - DEBUG - systemctl disable conserver [Passed]
2018-06-15 02:24:44,190 - DEBUG - systemctl disable ntpd [Passed]
2018-06-15 02:24:44,241 - DEBUG - systemctl disable dhcpd [Passed]
2018-06-15 02:24:44,295 - DEBUG - systemctl disable named [Passed]
xcatd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig xcatd off
2018-06-15 02:24:44,353 - DEBUG - systemctl disable xcatd [Passed]
2018-06-15 02:24:44,408 - DEBUG - systemctl disable postgresql [Passed]
2018-06-15 02:24:44,409 - INFO - This machine is set to standby management node successfully...

activate:

[root@bymn HA]# ./xcatha.py -a
[Admin] Enter DB type [postgresql/mariadb/sqlite]:
postgresql
[Admin] Verify VIP 10.5.106.70 is configured on this node
Continue? [[Y]es/[N]o]:
Y
[Admin] Verify that the following is configured to be saved in shared storage and accessible from this node:
... /install
... /etc/xcat
... /root/.xcat
... /var/lib/pgsql
... /tftpboot
Continue? [[Y]es/[N]o]:
Y
[xCAT] Starting up services:
... postgresql
... xcatd
... named
... dhcpd
... ntpd
... conserver
... goconserver
Continue? [[Y]es/[N]o/[D]ryrun]:
Y
2018-06-15 02:25:54,931 - INFO - ===> Start all services stage <===
2018-06-15 02:25:56,053 - DEBUG - systemctl start postgresql [Passed]
2018-06-15 02:25:58,830 - DEBUG - systemctl start xcatd [Passed]
    domain=cluster.com
2018-06-15 02:25:59,209 - DEBUG - lsdef -t site -i domain|grep domain [Passed]
2018-06-15 02:25:59,209 - 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-15 02:25:59,631 - DEBUG - makedhcp -n [Passed]
2018-06-15 02:25:59,879 - DEBUG - makedhcp -a [Passed]
2018-06-15 02:25:59,943 - DEBUG - systemctl start ntpd [Passed]
bybai commented 6 years ago

I am ok to merge it. Thanks @gurevichmark