cloud-init fails to contact ec2 metadata service on boot

Asked by Patrick Vinas on 2013-08-01

Running ec2 metadata service in Openstack on Ubuntu 12.04. cloud-init can't contact the metadata service at boot time with the following error:
util.py[WARNING]: 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [51/120s]: url error [timed out]

However, after boot, I can log into the instance and GET the meta-data with curl using the same url.

Does anyone have any suggestions?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cloud-init Edit question
Assignee:
No assignee Edit question
Solved by:
Patrick Vinas
Solved:
Last query:
Last reply:

how about adding the command in /etc/rc.local above the 'exit 0' line.

Patrick Vinas (patrickvinas) said : #2

Hrm. Actually, it would seem that my previous statement was wrong.

On a newly booted instance, curl http://169.254.169.254 times out. However, if I first do "curl 192.168.3.11:8775" (the IP where nova-api is running) - which outputs, as expected:
1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04
latest

then I can do "curl http://169.254.169.254/latest/meta-data" with no problems - until the next reboot. So I guess this isn't a cloud-init problem, but a routing (maybe?) problem.