cloud-init-local.service should add Before=NetworkManager

Bug #1620845 reported by Bert JW Regeer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned

Bug Description

When using systemd on CentOS 7/RHEL 7 with cloud-init configured to use ConfigDrive on OpenStack, cloud-init-local needs to have a line added to it's unit file that makes sure it gets to finish before NetworkManager is started.

Before=NetworkManager.service

NetworkManager wants target network.target, currently that means it runs at the same time as cloud-init-local, which means it will start DHCP and write /etc/resolv.conf while cloud-init-local is parsing the ConfigDrive and is writing the appropriate ifcfg-* files.

This causes a race condition with who gets to modify /etc/resolv.conf. NetworkManager does not take kindly to that race.

When NetworkManager notices the new ifcfg-* files it will turn off DHCP and mark the interfaces "unmanaged", however it doesn't notice the change made to /etc/resolv.conf.

Related to the changes made here:

https://code.launchpad.net/~bregeer-ctl/cloud-init/+git/cloud-init/+merge/305058

If NetworkManager is started after cloud-init-local, then NetworkManager will correctly see that /etc/resolv.conf is not to be touched by it.

Tags: rhel centos
Revision history for this message
Joshua Harlow (harlowja) wrote :
Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

this is believed fixed in 17.1 for sure. possibly 0.7.9.

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.