Description of problem: Bonded two NICs and can't work with bond0 via virsh. Version-Release number of selected component (if applicable): $ 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 Actual results: Get error: error: internal error: could not get interface XML description: unspecified error Expected results: Go into vim to edit 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.
Additional things tried: * Removing all comments from /etc/network/interfaces (did not work) * Running the following: s $virsh iface-dumpxml bond0 > /tmp/bond0.xml $virsh iface-define /tmp/bond0.xml Got errors: error: Failed to define interface from /tmp/bond0.xml error: XML error: could not get interface XML description: XML invalid - Expecting an element start, got nothing
Unfortunately, even the author of the debian/ubuntu port of the netcf library (which is what handles the backend of this) doesn't regularly use debian or ubuntu. You may get a better response if you file a bug against the netcf package in the ubuntu bug system (launchpad.net). In the meantime, you might get better info about the error by saving the output of "ncftool dumpxml bond0 >/tmp/bond0.xml && ncftool define /tmp/bond0.xml". If this is successful, then rry editing /tmp/bond0.xml followed by "ncftool define /tmp/bond0.xml" again - this is essentially what is happening when you run virsh iface-edit.
Thanks - ncftool was not installed, so I'm guessing something else was being called or some other underlying error? Installing ncftool made no difference in virsh errors or functionality. Running ncftool gave the following error: ncftool> dumpxml bond0 error: unspecified error Since this also affects netcf, I opened a ticket against the netcf package in the ubuntu bug system. https://bugs.launchpad.net/canonical-devices-system-image/+bug/1591249 Thanks again.
ncftool is a commandline utility that is usually packaged separately from the netcf library and often not installed by default (e.g. "netcf-libs" for the libraries that libvirt uses, and "netcf" for the commandline utility). The difference between "virsh iface-dumpxml bond0" and "ncftool dumpxml bond0" is that the former shows the *state* of the interface, while the latter shows what is in its config. I'm guessing that "ncftool dumpxml --live" would be successful (and that "virsh iface-dumpxml bond0 --inactive" would fail). So it appears that the debian/ubuntu backend is not correctly parsing the interfaces file in the case of bonds (at least not in the axact format you have them) and that it's returning an error code without a corresponding log message set.
> it appears that the debian/ubuntu backend is not correctly parsing the interfaces file in the case of bonds (at least not in the axact format you have them) and that it's returning an error code without a corresponding log message set. I think you are correct: 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> The only differences being: * single vs double quotes * a prepending of "<?xml version="1.0"?>" * order of xml elements None of that should make a difference. ----------- Running $ncftool dumpxml --live bond0 > /tmp/bond0.xml $ncftool define /tmp/bond0.xml error: XML invalid error: Expecting an element start, got nothing ---------------------- So yes - there's something in the backend which is bombing out on the processing of the XML. I guess you can close this ticket against libvirt as there's something deeper that's the cause. Thanks again!