mxs kolo
2018-Dec-05 11:43 UTC
[libvirt-users] libvirt 4.1 and later - howto configure LXC with interface macvlan type='direct' ?
Hi all After upgrade from Centos 7.5 to Centos 7.6, our test environment geted new version of libvirt 4.5.0 In which our old 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 next section for network interface: <interface type='direct'> <mac address='02:00:21:3b:eb:e1'/> <source dev='eno1.710' mode='bridge'/> </interface> It's linux macvlan solutions 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 --- 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; } } Since version 4.1.0 which config need be used to configure macvlan for lxc cointainers ?
Daniel P. Berrangé
2018-Dec-05 11:54 UTC
Re: [libvirt-users] libvirt 4.1 and later - howto configure LXC with interface macvlan type='direct' ?
On Wed, Dec 05, 2018 at 02:43:45PM +0300, mxs kolo wrote:> Hi all > > After upgrade from Centos 7.5 to Centos 7.6, our test environment > geted new version of libvirt 4.5.0 > In which our old 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 next section for network interface: > <interface type='direct'> > <mac address='02:00:21:3b:eb:e1'/> > <source dev='eno1.710' mode='bridge'/> > </interface> > > It's linux macvlan solutions 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 > --- 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; > } > } > > Since version 4.1.0 which config need be used to configure macvlan for > lxc cointainers ?Sorry, this looks like my screw up in the code. I mis-interpreted what this function was doing when adding error checking and mistakenly rejected the TYPE_DIRECT nics. Please file a bug against libvirt for this, or send a patch if you wish to. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Laine Stump
2018-Dec-08 18:07 UTC
Re: [libvirt-users] libvirt 4.1 and later - howto configure LXC with interface macvlan type='direct' ?
On 12/5/18 6:54 AM, Daniel P. Berrangé wrote:> On Wed, Dec 05, 2018 at 02:43:45PM +0300, mxs kolo wrote: >> Hi all >> >> After upgrade from Centos 7.5 to Centos 7.6, our test environment >> geted new version of libvirt 4.5.0 >> In which our old 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 next section for network interface: >> <interface type='direct'> >> <mac address='02:00:21:3b:eb:e1'/> >> <source dev='eno1.710' mode='bridge'/> >> </interface> >> >> It's linux macvlan solutions 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 >> --- 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; >> } >> } >> >> Since version 4.1.0 which config need be used to configure macvlan for >> lxc cointainers ? > > Sorry, this looks like my screw up in the code. I mis-interpreted what > this function was doing when adding error checking and mistakenly > rejected the TYPE_DIRECT nics. > > Please file a bug against libvirt for this, or send a patch if you wish > to.Following up on this - this bug was filed: https://bugzilla.redhat.com/show_bug.cgi?id=1656463 Since I had experienced the same problem and had a test case ready at hand, I made a patch and pushed it. The fix will be in libvirt 5.0.0 (more details in the bug report).
Maybe Matching Threads
- libvirt 4.1 and later - howto configure LXC with interface macvlan type='direct' ?
- vhost-net support in ethernet domian
- Re: LXC + USB passthrough = Operation not permitted
- Re: LXC + USB passthrough = Operation not permitted
- Re: LXC + USB passthrough = Operation not permitted