cloud-init should support setting apply_network_config through Azure instance metadata
This bug was originally filed in Launchpad as LP: #1889112
Launchpad details
affected_projects = [] assignee = None assignee_name = None date_closed = None date_created = 2020-07-27T17:49:49.392976+00:00 date_fix_committed = None date_fix_released = None id = 1889112 importance = undecided is_complete = False lp_url = https://bugs.launchpad.net/cloud-init/+bug/1889112 milestone = None owner = johnsonshi owner_name = Johnson Shi private = False status = triaged submitter = johnsonshi submitter_name = Johnson Shi tags = [] duplicates = []
Launchpad user Johnson Shi(johnsonshi) wrote on 2020-07-27T17:49:49.392976+00:00
cloud-init currently only supports reading and setting the Azure apply_network_config option from disk (see https://cloudinit.readthedocs.io/en/latest/topics/datasources/azure.html#configuration).
This means that for customers using images that have "Azure apply_network_config" set to true on disk, there is no way for customers to opt out of this behavior during VM deployment. This is because the sole location that cloud-init reads for the "Azure apply_network_config" option is from the disk.
For customers that want to opt out of this behavior, the mitigation for customers would be to (1) deploy the VM, (2) ssh into the VM, (3) set the "Azure apply_network_config" option to false on disk, (4) then reboot the VM in order for the changes to take effect and prevent cloud-init from applying network config on subsequent boots.
Since there is no way to opt out of this behavior on first boot, a good feature request would be for cloud-init to support reading the "Azure apply_network_config" option through cloud-configs passed in through Azure instance metadata.