Ask Your Question
0

debian 9 cannot access metatadata server

asked 2017-10-27 08:06:28 -0500

lperrin gravatar image

updated 2017-10-27 08:08:42 -0500

Hi,

We are using a debian 9 cloud image from the official debian images (https://cdimage.debian.org/cdimage/op...) on a Mirantis Openstack (Mitaka).

In the cloud init log, we got an error that the server cannot access metadata server:
2017-10-27 12:09:55,580 - url_helper.py[WARNING]: Calling 'http://192.168.111.6/latest/meta-data/instance-id' failed [0/120s]: request error [HTTPConnectionPool(host='192.168.111.6', port=80): Max retries exceeded with url: /latest/meta-data/instance-id (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f9ed17f60f0>: Failed to establish a new connection: [Errno 111] Connection refused',))]
2017-10-27 12:09:56,587 - url_helper.py[WARNING]: Calling 'http://192.168.111.6/latest/meta-data/instance-id' failed [1/120s]: request error [HTTPConnectionPool(host='192.168.111.6', port=80): Max retries exceeded with url: /latest/meta-data/instance-id (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f9ed17f69b0>: Failed to establish a new connection: [Errno 111] Connection refused',))]

The VM is not using the usual 169.254.169.254 address but the IP from the DHCP server. The VM is correctly getting an IP address and SSH keys.

With other images (Debian 8, Ubuntu,..), we don't have this kind of error.

Does anyone has got this error with debian 9 ?

edit retag flag offensive close merge delete

Comments

We have the same problem.

pgomersbach gravatar imagepgomersbach ( 2018-02-27 08:40:49 -0500 )edit

hello, do you know what this IP 192.168.111.6 is..

TijoV gravatar imageTijoV ( 2018-03-21 06:15:24 -0500 )edit

Do other instances (from different image, same project) contact the correct metadata address? Can you paste your neutron values for

./metadata_agent.ini:nova_metadata_ip = IP_CONTROL
./metadata_agent.ini:nova_metadata_port = 8775
./l3_agent.ini:metadata_port = 9697
eblock gravatar imageeblock ( 2018-03-23 05:31:22 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-03-21 05:32:04 -0500

Regardless of those error messages, the correct OpenStack metadata should be found by cloud-init afterwards.

We have also faced the same issue and the last error message revealed it was caused by CloudStack DataSource being enabled in cloud-init configuration.

DataSourceCloudStack.py[CRITICAL]: Giving up on waiting for the metadata from ['http://172.16.0.11//latest/meta-data/instance-id'] after 120 seconds

As we only need to support OpenStack, all other data source providers are not necessary in cloud-init configuration. The solution was to fix the image and override the cloud-init data source settings found in /etc/cloud/cloud.cfg.d/90_dpkg.cfg:

# to update this file, run dpkg-reconfigure cloud-init
datasource_list: [ NoCloud, AltCloud, CloudStack, ConfigDrive, OpenStack, Ec2, MAAS, OVF, GCE, None ]

We were already building our own custom images with build-openstack-debian-image, so a little extra configuration file was created like this from the hook-script:

# Override cloud-init data source settings.
cat >"$BODI_CHROOT_PATH/etc/cloud/cloud.cfg.d/99_openstack.cfg" <<END
# Overriding /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# We only need OpenStack
datasource_list: [ OpenStack ]
END

And the image is built like this (as root):

build-openstack-debian-image --release stretch --hook-script ./hook-script.sh

In our case the same issue happened also with Debian 8, but the error messages were not shown on the console. And the same fix was successfully applied to create Debian 8 images.


Update: After writing the above, I went checking the latest version of build-openstack-debian-imagesource code and found the issue was fixed 3 weeks ago. https://salsa.debian.org/openstack-team/debian/openstack-debian-images/commit/ce65da029feb037951b30c692358fde8f830b436 (https://salsa.debian.org/openstack-te...) And the fixed version (1.25) is currently available in Debian Unstable/Sid and Debian Testing/Buster. https://tracker.debian.org/news/934886/accepted-openstack-debian-images-125-source-amd64-into-unstable/ (https://tracker.debian.org/news/93488...)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

4 followers

Stats

Asked: 2017-10-27 08:06:28 -0500

Seen: 434 times

Last updated: Mar 21 '18