Bug 1112817 - sshd can start before cloud-init can finish
Summary: sshd can start before cloud-init can finish
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cloud-init
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Garrett Holmstrom
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-24 18:08 UTC by Jordan Evans
Modified: 2015-03-14 15:54 UTC (History)
8 users (show)

Fixed In Version: cloud-init-0.7.6-3.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-12 17:49:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1333920 0 None None None Never

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.


Note You need to log in before you can comment on or make changes to this bug.