Ask Your Question

Revision history [back]

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.[CRITICAL]: Giving up on waiting for the metadata from [''] 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 ]

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

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

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-image source code and found the issue was fixed 3 weeks ago. And the fixed version (1.25) is currently available in Debian Unstable/Sid and Debian Testing/Buster.