In my experience in 2008-2009, just because networking is up on an EC2 instance does not mean that 169.254.169.254 is going to accept connections and requests for meta-data and user-data. You need to wait for this to become available. I had code to do this in Ubuntu AMIs I built back then.
perl -MIO::Socket::INET -e 'until(new IO::Socket::INET("169.254.169.254:80")){sleep 1}' I used to think I was waiting for networking to come up, but it became clear that the meta-data service was not listening even some times when networking was working and I had a local IP address on the instance. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/745930 Title: cloud-init timeout waiting for metadata service on EC2 -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs