Bug 1112817

Summary: sshd can start before cloud-init can finish
Product: [Fedora] Fedora Reporter: Jordan Evans <jordane>
Component: cloud-initAssignee: Garrett Holmstrom <gholms>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 20CC: apevec, gholms, Jan.van.Eldik, lance, mattdm, p, shardy, s
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cloud-init-0.7.6-3.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-12 17:49:49 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 Jordan Evans 2014-06-24 18:08:19 UTC
Description of problem:

When using automated scripts for deployment, many wait for sshd to come up, then ssh in. Since cloud-init and sshd are started in parallel, this creates a race condition for cloud-init to add ssh keys before sshd starts or the user can't login and the automated scripts can fail.

Specifically, this is happening to me using test-kitchen with the kitchen-openstack plugin, which uses Fog. It calls wait_for and watches for sshd to come up. It catches sshd before cloud-init finishes installing keys, and fails to ssh.


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

0.7.2-7.fc20

Reproducing:

Attempt to ssh in before cloud-init finishes but after sshd is up and running.

Steps to Reproduce:
1. Pull in Fedora Cloud image for OpenStack
2. Configure test kitchen to use Fedora
3. Run test-kitchen tests

Actual results:

ssh fails, which causes test-kitchen or other automated scripts to fail.

Expected results:

ssh should succeed.

Additional info:

Comment 1 Jordan Evans 2014-06-24 19:12:46 UTC
I submitted a bug with upstream as well, because this is something that can affect other distributions.

Comment 2 Garrett Holmstrom 2015-02-23 22:29:46 UTC
This should be fixed in cloud-init-0.7.6-3.fc22.  cloud-init-0.7.6-4.20140218bzr1060.fc22 will be pushed shortly with some major changes, so it may be worth testing against that instead.

Comment 3 Garrett Holmstrom 2015-02-23 22:39:29 UTC
Update:  cloud-init-0.7.6-4.20140218bzr1060.fc22 isn't going to make it into F22 due to bug 1194577.  If you're testing rawhide it will appear there, but otherwise feel free to go ahead and test cloud-init-0.7.6-3.fc22.  Sorry about the confusion.