Juju-deployed LXD container gets only IPv4 on dual-stack interface

Bug #1723240 reported by Doug Parrish
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

Juju appears to be having trouble deploying a LXD container with an interface that should have an IPv4 address and an IPv6 address

In the example below, mgmt is an IPv4-only space; stgfe is an IPv6-only space; and delvrya is has both IPv4 and IPv6. When the container is built, only the IPv4 stanza is added to /etc/network/interfaces, not both as would be expected.

$ juju version
2.2.4-xenial-amd64

$ juju add-machine lxd:7 --constraints spaces=mgmt,stgfe,delvrya
created container 7/lxd/5

$ juju spaces
Space Subnets
delvrya 10.10.0.0/24
         fd4f:0:a:a::/64
delvryb 10.11.0.0/24
         fd4f:0:a:b::/64
mgmt 10.1.0.0/24
         192.168.122.0/24
stgbe fd4f:0:a:6::/64
stgfe fd4f:0:a:5::/64

$ juju subnets
subnets:
  10.1.0.0/24:
    type: ipv4
    provider-id: "1"
    status: in-use
    space: mgmt
    zones:
    - ""
  10.10.0.0/24:
    type: ipv4
    provider-id: "8"
    status: in-use
    space: delvrya
    zones:
    - ""
  10.11.0.0/24:
    type: ipv4
    provider-id: "7"
    status: in-use
    space: delvryb
    zones:
    - ""
  192.168.122.0/24:
    type: ipv4
    provider-id: "11"
    status: in-use
    space: mgmt
    zones:
    - ""
  fd4f:0:a:5::/64:
    type: ipv6
    provider-id: "3"
    status: in-use
    space: stgfe
    zones:
    - ""
  fd4f:0:a:6::/64:
    type: ipv6
    provider-id: "4"
    status: in-use
    space: stgbe
    zones:
    - ""
  fd4f:0:a:a::/64:
    type: ipv6
    provider-id: "5"
    status: in-use
    space: delvrya
    zones:
    - ""
  fd4f:0:a:b::/64:
    type: ipv6
    provider-id: "6"
    status: in-use
    space: delvryb
    zones:
    - ""

$ juju ssh 7
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-96-generic x86_64)

$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
    dns-search virt.ceeness.com maas
    dns-nameservers 10.1.0.4

auto ens3
iface ens3 inet manual
    mtu 1500

auto ens4
iface ens4 inet6 manual
    mtu 1500

auto ens8
iface ens8 inet manual
    mtu 1500

iface ens8 inet6 manual

auto ens9
iface ens9 inet manual
    mtu 1500

iface ens9 inet6 manual

auto br-ens3
iface br-ens3 inet static
    address 10.1.0.30/24
    gateway 10.1.0.1
    bridge_ports ens3

auto br-ens4
iface br-ens4 inet6 static
    address fd4f:0:a:5:0:1:0:7/64
    gateway fd4f:0:a:5::1
    bridge_ports ens4

auto br-ens8
iface br-ens8 inet static
    address 10.10.0.2/24
    bridge_ports ens8

iface br-ens8 inet6 static
    address fd4f:0:a:a:0:1::/64
    bridge_ports ens8

auto br-ens9
iface br-ens9 inet static
    address 10.11.0.2/24
    bridge_ports ens9

iface br-ens9 inet6 static
    address fd4f:0:a:b:0:1::/64
    bridge_ports ens9

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br-ens3 state UP group default qlen 1000
    link/ether 52:54:00:01:00:a0 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5054:ff:fe01:a0/64 scope link
       valid_lft forever preferred_lft forever
3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br-ens4 state UP group default qlen 1000
    link/ether 52:54:00:05:00:a0 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5054:ff:fe05:a0/64 scope link
       valid_lft forever preferred_lft forever
4: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br-ens8 state UP group default qlen 1000
    link/ether 52:54:00:0a:00:a0 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5054:ff:fe0a:a0/64 scope link
       valid_lft forever preferred_lft forever
