Rancher Server and hosts on AWS - cannot create host

Hi

Running both rancher-server and hosts on AWS. I am trying to add a new host using the EC2 machine driver. However, it always fails at “waiting for SSH” unless I select “Use Only Private IP”, However, if I do select that then the ec2 instance is created without public IP.

The reason for this I think is that rancher-server is trying to use the public IP address to ssh in to configure the new host. However, on EC2 this is not possible - you can’t access private IPs from within a VPC you have to use the private IPs.

Is there some way of getting around this? Should docker-machine perhaps be using the hostname rather than the IP, as this will resolve correctly?

Thanks

Hi

Following up on my own post, I can see that it is indeed the case that rancher-server is trying to ssh to the public IP address of the host it has just created, and thus failing

tcp 0 1 172.17.0.2:47272 52.212.84.27:22 SYN_SENT

This would seem to be a change from v 1.4.X because with that version I was able to create hosts within EC2

All we are really doing is running docker-machine inside the server container. The machine driver creates the instance and decides what IP to connect to. AWS instances have always defaulted to having a public IP and using that for SSH AFAIK. So it seems more likely your network configuration changed.

Hi Vincent,

Thanks for the response. However, It has never been possible to access an AWS public IP from within the same VPC as far as I know.

Ignore this. I am a muppet. Allowing ssh access from the Rancher Server’s public IP fixed it.