[lxc-devel] Is this a valid LXD 2.7-0ubuntu2 config

Stéphane Graber stgraber at ubuntu.com
Fri Jan 20 16:50:31 UTC 2017


On Fri, Jan 20, 2017 at 11:17:18AM +0100, Louis Bouchard wrote:
> Hello,
> 
> Le 18/01/2017 à 18:00, Stéphane Graber a écrit :
> > On Wed, Jan 18, 2017 at 12:39:48PM +0100, Louis Bouchard wrote:
> >> Hello,
> >>
> >> Given a NIC with a tagged vlan (Id 100) named enp0s25.100. This vlan has a DHCP
> >> server on the router.
> >>
> >> After installing LXD from scratch, and configuring it without any bridge I do
> >> the following :
> >>
> >> $ lxc profile device add default eth0 nic nictype=macvlan parent=enp0s25.100
> >> $ lxc launch ubuntu-daily:z test
> >>
> >> The container starts correctly and gets a valid IP addres on the subnet of the
> >> vlan :
> >>
> >>
> >> -- # lxc list
> >> +------+---------+------------------------+------+------------+-----------+
> >> | NAME |  STATE  |          IPV4          | IPV6 |    TYPE    | SNAPSHOTS |
> >> +------+---------+------------------------+------+------------+-----------+
> >> | test | RUNNING | 192.168.100.130 (eth0) |      | PERSISTENT | 0         |
> >> +------+---------+------------------------+------+------------+-----------+
> >>
> >>
> >> If this is a valid configuration, then there is a bug in the way that Juju
> >> detects the network configuration as :
> >>
> >> # juju bootstrap lxd lxd
> >> ERROR creating LXD client: juju doesn't support ipv6. Please disable LXD's IPV6:
> >>
> >>         $ lxc network set enp0s25.100 ipv6.address none
> >>
> >> and rebootstrap
> >>
> >>
> >> Looks like juju/tools/lxdclient/network_client.go:checkBridgeConfig is not
> >> getting the proper information in return when the network being used is not a
> >> bridge.
> >>
> >> Any thought ?
> > 
> > That is indeed a valid config and Juju's network config detection is
> > rather naive and error prone when you're not using the most basic
> > network config.
> > 
> > Do note however that when using macvlan for your containers, the host
> > will not be able to talk to them over the network that you attached to
> > them. So if your host is also using enp0s25.100 to get to the network,
> > this may be a problem and will likely prevent Juju from communicating
> > with the containers.
> > 
> > If host and containers are using separate vlans, then that won't be a
> > problem as the host will talk to the containers through its gateway,
> > getting around that macvlan limitation.
> > 
> 
> Thanks for the confirmation & clarification about the macvlan nictype.
> 
> As a side note, is it normal not to see the vlan nics listed in the "lxc network
> list" command ?
> 
> # lxc network list
> +---------+----------+---------+---------+
> |  NAME   |   TYPE   | MANAGED | USED BY |
> +---------+----------+---------+---------+
> | enp0s25 | physical | NO      | 0       |
> +---------+----------+---------+---------+
> | virbr0  | bridge   | NO      | 0       |
> +---------+----------+---------+---------+
> | wlo1    | physical | NO      | 0       |
> +---------+----------+---------+---------+
> 
> The enp0s25.100 vlan nic can be used as a network though.
> 
> Kind regards,
> 
> ...Louis

My guess is that it's being marked as "unknown" by LXD internally due to
its /sys/class/net/ information, which then causes the client to hide it
from the list. Please file a bug at https://github.com/lxc/lxd/issues so
I remember to add the needed logic to detect those.


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170120/d80c07eb/attachment.sig>


More information about the lxc-devel mailing list