0

I am trying out LXD, and created a barebones Arch Linux image from scratch. It works perfectly the first time the image is used, but cloning the container or reusing the image causes networkd to not broadcast a DHCP request.

The logs don't say anything interesting - the dnsmasq log for LXD doesn't mention any requests from the cloned container, the containers journal for networkd doesn't mention anything other than assigning link local addresses, and the working container log doesn't say anything special.

The mac addresses are different:

chloridecull@changeling:~$ lxc exec pythonhijinx -- ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
21: eth1@if22: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:62:f5:96 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::216:3eff:fe62:f596/64 scope link
       valid_lft forever preferred_lft forever
23: eth0@if24: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:2d:21:de brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::216:3eff:fe2d:21de/64 scope link
       valid_lft forever preferred_lft forever
chloridecull@changeling:~$ lxc exec drawpilesrv -- ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
17: eth0@if18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:9e:10:77 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 2a01:████:ffff:████::faff/48 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe9e:1077/64 scope link
       valid_lft forever preferred_lft forever
19: eth1@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:32:33:70 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.0.3.143/24 brd 10.0.3.255 scope global dynamic eth1
       valid_lft 3257sec preferred_lft 3257sec
    inet6 fe80::216:3eff:fe32:3370/64 scope link
       valid_lft forever preferred_lft forever

The system IDs are different:

chloridecull@changeling:~$ lxc exec pythonhijinx -- cat /etc/machine-id
734bc201668745ff8259753d22fee54d
chloridecull@changeling:~$ lxc exec drawpilesrv -- cat /etc/machine-id
dec5bf32ce6b4017869fb872e7663e15

Profile in use:

chloridecull@changeling:~$ lxc profile show default
name: default
config: {}
devices:
  eth0:
    nictype: bridged
    parent: br0
    type: nic
  eth1:
    nictype: bridged
    parent: lxcbr0
    type: nic

1 Answers1

0

The solution was simpler than I thought - for some reason the interfaces swapped places.

Compare the other end of the invalid eth1@if22 with the valid eth1@if20:

20: veth7CJ8BF@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master lxcbr0 state UP mode DEFAULT group default qlen 1000
    link/ether fe:ec:a2:e5:94:48 brd ff:ff:ff:ff:ff:ff link-netnsid 0
22: vethHK45MP@if21: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000
    link/ether fe:9b:42:ff:d7:99 brd ff:ff:ff:ff:ff:ff link-netnsid 3

This is fixed by adding name keys to the LXD profile.