DataSourceAzure doesn't rebuild network-config after reboot

Bug #1823084 reported by Jason Zions
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

After merge 365065 (commit 0dc3a77f4), when an Azure VM (previously provisioned via cloud-init) is rebooted, DataSourceAzure fails to recreate a NetworkConfig, with multiple exceptions raised and caught.

When the ds is restored from obj.pkl in the instance directory, self._network_config is reloaded as the string "_unset" rather than as a dictionary. Comments in the datasource indicate this was a deliberate decision; the intent was to force the datasource to rebuild the network configuration at each boot based on information fetched from the Azure control plane. The self._network_config dict is overwritten very quickly after it is generated and used; the net result is that the "_unset" string is deliberately saved as obj['ds']['network_config']

Related branches

Revision history for this message
Jason Zions (jasonzio) wrote :
Revision history for this message
Ryan Harper (raharper) wrote :

2019-04-03 21:17:42,117 -[INFO]: Applying network configuration from ds bringup=False: _unset
2019-04-03 21:17:42,118 -[DEBUG]: Selected renderer 'sysconfig' from priority list: None
2019-04-03 21:17:42,118 -[WARNING]: failed stage init-local
2019-04-03 21:17:42,118 -[DEBUG]: failed stage init-local
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/", line 652, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python2.7/site-packages/cloudinit/cmd/", line 362, in main_init
    init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
  File "/usr/lib/python2.7/site-packages/cloudinit/", line 671, in apply_network_config
    return self.distro.apply_network_config(netcfg, bring_up=bring_up)
  File "/usr/lib/python2.7/site-packages/cloudinit/distros/", line 178, in apply_network_config
    dev_names = self._write_network_config(netconfig)
  File "/usr/lib/python2.7/site-packages/cloudinit/distros/", line 65, in _write_network_config
    return self._supported_write_network_config(netconfig)
  File "/usr/lib/python2.7/site-packages/cloudinit/distros/", line 93, in _supported_write_network_config
  File "/usr/lib/python2.7/site-packages/cloudinit/net/", line 55, in render_network_config
  File "/usr/lib/python2.7/site-packages/cloudinit/net/", line 63, in parse_net_config_data
    version = net_config.get('version')
AttributeError: 'str' object has no attribute 'get'

Changed in cloud-init:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit 52836682 to cloud-init on branch master.
To view that commit see the following URL:

Changed in cloud-init:
status: Confirmed → Fix Committed
Revision history for this message
Chad Smith (chad.smith) wrote : Fixed in cloud-init version 19.1.

This bug is believed to be fixed in cloud-init in version 19.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.