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

Louis Bouchard louis.bouchard at canonical.com
Fri Jan 20 10:17:18 UTC 2017


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

-- 
Louis Bouchard
Software engineer, Cloud & Sustaining eng.
Canonical Ltd
Ubuntu developer                       Debian Maintainer
GPG : 429D 7A3B DD05 B6F8 AF63  B9C4 8B3D 867C 823E 7A61

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170120/09f9c488/attachment.sig>


More information about the lxc-devel mailing list