5: ens9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br-ens9 state UP group default qlen 1000
    link/ether 52:54:00:0b:00:a0 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5054:ff:fe0b:a0/64 scope link
       valid_lft forever preferred_lft forever
6: br-ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:01:00:a0 brd ff:ff:ff:ff:ff:ff
    inet 10.1.0.30/24 brd 10.1.0.255 scope global br-ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe01:a0/64 scope link
       valid_lft forever preferred_lft forever
7: br-ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:0a:00:a0 brd ff:ff:ff:ff:ff:ff
    inet 10.10.0.2/24 brd 10.10.0.255 scope global br-ens8
       valid_lft forever preferred_lft forever
    inet6 fd4f:0:a:a:0:1::/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe0a:a0/64 scope link
       valid_lft forever preferred_lft forever
8: br-ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:05:00:a0 brd ff:ff:ff:ff:ff:ff
    inet6 fd4f:0:a:5:0:1:0:7/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe05:a0/64 scope link
       valid_lft forever preferred_lft forever
9: br-ens9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:0b:00:a0 brd ff:ff:ff:ff:ff:ff
    inet 10.11.0.2/24 brd 10.11.0.255 scope global br-ens9
       valid_lft forever preferred_lft forever
    inet6 fd4f:0:a:b:0:1::/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe0b:a0/64 scope link
       valid_lft forever preferred_lft forever
10: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether ba:14:11:c7:20:77 brd ff:ff:ff:ff:ff:ff
    inet 10.0.129.1/24 scope global lxdbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::b814:11ff:fec7:2077/64 scope link
       valid_lft forever preferred_lft forever
12: vethGU5IKI@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-ens3 state UP group default qlen 1000
    link/ether fe:8c:58:1b:fd:df brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::fc8c:58ff:fe1b:fddf/64 scope link
       valid_lft forever preferred_lft forever
14: vethRJ1FQK@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-ens3 state UP group default qlen 1000
    link/ether fe:a1:eb:54:33:1a brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::fca1:ebff:fe54:331a/64 scope link
       valid_lft forever preferred_lft forever
16: vethVYHLYW@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-ens4 state UP group default qlen 1000
    link/ether fe:58:92:c9:99:0c brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::fc58:92ff:fec9:990c/64 scope link
       valid_lft forever preferred_lft forever
18: vethX6OURX@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-ens8 state UP group default qlen 1000
    link/ether fe:5a:8d:4b:1a:05 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::fc5a:8dff:fe4b:1a05/64 scope link
       valid_lft forever preferred_lft forever

$ logout
Connection to 10.1.0.30 closed.

$ juju ssh 7/lxd/5

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@juju-5c1ec1-7-lxd-5:~$ cat /etc/network/interfaces

auto lo eth1 eth2 eth0

iface lo inet loopback
  dns-nameservers 10.1.0.4
  dns-search maas virt.ceeness.com

iface eth0 inet static
  address 10.1.0.245/24
  gateway 10.1.0.1

iface eth1 inet6 static
  address fd4f:0:a:5:0:1:0:4/64
  gateway fd4f:0:a:5::1

iface eth2 inet static
  address 10.10.0.5/24

ubuntu@juju-5c1ec1-7-lxd-5:~$ logout
Connection to 10.1.0.245 closed.

ubuntu@juju-5c1ec1-7-lxd-5:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul t qlen 1
    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
2: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOW N group default qlen 1000
    link/ether ea:7c:59:0e:f8:6b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::e87c:59ff:fe0e:f86b/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::1/64 scope link
       valid_lft forever preferred_lft forever
13: eth0@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:f0:c9:be brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.1.0.245/24 brd 10.1.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fef0:c9be/64 scope link
       valid_lft forever preferred_lft forever
