canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.99k stars 882 forks source link

eni rendering of ipv6 gateways fails #2934

Closed ubuntu-server-builder closed 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1701097

Launchpad details
affected_projects = ['cloud-init (Ubuntu)', 'cloud-init (Ubuntu Xenial)', 'cloud-init (Ubuntu Zesty)', 'cloud-init (Ubuntu Artful)']
assignee = raharper
assignee_name = Ryan Harper
date_closed = 2017-09-23T02:34:13.706251+00:00
date_created = 2017-06-28T22:08:37.030532+00:00
date_fix_committed = 2017-07-21T13:41:15.816452+00:00
date_fix_released = 2017-09-23T02:34:13.706251+00:00
id = 1701097
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1701097
milestone = None
owner = raharper
owner_name = Ryan Harper
private = False
status = fix_released
submitter = raharper
submitter_name = Ryan Harper
tags = ['patch', 'verification-done-xenial', 'verification-done-zesty']
duplicates = []

Launchpad user Ryan Harper(raharper) wrote on 2017-06-28T22:08:37.030532+00:00

=== Begin SRU Template === [Impact] Network configuration provided to cloud-init that has an ipv6 address and additional manual default route will fail to bring up the routes correctly.

[Test Case] The basic idea below is: a.) launch an instance with proposed version of cloud-init. b.) inside instance, get cloud-init's network rendering tool from trunk c.) run the rendering tool against a config that failed before. d.) check rendered ENI config to verify it looks correct.

launch an instance.

$ release=xenial $ ref=$release-proposed $ lxc-proposed-snapshot --proposed --publish $release $ref $ lxc launch $ref $name $ lxc exec $ref $name /bin/bash

get render tool

% wget https://git.launchpad.net/~cloud-init-dev/cloud-init/plain/tools/net-convert.py -O net-convert.py

% cat > net-config.yaml <<"EOF" version: 1 config:

$ python3 ./net-convert.py \ --network-data=net-config.yaml --kind=yaml \ --output-kind=eni \ --mac=eth0,c0:d6:9f:2c:e8:80 \ --directory=out.d

% cat out.d/etc/network/interfaces auto lo iface lo inet loopback

auto eth0 iface eth0 inet6 static address 2001:1::2/64 post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true pre-down route del -A inet6 default gw 2001:4800:78ff:1b::1 || true

The output above is the expected output. The failure path

would have post-up and pre-down like:

post-up route add -net :: netmask :: gw 2001:4800:78ff:1b::1 || true
pre-down route del -net :: netmask :: gw 2001:4800:78ff:1b::1 || true

[Regression Potential] Regressions for this change are almost certainly limited to rendering of ipv6 networking configuration and most likely limited to routing.

[Other Info] Upstream commit at https://git.launchpad.net/cloud-init/commit/?id=811ce49d74af

=== End SRU Template ===

cloud-init trunk and xenial, yakkety, zesty and artful all fail

A network config with a ipv6 gateway route like:

subnets:   - type: static     address: 2001:4800:78ff:1b:be76:4eff:fe06:96b3     netmask: 'ffff:ffff:ffff:ffff::'     routes:       - gateway: 2001:4800:78ff:1b::1         netmask: '::'         network: '::'

For eni rendering, this should create a post-up/post-down route command that generates a default ipv6 route entry, like this:

    post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true     pre-down route del -A inet6 default gw 2001:4800:78ff:1b::1 || true

However, what is currently generated is this:

    post-up route add -net :: netmask :: gw 2001:4800:78ff:1b::1 || true     pre-down route del -net :: netmask :: gw 2001:4800:78ff:1b::1 || true

That does not install the route correctly as a default gateway route.

This is fallout from commit d00da2d5b0d45db5670622a66d833d2abb907388 net: normalize data in network_state object

This commit removed ipv6 route 'netmask' values, and converted them to prefix length values, but failed to update the eni renderer's check for ipv6 default gateway.

ubuntu-server-builder commented 1 year ago

Launchpad user Ryan Harper(raharper) wrote on 2017-06-28T22:09:20.152793+00:00

Launchpad attachments: eni-fix-ipv6-route-gateway.patch3

ubuntu-server-builder commented 1 year ago

