View Issue Details

IDProjectCategoryView StatusLast Update
0015541CentOS-7libvirtpublic2018-12-06 09:12
Reporterkolomxs 
PrioritynormalSeverityminorReproducibilityalways
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: https://bugzilla.redhat.com/show_bug.cgi?id=1656463
------------------------------------------------------------------------------------------------------------------------
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'/>
</interface>
2.
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 @@
         case VIR_DOMAIN_NET_TYPE_INTERNAL:
         case VIR_DOMAIN_NET_TYPE_DIRECT:
         case VIR_DOMAIN_NET_TYPE_HOSTDEV:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported net type %s"),
+ virDomainNetTypeToString(ctrl->def->nets[i]->type));
+ goto cleanup;
+ case VIR_DOMAIN_NET_TYPE_LAST:
         default:
- break;
+ virReportEnumRangeError(virDomainNetType,
ctrl->def->nets[i]->type);
+ goto cleanup;
         }
     }

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

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'/>
    </interface>
After this container with macvlan started.

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

Activities

There are no notes attached to this issue.

Issue History

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