Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

ssh fails during bootstrap when knife[:solo] used in knife.rb #272

Open
wormzer opened this issue Aug 6, 2013 · 1 comment
Open

ssh fails during bootstrap when knife[:solo] used in knife.rb #272

wormzer opened this issue Aug 6, 2013 · 1 comment

Comments

@wormzer
Copy link

wormzer commented Aug 6, 2013

I'm getting into knife solo and am loving, thanks! I hope I can help sort out a few issues I'm finding.

This issue seems to have to do with timing and might happen more often with m1.small t1.micro etc.

When performing ec2 server create when knife[:solo] = true set in knife.rb knife tries to bootstrap immediately after creating the instance (actually, with "sleep 10" looking at ec2_server_create.rb). Turns out that magic 10 seconds is not always enough and if sshd is not ready in 10 seconds you get a confusing "disconnected" error.

I hacked in a solution in detect_authentication_method to retry on Errno::ECONNREFUSED but even found some other errors such as Net::SSH::Disconnect are thrown as well.

With these retries installed, I'm able to get through to the bootstrap during ec2 server create, but I'm not sure if this is the right approach. It appears that other people are possibly getting by with the installed 10 second sleep but it has not been working well for me.

@matschaffer
Copy link
Owner

Send a patch over. I'd love a better way of handling the SSH connection (as is referenced in the log message :) )

I seem to recall fog containing some tricks for that as well. Could be worth a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants