Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Docker-machine can't ssh into new machine if --amazonec2-ssh-user is set #2567

Closed
ignasi35 opened this issue Dec 14, 2015 · 6 comments
Closed

Comments

@ignasi35
Copy link

I'm creating a docker-machine using driver amazonec2 and setting an ssh user with the driver's option:

docker-machine create \
  --driver amazonec2 \
  --amazonec2-access-key $AWS_ACCESS_KEY \
  --amazonec2-secret-key $AWS_SECRET_KEY \
  --amazonec2-vpc-id vpc-asdf \
  —amazonec2-subnet-id subnet-asdf  \
  --amazonec2-region eu-west-1 \ 
  --amazonec2-zone b \
  --amazonec2-root-size 20 \
  --amazonec2-ssh-user myuser \
  --amazonec2-monitoring true \
  aws01

This seems to be stuck when trying to SSH into the newly created machine:

Running pre-create checks...
Creating machine...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Error creating machine: Error waiting for SSH: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

After some test-and-fail (I even tried #964 (comment) with several certs) I removed the option --amazonec2-ssh-user myuser and the command succeeded.

@asciifaceman
Copy link

I am having the same problem, in my case the ec2 machine initializes, is "running" for about half a minute, then stops itself

@galenp
Copy link

galenp commented Jan 15, 2016

+1

Using latest version 0.5.5

docker-machine create --driver amazonec2
--amazonec2-region ap-southeast-2
--amazonec2-access-key
--amazonec2-secret-key
--amazonec2-vpc-id vpc-asdf
--amazonec2-security-group sg-asdf
docker-name

Running pre-create checks...
Creating machine...
(docker-name) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...

@galenp
Copy link

galenp commented Jan 15, 2016

I think non issue, see: #1954 for details.

AWS Subnet needs to have Route Table associated from the VPC that you set up previously before running docker-machine create. Referenced issue has the details.

Configure AWS properly, re-run creation and things worked for me.

@jeanlaurent
Copy link
Member

@ignasi35 while looking at your cli it sounds like you don't use a custom AMI.
What do you want to achieve with a custom SSH username ?

@ignasi35
Copy link
Author

I assumed the parameter would allow to to create an EC2 machine where only the provided username would have access. Something in the form of: "create instance with default user, useradd 'abc', delete default user".

I got a bit carried away.

PS: I don't have much experience in AWS and some well-known practices when dealing with new machines still go over my head.

@jeanlaurent
Copy link
Member

I thought the same at first, the documentation was scarse, but has been updated since.

I'm going to close this.

Please re-open if I missed something.

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

No branches or pull requests

4 participants