15: eth1@if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:55:f9:da brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fd4f:0:a:5:0:1:0:4/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fd4f:0:a:5:216:3eff:fe55:f9da/64 scope global mngtmpaddr dynamic
       valid_lft 3275sec preferred_lft 3275sec
    inet6 fe80::216:3eff:fe55:f9da/64 scope link
       valid_lft forever preferred_lft forever
17: eth2@if18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:8d:34:ea brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.10.0.5/24 brd 10.10.0.255 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 fd4f:0:a:a:216:3eff:fe8d:34ea/64 scope global mngtmpaddr dynamic
       valid_lft 3311sec preferred_lft 3311sec
    inet6 fe80::216:3eff:fe8d:34ea/64 scope link
       valid_lft forever preferred_lft forever
ubuntu@juju-5c1ec1-7-lxd-5:~$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul t qlen 1
    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
2: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOW N group default qlen 1000
    link/ether ea:7c:59:0e:f8:6b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::e87c:59ff:fe0e:f86b/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::1/64 scope link
       valid_lft forever preferred_lft forever
13: eth0@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:f0:c9:be brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.1.0.245/24 brd 10.1.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fef0:c9be/64 scope link
       valid_lft forever preferred_lft forever
15: eth1@if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:55:f9:da brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fd4f:0:a:5:0:1:0:4/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fd4f:0:a:5:216:3eff:fe55:f9da/64 scope global mngtmpaddr dynamic
       valid_lft 3265sec preferred_lft 3265sec
    inet6 fe80::216:3eff:fe55:f9da/64 scope link
       valid_lft forever preferred_lft forever
17: eth2@if18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:8d:34:ea brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.10.0.5/24 brd 10.10.0.255 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 fd4f:0:a:a:216:3eff:fe8d:34ea/64 scope global mngtmpaddr dynamic
       valid_lft 3302sec preferred_lft 3302sec
    inet6 fe80::216:3eff:fe8d:34ea/64 scope link
       valid_lft forever preferred_lft forever

Ian Booth (wallyworld)
Changed in juju:
assignee: nobody → Witold Krecicki (wpk)
milestone: none → 2.3.0
importance: Undecided → High
status: New → Triaged
Tim Penhey (thumper)
Changed in juju:
milestone: 2.3.0 → 2.3-rc1
Tim Penhey (thumper)
tags: added: dual-stack ipv6 space
Changed in juju:
assignee: Witold Krecicki (wpk) → nobody
milestone: 2.3-rc1 → none
importance: High → Medium
Revision history for this message
John A Meinel (jameinel) wrote :

I think this has to do with how we are modeling spaces and dual-stack support. My guess is that when defining the LXD container we ask MAAS for an IP address in the requested space, but the space only defines an IPv4 subnet, so that is all we assign the container.
Even if we were assigning multiple addresses, this needs more discussion because of interactions with charms. When a given application has access to 2 addresses, what address do we advertise for other applications to interact with it. Do we give all addresses, a different address, etc. Right now our address field is a single string, so we don't have a way to expose it as a list of addresses.

Revision history for this message
Doug Parrish (dparrish) wrote :

@jameinel - Just to confirm, in the example above two of the spaces have two subnets each. The LXD container was created specifying an IPv4-only space (mgmt), an IPv6-only space (stgfe), and an IPv4/IPv6 subnet (delvrya)

$ juju add-machine lxd:7 --constraints spaces=mgmt,stgfe,delvrya
created container 7/lxd/5

$ juju spaces
Space Subnets
delvrya 10.10.0.0/24
         fd4f:0:a:a::/64
delvryb 10.11.0.0/24
         fd4f:0:a:b::/64
mgmt 10.1.0.0/24
         192.168.122.0/24
stgbe fd4f:0:a:6::/64
stgfe fd4f:0:a:5::/64

I apologize for the interjection, but wanted to confirm after reading "... but the space only defines an IPv4 subnet ..." in your comment (#1).

tags: added: sts
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Medium → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.