xcat2 / xcat-extensions

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

In xcatha.py, please use command ip instead of deprecated ifconfig #10

Open neo954 opened 6 years ago

neo954 commented 6 years ago

As you can see in the Red Hat Enterprise Linux 7 Migration Planning Guide, Section 2.4.8, ifconfig is deprecated.

[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/migration_planning_guide/sect-red_hat_enterprise_linux-migration_planning_guide-system_management#sect-Red_Hat_Enterprise_Linux-Migration_Planning_Guide-System_Management-New_Format_in_ifconfig

# ./xcatha.py -s -p /media/u/gongjie/ha-test -i eth0 -v 10.3.1.99 -n c910f03c01p99 -m 255.0.0.0 -t sqlite
============================================================================================
2018-06-06 00:49:19,937 - INFO - Check virtual ip stage
2018-06-06 00:49:19,937 - 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 2008ms
pipe 3
2018-06-06 00:49:22,938 - INFO - virtual ip can be used.
============================================================================================
2018-06-06 00:49:22,938 - INFO - Check if xCAT data is in shared data directory
2018-06-06 00:49:22,939 - INFO - There is xCAT data /media/u/gongjie/ha-test/install in shared data /media/u/gongjie/ha-test
============================================================================================
2018-06-06 00:49:22,940 - INFO - Check if target dbtype is the same with shared data dbtype stage
2018-06-06 00:49:22,940 - INFO - Database type is 'sqlite' in shared data directory
2018-06-06 00:49:22,940 - INFO - Target database type is matched [Passed]
============================================================================================
2018-06-06 00:49:22,940 - INFO - Start configure virtual ip as alias ip stage
2018-06-06 00:49:22,940 - INFO - Running ifconfig eth0 10.3.1.99  netmask 255.0.0.0
sh: ifconfig: command not found
2018-06-06 00:49:22,941 - ERROR - ifconfig eth0 10.3.1.99  netmask 255.0.0.0 [Failed]
2018-06-06 00:49:22,942 - ERROR - Error: configure virtual IP [Failed].
2018-06-06 00:49:22,942 - ERROR - Error: Start configure virtual ip as alias ip stage
2018-06-06 00:49:22,942 - ERROR - Error encountered, starting to clean up the environment
2018-06-06 00:49:22,942 - INFO - Warning: Can not restore original hostname
============================================================================================
2018-06-06 00:49:22,942 - INFO - Unconfigure shared data directory stage
2018-06-06 00:49:22,942 - INFO - Removing symlink .../install
2018-06-06 00:49:22,942 - INFO - Removing symlink .../etc/xcat
2018-06-06 00:49:22,942 - INFO - Removing symlink .../root/.xcat
2018-06-06 00:49:22,942 - INFO - Removing symlink .../var/lib/pgsql
2018-06-06 00:49:22,942 - INFO - Removing symlink .../tftpboot
============================================================================================
2018-06-06 00:49:22,943 - INFO - Remove virtual IP
2018-06-06 00:49:22,943 - INFO - Running ifconfig eth0 0.0.0.0 0.0.0.0 &>/dev/null
2018-06-06 00:49:22,944 - INFO - ifconfig eth0 0.0.0.0 0.0.0.0 &>/dev/null [Failed, OK to ignore]
2018-06-06 00:49:22,944 - INFO - Running ip addr show |grep 10.3.1.99 &>/dev/null
2018-06-06 00:49:22,947 - INFO - ip addr show |grep 10.3.1.99 &>/dev/null [Failed, OK to ignore]
2018-06-06 00:49:22,947 - INFO - Remove virtual IP [Passed]
robin2008 commented 6 years ago

ip should be used, but this is not a high pri issue.

bybai commented 6 years ago

issue accepted, will fix later.

neo954 commented 6 years ago

Refer to xcat2/xcat2-task-management#163

zet809 commented 6 years ago

have this issue fixed? If yes, pls close, or move to next release

zet809 commented 6 years ago

hi, @neo954 and @bybai , any update for this issue? Thx!