jakabk
(Kristóf Jakab)
October 29, 2020, 3:09pm
1
We have two LXD hosts creating containers with default profile results in different containers, on the second host containers do not have volatile.eth0.hwaddr option.
What can cause this? Does it matter the different LXD versions (3.0.3, 3.0.4)?
First host
root@pilot-lxc:~# lxd --version
3.0.3
root@pilot-lxc:~# lxc init images:debian/10/amd64 -p default test-container-1
Creating test-container-1
root@pilot-lxc:~# lxc profile show default
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:
- /1.0/containers/test-container-1
root@pilot-lxc:~# lxc config show test-container-1
architecture: x86_64
config:
image.architecture: amd64
image.description: Debian buster amd64 (20201029_05:24)
image.os: Debian
image.release: buster
image.serial: "20201029_05:24"
volatile.apply_template: create
volatile.base_image: 6c982b800e35a225d75b555b866dbc3c78a25256734a1af752de541a6f50c69c
**volatile.eth0.hwaddr: 00:16:3e:48:50:ca**
volatile.idmap.base: "0"
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: ""
On second host the same
Container config has not volatile.eth0.hwaddr option
root@lxd-cihost:~# lxd --version
3.0.4
root@lxd-cihost:~# lxc init images:debian/10/amd64 -p default test-container-1
Creating test-container-1
root@lxd-cihost:~# lxc profile show default
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:
- /1.0/containers/test-container-1
root@lxd-cihost:~# lxc config show test-container-1
architecture: x86_64
config:
image.architecture: amd64
image.description: Debian buster amd64 (20201029_05:24)
image.os: Debian
image.release: buster
image.serial: "20201029_05:24"
volatile.apply_template: create
volatile.base_image: 6c982b800e35a225d75b555b866dbc3c78a25256734a1af752de541a6f50c69c
volatile.idmap.base: "0"
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[]'
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: ""
tomp
(Thomas Parrott)
October 29, 2020, 4:10pm
2
Your subject mentions “not started”, has the container never been started?
tomp
(Thomas Parrott)
October 29, 2020, 4:19pm
4
And if you start it the entry is added?
jakabk
(Kristóf Jakab)
October 29, 2020, 4:24pm
5
Yes, and after stopping the container it persists.
jakabk
(Kristóf Jakab)
October 29, 2020, 4:27pm
6
On our 3.0.3. LXD system the entry exists after container has been created.
I’ve read in the 3.0.4. release notes that:
jakabk
(Kristóf Jakab)
October 29, 2020, 4:38pm
7
If I do:
lxc network attach br0 test-container-1 eth0 eth0
The entry will be shown.
tomp
(Thomas Parrott)
October 29, 2020, 4:39pm
8
Seems ok using the snap:
root@v1:~# snap install lxd --channel 3.0/stable
2020-10-29T16:36:17Z INFO Waiting for automatic snapd restart...
lxd (3.0/stable) 3.0.4 from Canonical✓ installed
root@v1:~# lxd init --auto
root@v1:~# lxc init images:debian/buster c1
root@v1:~# lxc config show c1 --expanded
architecture: x86_64
config:
image.architecture: amd64
image.description: Debian buster amd64 (20201029_05:24)
image.os: Debian
image.release: buster
image.serial: "20201029_05:24"
volatile.apply_template: create
volatile.base_image: 6c982b800e35a225d75b555b866dbc3c78a25256734a1af752de541a6f50c69c
volatile.eth0.hwaddr: 00:16:3e:72:00:d0
volatile.idmap.base: "0"
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[]'
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""
tomp
(Thomas Parrott)
October 29, 2020, 4:40pm
9
Can you show ouput of a new container on the affected host of:
lxc init images:debian/buster c1
lxc config show c1 --expanded
jakabk
(Kristóf Jakab)
October 29, 2020, 4:42pm
10
root@lxd-cihost:~# lxc init images:debian/buster c1
Creating c1
root@lxd-cihost:~# lxc config show c1 --expanded
architecture: x86_64
config:
image.architecture: amd64
image.description: Debian buster amd64 (20201029_05:24)
image.os: Debian
image.release: buster
image.serial: "20201029_05:24"
volatile.apply_template: create
volatile.base_image: 6c982b800e35a225d75b555b866dbc3c78a25256734a1af752de541a6f50c69c
volatile.idmap.base: "0"
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[]'
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""
tomp
(Thomas Parrott)
October 29, 2020, 4:47pm
11
Are you running the snap by the way?
jakabk
(Kristóf Jakab)
October 29, 2020, 4:52pm
12
What do you mean?
root@lxd-cihost:~# snap list
Name Version Rev Tracking Publisher Notes
core 16-2.47.1 10185 latest/stable canonical✓ core
lxd 3.0.4 11348 3.0/stable/… canonical✓ -
root@lxd-cihost:~#
tomp
(Thomas Parrott)
October 29, 2020, 5:10pm
13
OK you’re running the snap.
I think the issue is that the br0
interface is not an LXD managed bridge, and therefore it does not generate a static DHCP lease file for dnsmasq at create time (which would trigger the volatile MAC address key to be added).
Is the br0 on the other host a LXD managed bridge (i.e in lxc network ls
it shows “yes” in the “Managed” column?
jakabk
(Kristóf Jakab)
October 29, 2020, 5:13pm
14
You are right:
root@lxd-cihost:~# lxc network ls | grep br0
| br0 | bridge | NO | | 12 |
jakabk
(Kristóf Jakab)
October 29, 2020, 5:15pm
15
But the on other system (LXD 3.0.3) the situation is the same (not managed) and it provides the entry.
root@pilot-lxc:~# lxc network ls | grep br0
| br0 | bridge | NO | | 49 |
tomp
(Thomas Parrott)
October 29, 2020, 5:56pm
16
I’ve confirmed that the LXD 3.0.3 deb on Ubuntu Bionic does not have this behaviour that LXD 3.0.4 snap is exhibiting.
Would it be possible for you to use the LXD 4.0 LTS branch as that has longer support and I’ve confirmed it does not have the behaviour (as it has a refreshed devices framework, and the NIC’s volatile MAC address is always generated when the device’s config is loaded).
jakabk
(Kristóf Jakab)
October 30, 2020, 7:06am
17
Thank you for your help!
Can I upgrade LXD to 4.0 LTS without any trouble?
tomp
(Thomas Parrott)
October 30, 2020, 9:37am
18
Hi,
Yes this should be fine, I just tried it now in a VM:
apt install snapd
snap install lxd --channel=3.0/stable
lxd init --auto
lxc launch images:ubuntu/focal c1
lxc stop c1
snap refresh lxd --channel=4.0/stable
lxc start c1
lxc ls c1
+------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| c1 | RUNNING | 10.119.183.220 (eth0) | fd42:c6e5:1fe5:835f:216:3eff:feb9:47f8 (eth0) | CONTAINER | 0 |
+------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
jakabk
(Kristóf Jakab)
October 30, 2020, 10:35am
19
Thank you very much. I’ve created a snap snapshot (save) about the lxd and I’ll update it.