Ubuntu 18.04 wrong parsing of instance-data.json generating network config

Bug #2008772 reported by Vadim Gobja
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Invalid
Undecided
Unassigned

Bug Description

Hello,

We have an cloud service based on Openstack, we have provide IPv4 (dhcp) and IPv6 (static),
on ubuntu 18.04 we detected that when is parsed instance-data.json it take info only for IPv4 and not get static records for IPv6. And related to this it not generate config for IPv6 we tested with netplan and ENI (ifupdown), all data in instance-data.json are present in the file.

2023-02-28 09:21:42,649 - util.py[DEBUG]: Reading from /sys/class/net/ens3/type (quiet=False)
2023-02-28 09:21:42,650 - util.py[DEBUG]: Read 2 bytes from /sys/class/net/ens3/type
2023-02-28 09:21:42,650 - networking.py[DEBUG]: net: all expected physical devices present
2023-02-28 09:21:42,650 - stages.py[DEBUG]: applying net config names for {'ethernets': {'ens3': {'dhcp4': True, 'set-name': 'ens3', 'match': {'macaddress': 'fa:16:3e:00:3c:33'}}}, 'version': 2}
2023-02-28 09:21:42,650 - util.py[DEBUG]: Reading from /sys/class/net/ens3/device/device (quiet=False)
2023-02-28 09:21:42,650 - util.py[DEBUG]: Read 7 bytes from /sys/class/net/ens3/device/device

On ubuntu 20.04 this problem not persist.
2023-02-27 14:36:40,755 - util.py[DEBUG]: Reading from /sys/class/net/lo/type (quiet=False)
2023-02-27 14:36:40,755 - util.py[DEBUG]: Read 4 bytes from /sys/class/net/lo/type
2023-02-27 14:36:40,755 - networking.py[DEBUG]: net: all expected physical devices present
2023-02-27 14:36:40,755 - stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'type': 'physical', 'mtu': 1500, 'accept-ra': False, 'subnets': [{'type': 'dhcp4'}, {'type': 'static6', 'netmask': 'ffff:ffff:ffff:ffff::', 'routes': [{'network': '::', 'netmask': '::', 'gateway': '2a10:c941:12:1::1'}], 'address': '2a10:c941:12:1::10f', 'ipv6': True}], 'mac_address': 'fa:16:3e:f3:d9:ad', 'name': 'ens3'}, {'type': 'nameserver', 'address': '8.8.8.8'}, {'type': 'nameserver', 'address': '1.1.1.1'}]}
2023-02-27 14:36:40,756 - util.py[DEBUG]: Reading from /sys/class/net/ens3/device/device (quiet=False)
2023-02-27 14:36:40,756 - util.py[DEBUG]: Read 7 bytes from /sys/class/net/ens3/device/device

cloud-init version: 22.4.2-0ubuntu0~18.04.1

we tried and older version but it work same

Revision history for this message
Vadim Gobja (vgobja) wrote :
Revision history for this message
Vadim Gobja (vgobja) wrote :
Revision history for this message
Vadim Gobja (vgobja) wrote :

Attached and the collected logs from Ubuntu 18.04 and 20.04.

Vadim Gobja (vgobja)
summary: - Ubuntu 18.04 wrong parsing of instance-data.json generating config
+ Ubuntu 18.04 wrong parsing of instance-data.json generating network
+ config
Revision history for this message
James Falcon (falcojr) wrote :

This is expected behavior. On Ubuntu 18.04, on Openstack, the network was configured using the fallback network interface only. In Ubuntu 20.04, it was updated to use network_data.json. Since changing this behavior would have resulted in backwards incompatibly, it is not default behavior on 18.04.

To enable this behavior on 18.04, you can add the following to /etc/cloud/cloud.cfg or a file in /etc/cloud/cloud.cfg.d/

datasource:
  OpenStack:
    apply_network_config: true

Since this is expected behavior, I'm going to set this bug status to Invalid, but if I have missed something, please do set it back to New and add more context.

See the following links for context:
https://bugs.launchpad.net/cloud-init/+bug/1749717
https://github.com/canonical/cloud-init/commit/cd1de5f47ab6b82f2c6fd61a5f6681f33b3e5705
https://github.com/canonical/cloud-init/blob/ubuntu/bionic/debian/patches/openstack-no-network-config.patch/

Changed in cloud-init:
status: New → Invalid
Revision history for this message
Vadim Gobja (vgobja) wrote :

Thank for reply, missed this in documentation.

Revision history for this message
James Falcon (falcojr) wrote :
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.