Bug 1311655
Summary: | cloud-init under OpenNebula works only after reboot | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jan "Yenya" Kasprzak <kas> |
Component: | cloud-init | Assignee: | Garrett Holmstrom <gholms> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 23 | CC: | adimania, apevec, bert.regeer, gholms, Jan.van.Eldik, mattdm, shardy, s |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | cloud-init-0.7.8-2.fc25 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-10-18 11:29:48 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jan "Yenya" Kasprzak
2016-02-24 16:55:35 UTC
OK, the problem is that cloud-init-local.service has no dependency on the network service. The network service (/etc/init.d/network) is started in parallel with cloud-init-local.service, so it grabs whatever was in /etc/sysconfig/network-scripts/ifcfg-eth0 at the time the VM image has been created, sets up the eth0 interface according to it, and some time after it the cloud-init --local creates the proper ifcfg-eth0 file, which will then be used after the reboot. I think the correct solution would be to have an explicit dependency between cloud-init-local.service and network.service: --- /tmp/cloud-init-local.service 2016-03-16 22:39:41.570920600 +0100 +++ /usr/lib/systemd/system/cloud-init-local.service 2016-03-16 22:31:10.339623114 +0100 @@ -2,6 +2,7 @@ Description=Initial cloud-init job (pre-networking) Wants=local-fs.target After=local-fs.target +Before=network.service [Service] Type=oneshot Apparently upstream already has a similar fix: http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/systemd/cloud-init-local.service They seem to use Before=network-pre.target instead of Before=network.service. Please fix this in F23 - without this, F23 cloud images are unusable with cloud-init image contextualization. Thanks! Further testing reveals that Before=network-pre.target does not help for F23. Only Before=network.service provides the proper ordering. On CentOS 7 I had to use Before=NetworkManager.service because otherwise NetworkManager would start at the same time as cloud-init-local, and would start managing /etc/resolv.conf instead of using the entries from ConfigDrive in my case (since cloud-init writes those to /etc/resolv.conf directly rather than putting them in ifcg-* scripts where NM could pick them up) Since it looks like using OpenNebula with context.sh also directly modifies /etc/resolv.conf you'll also run into this issue: See: https://bugs.launchpad.net/cloud-init/+bug/1620845 and https://bugs.launchpad.net/cloud-init/+bug/1620807 cloud-init-0.7.8-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e96b704c39 cloud-init-0.7.8-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. |