Bonding NICs results in errors in ncftool and virsh

Bug #1591249 reported by Anonymous Linux User on 2016-06-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netcfg
New
Undecided
Unassigned
libvirt (Ubuntu)
Undecided
Unassigned
netcf (Ubuntu)
Undecided
Unassigned

Bug Description

Description of problem: Bonded two NICs and can't work with bond0 via virsh or ncftool

Version-Release number of selected component (if applicable):
* netcf 1:0.2.8-1ubuntu1

$ virsh -V
Virsh command line tool of libvirt 1.3.1
See web site at http://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox ESX Test
 Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
 Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog ZFS
 Miscellaneous: Daemon Nodedev AppArmor Secrets Debug Readline Modular

How reproducible: 100%

Steps to Reproduce:
1. Bond two NIC
2. Run "virsh iface-edit bond0"
3. Get error: error: internal error: could not get interface XML description: unspecified error

or

2. run "ncftool -d dumpxml bond0"
3. Get error: error: unspecified error

Actual results:
Get errors no XML output or editing

Expected results:
With virsh: Go into vim to edit XML
With ncftool: Get XML

Additional info:
$ virsh --debug=0 iface-edit bond0
iface-edit: interface(optdata): bond0
iface-edit: found option <interface>: bond0
iface-edit: <interface> trying as interface NAME
error: internal error: could not get interface XML description: unspecified error

------------------------------------------------------------

$ virsh iface-dumpxml bond0
<interface type='bond' name='bond0'>
  <protocol family='ipv4'>
    <ip address='192.168.1.16' prefix='24'/>
  </protocol>
  <protocol family='ipv6'>
    <ip address='REDACTED:1bf5' prefix='64'/>
  </protocol>
  <link speed='2000' state='up'/>
  <bond>
    <interface type='ethernet' name='eno1'>
      <link speed='1000' state='up'/>
      <mac address='REDACTED:1b:f5'/>
    </interface>
    <interface type='ethernet' name='eno2'>
      <link speed='1000' state='up'/>
      <mac address='REDACTED:1b:f5'/>
    </interface>
  </bond>
</interface>

------------------------------------------------------------

$ more /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eno1
allow-bond eno1
iface eno1 inet manual
bond-master bond0

auto eno2
allow-bond eno2
iface eno2 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.1.16
gateway 192.168.1.1
netmask 255.255.255.0
bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-slaves eno1 eno2
pre-up (sleep 1 && ifup eno1) &
pre-up (sleep 1 && ifup eno2) &

------------------------------------------------------------
$ virsh iface-dumpxml eno1
<interface type='ethernet' name='eno1'>
  <link speed='1000' state='up'/>
  <mac address='REDACTED:1b:f5'/>
</interface>
------------------------------------------------------------

$ virsh iface-dumpxml eno2
<interface type='ethernet' name='eno2'>
  <link speed='1000' state='up'/>
  <mac address='REDACTED:1b:f5'/>
</interface>

-------------------------------------------------------------

Notes:
* Mac addresses on eno1=eno2=bond0

* I can run "virsh iface-dumpxml bond0" (see above)

* This affects the Virtual Machine Manager GUI so you can't edit network config that way either.

* I tried removing all comments from /etc/network/interfaces ... did not help

I also opened a bug against virsh directly at https://bugzilla.redhat.com/show_bug.cgi?id=1344552 but the comments say this bug is a problem with the Ubuntu implementation specifically.

affects: canonical-devices-system-image → netcfg

This appears to be something tied to Ubuntu's back-end for processing these XML files.

I got ncftool to give a very similar dump to virsh's with --live

ncftool> dumpxml --live bond0
<?xml version="1.0"?>
<interface name="bond0" type="bond">
  <link state="up" speed="2000"/>
  <bond>
    <interface name="eno1" type="ethernet">
      <link state="up" speed="1000"/>
      <mac address="REDACTED:1b:f4"/>
    </interface>
    <interface name="eno2" type="ethernet">
      <link state="up" speed="1000"/>
      <mac address="REDACTED:1b:f4"/>yy
    </interface>
  </bond>
  <protocol family="ipv4">
    <ip address="192.168.1.16" prefix="24"/>
  </protocol>
  <protocol family="ipv6">
    <ip address="REDACTED:1bf4" prefix="64"/>
  </protocol>
</interface>

---------------------------

Running
$ncftool dumpxml --live bond0 > /tmp/bond0.xml
$ncftool define /tmp/bond0.xml
error: XML invalid
error: Expecting an element start, got nothing
----------------------

This appears to be something tied to Ubuntu's back-end for processing these XML files.

I read in some comments that the format of /etc/network/interfaces can confuse Ubuntu's back-end processing for ncftool. I tried removing all comments and simplifying that file as

----------------
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eno1
allow-bond eno1
iface eno1 inet manual
bond-master bond0

auto eno2
allow-bond eno2
iface eno2 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.1.16
gateway 192.168.1.1
netmask 255.255.255.0
bond-mode 4
bond-slaves eno1 eno2

---------------

and rebooted. It did not solve the issue.

Tried moving the IP to the bridge instead of the bond.

---------------------
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eno1
  allow-bond eno1
  iface eno1 inet manual
  bond-master bond0

auto eno2
  allow-bond eno2
  iface eno2 inet manual
  bond-master bond0

auto bond0
  iface bond0 inet manual
  bond-miimon 100
  bond-mode 4
  bond-slaves eno1 eno2

auto br0
  iface br0 inet static
  address 192.168.1.16
  gateway 192.168.1.1
  netmask 255.255.255.0
  broadcast 192.168.1.255
  bridge_ports bond0
  bridge_hello 2
  bridge_stp off
  bridge_fd 9
  bridge_maxwait 12
------------------------------

Makes it worse.

$ ncftool list
error: unspecified error
error: errors in loading some config files

---------------------------------

$ virsh iface-list
error: Failed to list interfaces
error: internal error: failed to get number of host interfaces: unspecified error - errors in loading some config files

$ uname -a
Linux XXXX 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ more /etc/issue
Ubuntu 16.04 LTS \n \l

Paul White (paulw2u) on 2016-06-17
affects: ubuntu → libvirt (Ubuntu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.