Azure multiple ips prevent access to metadata service

Bug #1815254 reported by Ryan Harper
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Fix Released
Undecided
Chad Smith

Bug Description

On an instance with a single interface and many private address, the "primary" address, is not used for outgoing communication as the source_ipaddr in packets; this prevents communicating with the IMDS service.

Example metadata:

https://paste.ubuntu.com/p/2y2NBck6VJ/

Generated netplan yaml:

https://paste.ubuntu.com/p/Zn9tgYzTMb/

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cloud-init (Ubuntu):
status: New → Confirmed
Revision history for this message
Ryan Harper (raharper) wrote :

OK, this is easily reproduced by adding a single static IP in the same subnet as the IP that comes from dhcp'ing on the interface.

For example, if you launch an instance with a 10.0.0./24 subnet, the dhcp IP is something like 10.0.0.4

You can login and

curl -H Metadata:true "http://169.254.169.254/metadata/instance/network?api-version=2017-08-01"

is successful.

If you append:

addresses:
- 10.0.0.20/24

To /etc/netplan/50-cloud-init.yaml, like this:

network:
    ethernets:
        eth0:
            addresses:
            - 10.0.0.20/24
            dhcp4: true
            match:
                macaddress: 00:0d:3a:4e:c5:66
            set-name: eth0
    version: 2

And netplan apply;

then the static ip is 'primary' on the interface
and the dhcp ip is 'secondary' which results it
the wrong source ip when connecting to the metadata services.

Revision history for this message
Chad Smith (chad.smith) wrote :

filed a related bug against netplan for discussion about how best to express this type of configuration https://bugs.launchpad.net/netplan/+bug/1834956

Revision history for this message
Chad Smith (chad.smith) wrote :

This issue is resolved by the following WIP branch: https://code.launchpad.net/~ddstreet/ubuntu/+source/systemd/+git/systemd/+merge/370152

Expectation is that this branch will be included in a systemd SRU: LP:#1835581.

Revision history for this message
Joshua Powers (powersj) wrote :

A systemd SRU [1] has started with the branch referenced in comment 6 included in it. It would be good to verify this actually fixes this issue and reply on the SRU bug.

[1] https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1835581

Revision history for this message
Chad Smith (chad.smith) wrote :

I have verified that Bionic and Disco work with the aforementioned SRU (and have attached logs to https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1835581). Eoan SRU is not yet queued for SRU verification with a fix because an existing SRU is already in the pipeline there and needs to land first.

Changed in cloud-init (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Chad Smith (chad.smith) wrote :

This will require no work from cloud-init as it is a systemd related fix. Cloud-init just needs to be aware of when the existing systemd SRUs land in Bionic, Disco and Eoan

Revision history for this message
Chad Smith (chad.smith) wrote :

The systemd SRU has landed in Bionic and later.

This bug can be closed as fix released once cloud-init v.19.2.10 or later.

Changed in cloud-init (Ubuntu):
status: In Progress → Fix Committed
assignee: nobody → Chad Smith (chad.smith)
Revision history for this message
thinktwo (jan-ridabu) wrote :

From what understand the fix in systemd was release with 18.04.3, but i still seem to hit this with cloud-init 19.2-36-g059d049c-0ubuntu2~18.04.1 on 18.04.3. Are something still missing in cloud-init to resolve this?

Revision history for this message
Ryan Harper (raharper) wrote :

@thinktwo nothing missing, the fix is entirely in systemd. Please open a new bug and put in your steps so we can track down what's going wrong.

Revision history for this message
Chad Smith (chad.smith) wrote :

This bug is believed to be fix released in systemd 242-7ubuntu3.2 or later and cloud-init 19.2 or later. If it is still an issue, please re-open this bug.

Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
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.