docker machine 0.3.0(0a251fe) amazonec2 driver cannot run in AWS China(cn-north-1)
Hi Forks,
I notice when use docker-machine to launch machine in AWS China the endpoint is not right, the error message is:
'''client encountered error while doing the request: Get https://ec2.cn-north-1.amazonaws.com/?Action=DescribeKeyPairs&Version=2014-06-15: dial tcp: lookup ec2.cn-north-1.amazonaws.com: no such hostError creating machine: Problem with AWS API call: client encountered error while doing the request: Get https://ec2.cn-north-1.amazonaws.com/?Action=DescribeKeyPairs&Version=2014-06-15: dial tcp: lookup ec2.cn-north-1.amazonaws.com: no such host You will want to check the provider to make sure the machine and associated resources were properly removed. ''' The docker-machine version I used: docker-machine version 0.3.0 (0a251fe)
From our experience on AWS China, the AWS China is an a Isolated region and the endpoint is: ec2.cn-north-1.amazonaws.com.cn not the same pattern with other AWS region https://ec2.%s.amazonaws.com
You can reproduce this issue by using docker-machine to launch instances inside AWS China, if needed, I can provide a temp AWS China credential,
The same issue report by @xiaoluffy with #1224 before on version 0.2.0 , also ping @ehazlett
I am guessing need someone help on the NewEC2 function on this file: https://github.com/docker/machine/blob/ff4650b9ed7ed145e70de4378cf729e8df6e3a5a/drivers/amazonec2/amz/ec2.go
Thanks!
Same with docker-machine version 0.4.1 (e2c88d6) Any news on this ?
I tried to fix this, but I got below outputs ( I've added some debug messages in the codes). I can make sure the accesskey/secretkey should be right, but I don't know how I still got a 401 response error.
Running pre-create checks... (aws-docker02) Calling RPCServerDriver.PreCreateCheck (aws-docker02) DBG | Making AWS API call with values: (aws-docker02) DBG | { (aws-docker02) DBG | "Action": [ (aws-docker02) DBG | "DescribeKeyPairs" (aws-docker02) DBG | ], (aws-docker02) DBG | "Version": (aws-docker02) DBG | "2014-06-15" (aws-docker02) DBG | DBG | } (aws-docker02) DBG | awsApiCall, https://ec2.cn-north-1.amazonaws.com.cn?Action=DescribeKeyPairs&Version=2014-06-15 (aws-docker02) DBG | GetKeyPairs, Problem with AWS API call: Non-200 API response: code=401 message=AWS was not able to validate the provided access credentials (aws-docker02) DBG | (aws-docker02) DBG | checkPrereqs, Problem with AWS API call: Non-200 API response: code=401 message=AWS was not able to validate the provided access credentials Error creating machine: Error with pre-create check: Problem with AWS API call: Non-200 API response: code=401 message=AWS was not able to validate the provided access credentials
BTW, I've tried to fix the error in 0.5.0
FYI, I tried the latest docker-machine, and it worked with cn-north-1:
$ docker-machine create --driver amazonec2 --amazonec2-region cn-north-1 --amazonec2-subnet-id subnet-xxxxx --amazonec2-vpc-id vpc-xxxxxx docker-02
Running pre-create checks...
Creating machine...
(docker-02) 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...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env docker-02
I have tried but failed, command hung when "Installing Docker..." then I try to run command: "docker-machine ls", output error is: docker-sandbox2 - amazonec2 Running tcp://54.222.225.70:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
My environment: OS: Mac 10.11.6 docker: 1.12.0 docker-machine: 0.8.0, build b85aac1 region: China
docker-sandbox2 - amazonec2 Running tcp://54.222.225.70:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
You need to figure out why that address isn't reachable from your workstation... does ping on that ip work?