andsens / bootstrap-vz

Bootstrap Debian images for virtualized environments
http://bootstrap-vz.readthedocs.io/
Other
263 stars 145 forks source link

Add cloud-init for gce images #469

Closed vitaminmoo closed 6 years ago

vitaminmoo commented 6 years ago

There doesn't appear to be an easily locatable documented reason that the GCE official Debian images don't install and configure cloud-init. This causes the GCE documentation on the user-data metadata to not be accurate.

This change makes the GCE images function with #cloud-config format user-data.

The negative impact of this is that cloud-init will make a few changes on first boot, even if the user did not specify user-data metadata. This appears to be standard and ok in the ec2 and oracle manifests, though. The official GCE Ubuntu images also appear to create an ubuntu user on first boot, so it seems like there's parity.

The cloud_init plugin options are burgled from the most common form in the ec2 and oracle manifests, which is effectively no config other than setting a username.

I've set the username to what the default is in the Debian cloud-init package to avoid making arbitrary decisions that don't matter. If I could disable the default user section as it is in the COS cloud.cfg, I'd prefer that, but as is the cloud_init plugin is not particularly flexible, and rewriting it to be seems like overkill.

andsens commented 6 years ago

@zmarano, any comments?

zmarano commented 6 years ago

Please do not add cloud-init to the official GCE Debian manifests. It conflicts with our own software and is not the expected behavior at this point for GCE default Debian images. You are more than welcome to add cloud-init to your own instance or images but behaviors will be duplicated and your mileage may vary. If you are interested in more details about why we do not, this was captured in the notes from the cloud-init summit from 2017.

andsens commented 6 years ago

Alright, closing.

vitaminmoo commented 6 years ago

@zmarano - Can you confirm or destroy my understanding for the record?

zmarano commented 6 years ago

@vitaminmoo

The GCE Linux guest software we employ does a handful of the same things cloud-init does but also a whole lot more that cloud-init cannot do (primarily instance life cycle operations based on metadata).

I don't want to rehash the cloud-init summit here. However the basic reasons we don't depend on cloud-init for GCE are: