xcat2 / xcat-extensions

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

lsdef: command not found - xcatha.py rely on PATH to run xCAT command #14

Closed neo954 closed 6 years ago

neo954 commented 6 years ago

This bug is against xcatha.py commit 3c0251fe0763f597f098bd16a4d4542c3fe8b9c8.

Failed configure xCAT policy table stage, with error message lsdef: command not found.

Normally, when a user install xCAT in a new environment at the first time, the user need to logout and login again to get the environment variables updated. But when go-xcat is called by xcatha.py and xCAT is installed by xcatha.py. There is no chance for the user to logout and login. Thus, xcatha.py should not rely on the environment variable PATH to find lsdef. Or xcatha.py should redefine the PATH variable internally.

# ./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:39:28,535 - INFO - Check virtual ip stage
2018-06-07 02:39:28,535 - 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 2006ms
pipe 3
2018-06-07 02:39:31,548 - INFO - virtual ip can be used.
============================================================================================
2018-06-07 02:39:31,548 - INFO - Check if xCAT data is in shared data directory
2018-06-07 02:39:31,548 - INFO - There is xCAT data /media/u/gongjie/ha-test/install in shared data /media/u/gongjie/ha-test
============================================================================================
2018-06-07 02:39:31,549 - INFO - Check if target dbtype is the same with shared data dbtype stage
2018-06-07 02:39:31,549 - INFO - Database type is 'sqlite' in shared data directory
2018-06-07 02:39:31,549 - INFO - Target database type is matched [Passed]
============================================================================================
2018-06-07 02:39:31,549 - INFO - Configure virtual ip as alias ip stage
2018-06-07 02:39:31,551 - INFO - ifconfig eth0:99 10.3.1.99  netmask 255.0.0.0 [Passed]
============================================================================================
2018-06-07 02:39:31,552 - INFO - Save physical hostname and ip
============================================================================================
2018-06-07 02:39:31,552 - INFO - Configure hostname stage for host c910f03c01p99
2018-06-07 02:39:31,554 - INFO - hostname c910f03c01p99 [Passed]
============================================================================================
2018-06-07 02:39:31,554 - INFO - Check xcatd service status
============================================================================================
2018-06-07 02:39:31,587 - INFO - Check database type stage
2018-06-07 02:39:31,592 - INFO - ifconfig|grep "inet 10.3.1.7  netmask" > /dev/null [Passed]
============================================================================================
2018-06-07 02:39:31,595 - INFO - Check if xCAT data is in shared data directory
2018-06-07 02:39:31,595 - INFO - There is xCAT data /media/u/gongjie/ha-test/install in shared data /media/u/gongjie/ha-test
============================================================================================
2018-06-07 02:39:31,595 - INFO - Installing database package ...
============================================================================================
2018-06-07 02:39:31,597 - INFO - Configure shared data directory stage
2018-06-07 02:39:31,598 - INFO - Creating symlink .../install
2018-06-07 02:39:31,617 - INFO - Creating symlink .../etc/xcat
2018-06-07 02:39:31,627 - INFO - Creating symlink .../root/.xcat
2018-06-07 02:39:31,628 - INFO - Creating symlink .../var/lib/pgsql
2018-06-07 02:39:31,629 - INFO - Creating symlink .../tftpboot
2018-06-07 02:39:31,658 - INFO - cat /tmp/ha_mn >> /etc/xcat/ha_mn [Passed]
============================================================================================
2018-06-07 02:39:31,659 - INFO - Check xcatd service status
2018-06-07 02:39:31,664 - INFO - xCAT service has started [Passed]
============================================================================================
2018-06-07 02:39:31,664 - INFO - Configure xCAT policy table stage
sh: lsdef: command not found
2018-06-07 02:39:31,668 - ERROR - lsdef -t policy -i name|grep c910f03c01p99 [Failed]
sh: lsdef: command not found
2018-06-07 02:39:31,670 - ERROR - lsdef -t policy |grep 1.3 [Failed]
sh: chdef: command not found
2018-06-07 02:39:31,672 - ERROR - chdef -t policy 1.3 name=c910f03c01p99 rule=trusted [Failed]
2018-06-07 02:39:31,672 - ERROR - 'chdef -t policy 1.3 name=c910f03c01p99 rule=trusted' [Failed]
============================================================================================
2018-06-07 02:39:31,672 - INFO - Deactivate stage
2018-06-07 02:39:31,678 - INFO - ifconfig|grep "inet 10.3.1.7  netmask" > /dev/null [Passed]
2018-06-07 02:39:31,686 - INFO - ifconfig|grep "inet 10.3.1.7  netmask" > /dev/null [Passed]
============================================================================================
2018-06-07 02:39:31,689 - INFO - Configure hostname stage for host c910f03c01p07
2018-06-07 02:39:31,691 - INFO - hostname c910f03c01p07 [Passed]
============================================================================================
2018-06-07 02:39:31,691 - INFO - Unconfigure shared data directory stage
2018-06-07 02:39:31,691 - INFO - Removing symlink .../install
2018-06-07 02:39:31,691 - INFO - Removing symlink .../etc/xcat
2018-06-07 02:39:31,691 - INFO - Removing symlink .../root/.xcat
2018-06-07 02:39:31,691 - INFO - Removing symlink .../var/lib/pgsql
2018-06-07 02:39:31,691 - INFO - Removing symlink .../tftpboot
============================================================================================
2018-06-07 02:39:31,691 - INFO - Remove virtual IP stage
2018-06-07 02:39:31,693 - INFO - ifconfig eth0:99 0.0.0.0 0.0.0.0 &>/dev/null [Failed, OK to ignore]
2018-06-07 02:39:31,696 - INFO - ip addr show |grep 10.3.1.99 &>/dev/null [Failed, OK to ignore]
2018-06-07 02:39:31,696 - INFO - Remove virtual IP [Passed]
2018-06-07 02:39:31,836 - INFO - systemctl disable goconserver [Passed]
conserver.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig conserver off
2018-06-07 02:39:31,942 - INFO - systemctl disable conserver [Passed]
2018-06-07 02:39:32,007 - INFO - systemctl disable ntpd [Passed]
Removed symlink /etc/systemd/system/multi-user.target.wants/dhcpd.service.
2018-06-07 02:39:32,071 - INFO - systemctl disable dhcpd [Passed]
Removed symlink /etc/systemd/system/multi-user.target.wants/named.service.
2018-06-07 02:39:32,142 - INFO - systemctl disable named [Passed]
xcatd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig xcatd off
2018-06-07 02:39:32,221 - INFO - systemctl disable xcatd [Passed]
2018-06-07 02:39:32,248 - INFO - systemctl stop goconserver [Passed]
2018-06-07 02:39:32,260 - INFO - systemctl stop conserver [Passed]
2018-06-07 02:39:32,271 - INFO - systemctl stop ntpd [Passed]
2018-06-07 02:39:32,283 - INFO - systemctl stop dhcpd [Passed]
2018-06-07 02:39:32,295 - INFO - systemctl stop named [Passed]
2018-06-07 02:39:32,594 - INFO - systemctl stop xcatd [Passed]
2018-06-07 02:39:32,594 - INFO - This machine is set to standby management node successfully...
neo954 commented 6 years ago

Refer to xcat2/xcat2-task-management#163