Bug 1428492

Summary: Cloud-init is starting before multi-user.target still
Product: [Fedora] Fedora Reporter: Bekzot Azimov <bekzot.asimov>
Component: cloud-initAssignee: Garrett Holmstrom <gholms>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 25CC: adimania, apevec, bekzot.asimov, gholms, Jan.van.Eldik, lars, shardy, sijis.aviles, s
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cloud-init-0.7.9-4.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-20 22:19:58 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 Bekzot Azimov 2017-03-02 16:52:24 UTC
Description of problem:
We have seen a bugfix for cloud-init that says start after multi-user.target but it still trying to launch before and causing different problems.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Launch aws fedora 25 image gp2 hvm
2. Run a command: sudo systemd-analyze critical-chain multi-user.target

Actual results:

multi-user.target @5.760s
└─getty.target @5.760s
  └─serial-getty @5.759s
    └─systemd-user-sessions.service @5.545s +20ms
      └─cloud-init.service @2.592s +2.947s
        └─cloud-init-local.service @441ms +2.148s
          └─local-fs.target @431ms
            └─local-fs-pre.target @431ms
              └─systemd-tmpfiles-setup-dev.service @384ms +46ms
                └─kmod-static-nodes.service @341ms +35ms
                  └─systemd-journald.socket
                    └─-.mount
                      └─system.slice
                        └─-.slice

Expected results:
cloud-init.service nor cloud-init-local.service should be there.

Additional info:
AMI starts up fine, but causing collision issues later when we deploy new things.

Comment 1 Bekzot Azimov 2017-03-02 18:59:24 UTC
Mar  1 21:34:34 ip-173-20-78-118 systemd: multi-user.target: Found dependency on cloud-init.target/start
Mar  1 21:34:34 ip-173-20-78-118 systemd: multi-user.target: Found dependency on cloud-final.service/start
Mar  1 21:34:34 ip-173-20-78-118 systemd: multi-user.target: Found dependency on multi-user.target/start
Mar  1 21:34:34 ip-173-20-78-118 systemd: multi-user.target: Breaking ordering cycle by deleting job cloud-init.target/start
Mar  1 21:34:34 ip-172-20-78-118 systemd: cloud-init.target: Job cloud-init.target/start deleted to break ordering cycle starting with multi-user.target/start

Comment 2 Bekzot Azimov 2017-03-02 20:07:09 UTC
cloud-init version: cloud-init-0.7.8-5.fc25.noarch

Comment 3 Bekzot Azimov 2017-03-02 20:31:58 UTC
This happens on ami-56a08841 us-east-1 image of fedora 25. Image comes up fine, but whenever I deploy some new services it hangs, and I can see above ordering cycle issue in the /var/log/messages.

Comment 4 Bekzot Azimov 2017-03-13 19:03:20 UTC
I think we found the issue. We required cloud-final.service on our services which tries to start cloud-final.service. Cloud-final has a flag to start after multi-user.target, which causes collision.

Comment 5 Bekzot Azimov 2017-03-13 19:03:37 UTC
I think we found the issue. We required cloud-final.service on our services which tries to start cloud-final.service. Cloud-final has a flag to start after multi-user.target, which causes collision.

Comment 6 Bekzot Azimov 2017-03-13 19:46:40 UTC
Now whoever requires cloud-init in their service will face this issue. Is this how we want it? Or should there be a patch?

Comment 7 Lars Kellogg-Stedman 2017-03-14 15:16:49 UTC
There is a scratch build available at https://koji.fedoraproject.org/koji/taskinfo?taskID=18380550 that may resolve this problem.  Please give it a try and let me know if it resolves this issue.

Comment 8 Fedora Update System 2017-03-14 23:35:26 UTC
cloud-init-0.7.9-4.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-83671c0fa0

Comment 9 Bekzot Azimov 2017-03-15 02:07:54 UTC
Thank you Lars Kellogg-Stedman. This is exactly what is happening when I do not require cloud-init in my services 1400249. Incorrect networking.service looks like being addressed with patch to cloud-init-0.7.8-6.fc25. We will just wait for this package then.

Comment 10 Bekzot Azimov 2017-03-15 02:16:04 UTC
1400249 will resolve it. I will close my report.

*** This bug has been marked as a duplicate of bug 1400249 ***

Comment 11 Fedora Update System 2017-03-15 04:24:54 UTC
cloud-init-0.7.9-4.fc26 has been pushed to the Fedora 26 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-2017-83671c0fa0

Comment 12 Fedora Update System 2017-03-20 22:19:58 UTC
cloud-init-0.7.9-4.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.