cloud-init-local.service should add Before=NetworkManager
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 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:/
If NetworkManager is started after cloud-init-local, then NetworkManager will correctly see that /etc/resolv.conf is not to be touched by it.
Changed in cloud-init: | |
importance: | Undecided → Medium |
status: | New → Fix Committed |
Adjustment @ https:/ /code.launchpad .net/~harlowja/ cloud-init/ +git/cloud- init/+merge/ 306283