xcat2 / xcat-extensions

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

Dryrun enhancements part 3 #16

Closed gurevichmark closed 6 years ago

gurevichmark commented 6 years ago

https://github.com/xcat2/xcat2-task-management/issues/172 More dryrun enhancements to deal when xCAT is not installed on the node:

[root@bybc0607 gurevich]# python ./xcatha.py -s -p /HA -v 10.5.106.50 -i eth0:0 -n hamn.clusters.com -m 255.0.0.0 -t postgresql --dryrun
2018-06-07 16:06:35,411 - INFO - Setup this node as xCAT HA standby MN
============================================================================================
2018-06-07 16:06:35,412 - INFO - Check virtual ip stage
2018-06-07 16:06:35,412 - INFO - ping -c 1 -w 10 10.5.106.50 [Dryrun]
2018-06-07 16:06:35,412 - INFO - Check if xCAT data is in shared data directory
2018-06-07 16:06:35,413 - INFO - There is xCAT data /HA/install in shared data /HA
============================================================================================
2018-06-07 16:06:35,413 - INFO - Check if target dbtype is the same with shared data dbtype stage
2018-06-07 16:06:35,414 - INFO - Database type is 'postgresql' in shared data directory
2018-06-07 16:06:35,414 - INFO - Target database type is matched [Dryrun]
============================================================================================
2018-06-07 16:06:35,414 - INFO - Configure virtual ip as alias ip stage
2018-06-07 16:06:35,414 - INFO - ifconfig eth0:0 10.5.106.50  netmask 255.0.0.0 [Dryrun]
2018-06-07 16:06:35,414 - INFO - Save physical hostname and ip
============================================================================================
2018-06-07 16:06:35,415 - INFO - Configure hostname stage
2018-06-07 16:06:35,415 - INFO - hostname hamn.clusters.com [Dryrun]
2018-06-07 16:06:35,415 - INFO - Check xcatd service status
============================================================================================
2018-06-07 16:06:35,415 - INFO - MG Check database type stage
2018-06-07 16:06:35,415 - INFO - Current xCAT database type: sqlite
2018-06-07 16:06:35,415 - INFO - Target xCAT database type: postgresql
2018-06-07 16:06:35,425 - INFO - Check if xCAT data is in shared data directory
2018-06-07 16:06:35,425 - INFO - There is xCAT data /HA/install in shared data /HA
MG 1 after self.check_xcat_exist_in_shared_data in check_database_type()
============================================================================================
2018-06-07 16:06:35,425 - INFO - Install database package stage
2018-06-07 16:06:35,428 - INFO - Checking if postgresql is installed ...
2018-06-07 16:06:35,751 - INFO - postgresql already installed
MG after self.install_db_package in check_database_type()
2018-06-07 16:06:35,753 - INFO - Added line "host    all          all        10.5.106.7/32      md5" to postgresql configuration file /HA/var/lib/pgsql/data/pg_hba.conf [Dryrun]
2018-06-07 16:06:35,753 - INFO - Added line "host    all          all        10.5.106.50/32      md5" to postgresql configuration file /HA/var/lib/pgsql/data/pg_hba.conf [Dryrun]
MG Checking for existance of /HA/var/lib/pgsql/data/postgresql.conf
localhost,10.5.106.50,10.5.106.7
localhost,10.5.106.50,10.5.106.7
MG after self.modify_db_configure_file in check_database_type()
============================================================================================
2018-06-07 16:06:35,762 - INFO - Configure shared data directory stage
2018-06-07 16:06:35,774 - INFO - systemctl stop goconserver [Dryrun]
2018-06-07 16:06:35,774 - INFO - systemctl stop conserver [Dryrun]
2018-06-07 16:06:35,774 - INFO - systemctl stop ntpd [Dryrun]
2018-06-07 16:06:35,774 - INFO - systemctl stop dhcpd [Dryrun]
2018-06-07 16:06:35,774 - INFO - systemctl stop named [Dryrun]
2018-06-07 16:06:35,774 - INFO - systemctl stop xcatd [Dryrun]
2018-06-07 16:06:35,774 - INFO - systemctl stop postgresql [Dryrun]
2018-06-07 16:06:35,774 - INFO - Creating symlink .../install [Dryrun]
2018-06-07 16:06:35,774 - INFO - Creating symlink .../etc/xcat [Dryrun]
2018-06-07 16:06:35,774 - INFO - Creating symlink .../root/.xcat [Dryrun]
2018-06-07 16:06:35,775 - INFO - Creating symlink .../var/lib/pgsql [Dryrun]
2018-06-07 16:06:35,775 - INFO - Creating symlink .../tftpboot [Dryrun]
2018-06-07 16:06:35,775 - INFO - cat /tmp/ha_mn >> /etc/xcat/ha_mn [Dryrun]
2018-06-07 16:06:35,775 - INFO - systemctl restart postgresql [Dryrun]
2018-06-07 16:06:35,775 - INFO - Check xcatd service status
2018-06-07 16:06:35,775 - INFO - xCAT service has started [Dryrun]
============================================================================================
2018-06-07 16:06:35,775 - INFO - Configure xCAT policy table stage
2018-06-07 16:06:35,775 - INFO - lsdef -t policy -i name [Dryrun]
############################################################################################
2018-06-07 16:06:35,775 - INFO - Deactivate stage
============================================================================================
2018-06-07 16:06:35,793 - INFO - Configure hostname stage
2018-06-07 16:06:35,793 - INFO - hostname bybc0607 [Dryrun]
============================================================================================
2018-06-07 16:06:35,793 - INFO - Unconfigure shared data directory stage
2018-06-07 16:06:35,793 - INFO - Removing symlink .../install [Dryrun]
2018-06-07 16:06:35,793 - INFO - Removing symlink .../etc/xcat [Dryrun]
2018-06-07 16:06:35,793 - INFO - Removing symlink .../root/.xcat [Dryrun]
2018-06-07 16:06:35,793 - INFO - Removing symlink .../var/lib/pgsql [Dryrun]
2018-06-07 16:06:35,794 - INFO - Removing symlink .../tftpboot [Dryrun]
============================================================================================
2018-06-07 16:06:35,794 - INFO - Remove virtual IP stage
2018-06-07 16:06:35,794 - INFO - ifconfig eth0:0 0.0.0.0 0.0.0.0 &>/dev/null [Dryrun]
2018-06-07 16:06:35,794 - INFO - ip addr show |grep 10.5.106.50 &>/dev/null [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable goconserver [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable conserver [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable ntpd [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable dhcpd [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable named [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable xcatd [Dryrun]
2018-06-07 16:06:35,794 - INFO - systemctl disable postgresql [Dryrun]
2018-06-07 16:06:35,803 - INFO - systemctl stop goconserver [Dryrun]
2018-06-07 16:06:35,804 - INFO - systemctl stop conserver [Dryrun]
2018-06-07 16:06:35,804 - INFO - systemctl stop ntpd [Dryrun]
2018-06-07 16:06:35,804 - INFO - systemctl stop dhcpd [Dryrun]
2018-06-07 16:06:35,804 - INFO - systemctl stop named [Dryrun]
2018-06-07 16:06:35,804 - INFO - systemctl stop xcatd [Dryrun]
2018-06-07 16:06:35,804 - INFO - systemctl stop postgresql [Dryrun]
2018-06-07 16:06:35,804 - INFO - This machine is set to standby management node successfully...
bybai commented 6 years ago

I am OK to merge it. Thanks