canonical / cloud-init

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

Configure networking based on EC2 metadata source #2753

Closed ubuntu-server-builder closed 1 year ago

ubuntu-server-builder commented 1 year ago

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

Launchpad details
affected_projects = ['cloud-init (Ubuntu)']
assignee = None
assignee_name = None
date_closed = 2017-09-23T02:14:24.414856+00:00
date_created = 2016-11-03T20:02:56.113269+00:00
date_fix_committed = 2017-09-23T02:14:24.414856+00:00
date_fix_released = 2017-09-23T02:14:24.414856+00:00
id = 1639030
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1639030
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = rcj
submitter_name = Robert C Jennings
tags = []
duplicates = []

Launchpad user Robert C Jennings(rcj) wrote on 2016-11-03T20:02:56.113269+00:00

EC2 metadata[1] presents information regarding network devices (mac, name, etc) that would be useful to consume. Chiefly we could match the network device names surfaced in the EC2 UIs (eth0, eth2...) rather than using our own enumeration at boot.

A method to detemermine if we are on an instance in EC2 as been published[2] as part of their documentation so we can now do this in the EC2 datasource without impacting clouds that have copied that datasource.

The work done for DO datasource[3] would be applicable here as a model.

[1] http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html [2] http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/identify_ec2_instances.html [3] https://git.launchpad.net/cloud-init/commit/?id=9f83bb8e80806d3dd79ba426474dc3c696e19a41

ubuntu-server-builder commented 1 year ago

Launchpad user Ben Howard(darkmuggle-deactivatedaccount) wrote on 2016-11-03T20:39:54.841603+00:00

Please be aware of Bug #1637252. On sysconfig based-systems, cloud-init blows up during boot. This is also known as https://bugzilla.redhat.com/show_bug.cgi?id=1389530

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-07-10T18:46:38.038023+00:00

We had some discussion on this bug today in #cloud-init. https://irclogs.ubuntu.com/2017/07/10/%23cloud-init.html

It seems that in order to interact with the metadata service, we need to configure the instances ip address as a dhcp request would give us. The service will drop packets if the source address is not "right", and right does not include ipv4 link local scope.

So there is really no way to talk to the metadata service unless you do a dhcp.

This little script run in a Ubuntu 16.04 image shows what we were trying to do and shows a way that it seems to work: http://paste.ubuntu.com/25062706/ results of: addr: http://paste.ubuntu.com/25062713/ link-local: http://paste.ubuntu.com/25062728/

So that gives us 2 basic options a.) use dhclient (or appropriate distro-provided dhcp client) This probably can be made to work, but we ultimately would have to work with different clients on different distros or image configurations and also have to deal with "side affects" of having done dhclient. Ie, dhclient calls hook scripts on up and down. That may not be a problem, but it definitely could be.

b.) use a "built in" dhcp client. http://code.activestate.com/recipes/577649-dhcp-query/

ubuntu-server-builder commented 1 year ago

Launchpad user Mark Thomas(markthomas) wrote on 2017-08-29T21:26:11.838686+00:00

Proposed for Zesty and Xenial so that you can discuss the path to a Xenial SRU for IPv6 support.

ubuntu-server-builder commented 1 year ago

Launchpad user Launchpad Janitor(janitor) wrote on 2017-08-31T02:23:02.630841+00:00

This bug was fixed in the package cloud-init - 0.7.9-259-g7e76c57b-0ubuntu1


cloud-init (0.7.9-259-g7e76c57b-0ubuntu1) artful; urgency=medium

ubuntu-server-builder commented 1 year ago

Launchpad user Scott Moser(smoser) wrote on 2017-09-23T02:14:26.317843+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.