View Issue Details

IDProjectCategoryView StatusLast Update
0015541CentOS-7libvirtpublic2018-12-06 09:12
Status newResolutionopen 
Product Version7.5.1804 
Target VersionFixed in Version 
Summary0015541: LXC container can't start after upgrade from 3.9.0 to 4.5.0: "Unsupported net type direct"
Descriptionmain bug:
After upgrade from Centos 7.5 to 7.6, new libvirt 4.5.0 was installed.
Container with interface type='direct' (macvlan) can't be started with error
"Unsupported net type direct"

Version-Release number of selected component (if applicable):
Name : libvirt
Arch : x86_64
Version : 4.5.0
Release : 10.el7_6.3
Size : 0.0
Repo : installed
From repo : updates
Steps To Reproduce1.
Make lxc container test1 with next interface sections in config:
<interface type='direct'>
      <mac address='02:00:00:00:00:01'/>
      <source dev='eno1.777' mode='bridge'/>
virsh start test1

Actual results:
Container not start

Expected results:
Container started
Additional InformationAfter upgrade lxc containers have broken config and can't start:
2018-12-05 10:38:32.634+0000: 18010: debug :
virLXCControllerGetNICIndexes:368 : Getting nic indexes
2018-12-05 10:38:32.634+0000: 18010: error :
virLXCControllerGetNICIndexes:400 : unsupported configuration:
Unsupported net type direct
Failure in libvirt_lxc startup: unsupported configuration: Unsupported
net type direct

We use linux macvlan solutions for libvirt lxc and it's worked at least since libvirt 1.2.7 for us.
As I can see, in version 4.1.0 and later, some changes about DIRECT
connect was implemented.
VIR_DOMAIN_NET_TYPE_DIRECT is still fully supported in src/lxc/lxc_driver.c
But in src/lxc/lxc_controller.c added some check for group of NET_TYPE:

--- libvirt-3.9.0/src/lxc/lxc_controller.c 2017-09-28
13:15:43.322712913 +0300
+++ libvirt-4.1.0/src/lxc/lxc_controller.c 2018-02-28
16:21:05.158799006 +0300
@@ -395,8 +395,14 @@
+ _("Unsupported net type %s"),
+ virDomainNetTypeToString(ctrl->def->nets[i]->type));
+ goto cleanup;
- break;
+ virReportEnumRangeError(virDomainNetType,
+ goto cleanup;

As workaround we can create autostart and persistence network:
  <forward mode="bridge">
    <interface dev="eno1.777"/>

and use type=network in lxc config, like this:

   <interface type='network'>
      <mac address='02:00:00:00:00:01'/>
      <source network='direct-macvlan'/>
      <target dev='eth0'/>
After this container with macvlan started.

Another workaround - downgrade to libvirt version 3.10.0 from centos virt repo
TagsNo tags attached.


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2018-12-06 09:12 kolomxs New Issue