Launchpad user Ubuntu Foundations Team Bug Bot(crichton) wrote on 2017-07-19T20:21:10.579428+00:00

The attachment "eni-fix-ipv6-route-gateway.patch3" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-07-21T02:51:41.234750+00:00

This bug was fixed in the package cloud-init - 0.7.9-221-g7e41b2a7-0ubuntu1


cloud-init (0.7.9-221-g7e41b2a7-0ubuntu1) artful; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Chris J Arges(arges) wrote on 2017-08-23T12:28:39.501263+00:00

Hello Ryan, or anyone else affected,

Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-233-ge586fe35-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

ubuntu-server-builder commented 1 year ago

Launchpad user Chris J Arges(arges) wrote on 2017-08-23T12:31:49.897069+00:00

Hello Ryan, or anyone else affected,

Accepted cloud-init into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.9-233-ge586fe35-0ubuntu1~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

ubuntu-server-builder commented 1 year ago

Launchpad user Chad Smith(chad.smith) wrote on 2017-08-28T21:21:37.118654+00:00

inet6 address types properly rendered on both xenial and zesty

cat > net-config.yaml <<"EOF"

version: 1 config:

  • type: physical name: eth0 mac_address: "c0:d6:9f:2c:e8:80" subnets:
    • type: static address: "2001:1::2/64" routes:
      • gateway: "2001:4800:78ff:1b::1" netmask: "::" network: "::" EOF

for release in xenial zesty; do

    echo "$release START --------------";
    lxc exec test-$release -- grep CODENAME /etc/lsb-release;
    lxc exec test-$release -- dpkg-query --show cloud-init;
    lxc file push net-convert.py test-$release/net-convert.py;
    lxc file push net-config.yaml test-$release/net-config.yaml;
    lxc exec test-$release -- python3 /net-convert.py \
        --network-data=/net-config.yaml --kind=yaml --output-kind=eni \
        --mac=eth0,c0:d6:9f:2c:e8:80 --directory=out.d;
    lxc exec test-$release -- cat  out.d/etc/network/interfaces;
    echo "$release FINISH --------------";

done xenial START -------------- DISTRIB_CODENAME=xenial cloud-init 0.7.9-233-ge586fe35-0ubuntu1~16.04.1 Input YAML config:

  • mac_address: c0:d6:9f:2c:e8:80 name: eth0 subnets:
  • address: 2001:1::2/64 routes:
  • gateway: 2001:4800:78ff:1b::1 netmask: '::' network: '::' type: static type: physical version: 1

Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: eth0: address: null gateway: null inet: inet mac_address: c0:d6:9f:2c:e8:80 mode: manual mtu: null name: eth0 subnets:

auto lo iface lo inet loopback

auto eth0 iface eth0 inet6 static address 2001:1::2/64 post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true pre-down route del -A inet6 default gw 2001:4800:78ff:1b::1 || true xenial FINISH -------------- zesty START -------------- DISTRIB_CODENAME=zesty cloud-init 0.7.9-233-ge586fe35-0ubuntu1~17.04.1 Input YAML config:

Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: eth0: address: null gateway: null inet: inet mac_address: c0:d6:9f:2c:e8:80 mode: manual mtu: null name: eth0 subnets:

auto lo iface lo inet loopback

auto eth0 iface eth0 inet6 static address 2001:1::2/64 post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true pre-down route del -A inet6 default gw 2001:4800:78ff:1b::1 || true zesty FINISH --------------

ubuntu-server-builder commented 1 year ago

Launchpad user David Britton(dpb) wrote on 2017-09-01T05:21:35.494258+00:00

Set back to verification needed while we look at one more case.

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-09-13T01:26:05.837714+00:00

This bug was fixed in the package cloud-init - 0.7.9-233-ge586fe35-0ubuntu1~16.04.1


cloud-init (0.7.9-233-ge586fe35-0ubuntu1~16.04.1) xenial-proposed; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Chris Halse Rogers(raof) wrote on 2017-09-13T01:26:52.158266+00:00

The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-09-13T01:27:27.937540+00:00

This bug was fixed in the package cloud-init - 0.7.9-233-ge586fe35-0ubuntu1~17.04.1


cloud-init (0.7.9-233-ge586fe35-0ubuntu1~17.04.1) zesty; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-09-23T02:34:16.110555+00:00

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.