cloud-init doesn't cache network_config property in cache
Bug #1716773 reported by
Ryan Harper
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
When init net stage runs, it will restore the cloud object cache in /var/lib/
This cache dump is created before cloud-init processes the datasource, which means some of the data cloud-init has fetched is not cached.
In particular, we've observed that the 'network_config' attribute is populated and set in init-local mode, but when we run init-net; it will re-run due to the underlying object value still be set to None (the default) as we failed to cache the object after modifying it.
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
To post a comment you must log in.
An explanation of what happened here: cur_instance) did a '_write_to_cache'. At this poing .network_config had never been called, so the DataSourceAzure did not have the ._network_config property set and thus not stored. network_ config( ). This ends up calling 'network_config' on the datasource, which sets the ._network_config. DSMODE_ LOCAL'
a.) in local mode we did 'instancify()' which (through _reflect_
b.) main called init.apply_
c.) stages exits because 'if mode == sources.
nothing writes to cache again, so the '._network_ config( )' never got set.
The easiest solution is to just throw another '._write_to_cache' in before exiting there.