-1

I'm trying to add a EC2 host to my Rancher setup. I have seen this tutorial, however I wanted to use Docker-machine instead.

To that extend, I have done the following:

MAC:~ user1$ docker-machine create -d amazonec2 --amazonec2-vpc-id vpc-84fd6de0 --amazonec2-region eu-west-1 --amazonec2-ami ami-c5f1beb6  Rancher-node-aws-01Running pre-create checks...
Creating machine...
(Rancher-node-aws-01) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...

Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

Note: the AMI ID corresponds to rancheros-v0.7.0-hvm-1.

As you can see, I cannot SSH into the RancherOS (SSH port is open on AWS). Any ideas why this is?

wiwa1978
  • 2,317
  • 3
  • 31
  • 67

1 Answers1

2

The trick is to use an SSH user called 'rancher'. So the full command will be:

docker-machine create -d amazonec2 --amazonec2-vpc-id vpc-84fd6de0 --amazonec2-region eu-west-1 --amazonec2-ami ami-c5f1beb6 --amazonec2-ssh-user rancher Rancher-node-aws-01
wiwa1978
  • 2,317
  • 3
  • 31
  • 67
  • Current AMI for each region can be found here: https://rancher.com/docs/os/v1.x/en/installation/amazon-ecs/#amazon-ecs-enabled-amis – Bobík Oct 30 '20 at 23:27
  • Use this command for cheapest region: docker-machine create -d amazonec2 --amazonec2-region us-east-1 --amazonec2-ami ami-0f5cc7a532c3171c3 --amazonec2-ssh-user rancher Rancher-node-aws-01 – Bobík Oct 30 '20 at 23:27