← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~philroche/cloud-init/trunk into lp:cloud-init

 

Philip Roche has proposed merging lp:~philroche/cloud-init/trunk into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1581200 in cloud-init (Ubuntu): "Ubuntu cloud-init expects trailing dot on GCE metadata FQDN"
  https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1581200

For more details, see:
https://code.launchpad.net/~philroche/cloud-init/trunk/+merge/297158

Removes trailing dot in metadata.google.internal GCE metadata lookup.

A bug was reported (lp:1576861) where if there is no DNS server configured 
or it is not running then the metadata lookup on GCE will fail as it contains a 
trailing dot 'metadata.google.internal.'. As there is no DNS configured or 
running it will use the /etc/hosts file but the hosts file does not contain 
an entry with the trailing dot. 

One solution is to add an entry to the /etc/hosts file with the trailing dot 
but according to the manpage, /etc/hosts entries must end with an alphanumeric 
character and cannot end with a dot.

The trailing dot was added to avoid MIM by dns search but we should probably 
assume the instance being started has no DNS and as such when querying 
metadata should use a URL that will resolve using /etc/hosts. 

Fixes bugs:

lp:1576861 Ubuntu cloud-init should remove trailing dot on metadata FQDN
lp:1581200 Ubuntu cloud-init expects trailing dot on GCE metadata FQDN	
-- 
Your team cloud init development team is requested to review the proposed merge of lp:~philroche/cloud-init/trunk into lp:cloud-init.
=== modified file 'cloudinit/sources/DataSourceGCE.py'
--- cloudinit/sources/DataSourceGCE.py	2016-05-12 17:56:26 +0000
+++ cloudinit/sources/DataSourceGCE.py	2016-06-13 08:36:42 +0000
@@ -25,7 +25,7 @@
 LOG = logging.getLogger(__name__)
 
 BUILTIN_DS_CONFIG = {
-    'metadata_url': 'http://metadata.google.internal./computeMetadata/v1/'
+    'metadata_url': 'http://metadata.google.internal/computeMetadata/v1/'
 }
 REQUIRED_FIELDS = ('instance-id', 'availability-zone', 'local-hostname')
 


Follow ups