cloud init fails on instance

14,390

Solution 1

In my case (new install using Ubuntu Juju) the problem was that neutron was misconfigured with the wrong ip address for the metadata server.

This is good: http://techbackground.blogspot.ie/2013/06/metadata-via-dhcp-namespace.html

That pointed me at:

root@neutron:/etc/neutron# cat metadata_agent.ini 
...
nova_metadata_ip = 192.168.100.151
nova_metadata_port = 8775
...

I fixed the nova_metadata_ip and restarted the neutron metadata service and that solved the issue.

Solution 2

You need to make sure your cluster controller is configured correctly so that the machine can actually access the region controller metadata server. You can do this with:

sudo dpkg-reconfigure maas-cluster-controller

And you need to input the IP address of the region controller in the form of:

http://<ip-address>/MAAS
Share:
14,390

Related videos on Youtube

Chirayu Patel
Author by

Chirayu Patel

Go Cloud!

Updated on September 18, 2022

Comments

  • Chirayu Patel
    Chirayu Patel over 1 year

    I setup Ubuntu Openstack using Autopilot Installer / MAAS. When I try booting the VM the cloud-init fails to get metadata. Here's the Instance log (partial)

    cloud-init-nonet[25.04]: static networking is now up
     * Starting configure network device[74G[ OK ]
    Cloud-init v. 0.7.5 running 'init' at Fri, 20 Mar 2015 16:43:33 +0000. Up 25.26 seconds.
    ci-info: ++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++
    ci-info: +--------+------+--------------+---------------+-------------------+
    ci-info: | Device |  Up  |   Address    |      Mask     |     Hw-Address    |
    ci-info: +--------+------+--------------+---------------+-------------------+
    ci-info: |   lo   | True |  127.0.0.1   |   255.0.0.0   |         .         |
    ci-info: |  eth0  | True | 192.168.1.21 | 255.255.255.0 | fa:16:3e:ab:ac:16 |
    ci-info: +--------+------+--------------+---------------+-------------------+
    ci-info: +++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++
    ci-info: +-------+-------------+---------+---------------+-----------+-------+
    ci-info: | Route | Destination | Gateway |    Genmask    | Interface | Flags |
    ci-info: +-------+-------------+---------+---------------+-----------+-------+
    ci-info: |   0   | 192.168.1.0 | 0.0.0.0 | 255.255.255.0 |    eth0   |   U   |
    ci-info: +-------+-------------+---------+---------------+-----------+-------+
    2015-03-20 16:43:33,409 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [0/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:34,422 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [1/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:35,431 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [2/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:36,435 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [3/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:37,440 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [4/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:38,444 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [5/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:40,449 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [7/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:42,455 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [9/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:44,460 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [11/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:46,466 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [13/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:48,472 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [15/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:51,484 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [18/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:54,491 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [21/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:43:57,503 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [24/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:00,520 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [27/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:03,541 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [30/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:07,556 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [34/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:11,569 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [38/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:15,580 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [42/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:19,594 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [46/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:23,607 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [50/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:28,622 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [55/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:33,641 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [60/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:38,670 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [65/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:43,690 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [70/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:48,710 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [75/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:44:54,726 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [81/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:00,741 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [87/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:06,757 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [93/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:12,770 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [99/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:18,790 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [105/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:25,805 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [112/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:32,830 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [119/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by : [Errno 101] Network is unreachable)]
    2015-03-20 16:45:39,843 - DataSourceEc2.py[CRITICAL]: Giving up on md from ['http://169.254.169.254/2009-04-04/meta-data/instance-id'] after 126 seconds
    2015-03-20 16:45:39,855 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [0/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:40,865 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [1/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:41,879 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [2/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:42,884 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [3/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:43,889 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [4/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:44,894 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [5/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:46,900 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [7/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:48,912 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [9/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:50,918 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [11/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:52,924 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [13/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:54,930 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [15/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:45:57,943 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [18/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:46:00,956 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [21/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    2015-03-20 16:46:03,970 - url_helper.py[WARNING]: Calling 'http://192.168.1.20//latest/meta-data/instance-id' failed [24/120s]: request error [HTTPConnectionPool(host='192.168.1.20', port=80): Max retries exceeded with url: //latest/meta-data/instance-id (Caused by : [Errno 111] Connection refused)]
    

    its also interesting to note that the IP went from 169.254.169.254 to 192.168.1.20 (192.x is the DHCP agent IP).

    Any ideas where I can start?

    • Chirayu Patel
      Chirayu Patel about 9 years
      Is this better Jason? -- pastebin.com/U9rt2k0b
    • zloster
      zloster about 9 years
      It seems like you have some network configuration problem with the VM. VM route table has only one configured route and no default gateway. It is for the 192.168.1.0/24 network. Later the .py script tries to access IP from other network (169.254.169.254). Without routes' configuration information VM networking does not know where to send the network packets.
    • Chirayu Patel
      Chirayu Patel about 9 years
      @zloster Networking was configured as a part of Auto Pilot.
    • zloster
      zloster about 9 years
      169.254/16 network is assigned for dynamically configured link-local addresses. They are only valid on a single network segment and are not to be routed. The network card/driver will self-assign such an address if there is no DHCP response. This question has some info. Also have you checked this question about MAAS/Canonica OpenStack Autopilot?
  • Shankar
    Shankar over 7 years
    In openstack me also faced same problem, I followed below steps, It got worked for me. Thanks @bladedoyle. Navigate to your controller node and gave the following command sudo netstat -lntp | grep 8775 Output: tcp 0 0 0.0.0.0:8775 0.0.0.0:* LISTEN 11166/python Navigate to this location -> "nano /etc/neutron/metadata_agent.ini" Update following values [DEFAULT] ... nova_metadata_ip = <Your Controller IP> Ex: nova_metadata_ip = 192.168.1.10 nova_metadata_port = 8775