oscar-cluster / oscar

OSCAR main source repository.
GNU General Public License v2.0
13 stars 2 forks source link

ifconfig output has changed in newer versions. need to migrate to /usr/bin//ip addr command. #624

Open dikim33 opened 7 years ago

dikim33 commented 7 years ago

Reported by olahaye74 on 2 Oct 2013 16:22 UTC I've just discovered that newer ifconfig command output is different from older versions.

now, "HWaddr" is replaced by "ether" and is not in the 1st line output now.

Old output:(rhel6) eth0 Link encap:Ethernet HWaddr 00:0C:29:03:F3:77 inet addr:192.168.25.137 Bcast:192.168.25.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe03:f377/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:85972 errors:0 dropped:0 overruns:0 frame:0 TX packets:559096 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:114296781 (109.0 MiB) TX bytes:33830845 (32.2 MiB) Interrupt:19 Base address:0x2000

New output:(fedora18 (and 17)) eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.25.134 netmask 255.255.255.0 broadcast 192.168.25.255 inet6 fe80::20c:29ff:fefe:35b prefixlen 64 scopeid 0x20 ether 00:0c:29:fe:03:5b txqueuelen 1000 (Ethernet) RX packets 811094 bytes 1185414193 (1.1 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 157789 bytes 10412250 (9.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

both are output from: LC_ALL=C /sbin/ifconfig

Thus OSCAR is impacted at many places: example: /usr/bin/set_node_nics in find_nics() line 749 fails to find a nic... Thus oscar-config --bootstrap fails with: ERROR: Impossible to detect attached networks at /usr/bin/set_node_nics line 239.

I can't understand why I didn't noticed this before... We are not alone on this point: http://forums.fedoraforum.org/showthread.php?t=282415 The new naming scheme: http://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/appe-Consistent_Network_Device_Naming.html

Affected files so far: (seeking HWaddr) oscar/lib/OSCAR/MAC.pm oscar/scripts/set_node_nics oscar/scripts/update_live_macs pkgsrc/libv3m-v2m/trunk/qemu.cpp pkgsrc/oscar_udev/trunk/lib/udev.pm

dikim33 commented 7 years ago

Comment by olahaye74 on 2 Oct 2013 16:29 UTC /usr/bin/set_node_nics fixed Now working on /usr/bin/create_and_populate_basic_node_info.

Problem: /usr/share/perl5/vendor_perl/OSCAR/Network.pm:490 interface2ip("eth0") returns nothing... Bug found here: Nework.pm line 120. sub interface2ip uses /sbin/ifconfig and tries to parse it, but output is different and broadcast and netmask are swapped, and thus it fails.

dikim33 commented 7 years ago

Comment by olahaye74 on 2 Oct 2013 16:31 UTC Update affected file list.

dikim33 commented 7 years ago

Comment by olahaye74 on 2 Oct 2013 16:56 UTC Network.pm fixed.