{"action":"created","issue":{"url":"https://api.github.com/repos/rancher/rancher/issues/5241","repository_url":"https://api.github.com/repos/rancher/rancher","labels_url":"https://api.github.com/repos/rancher/rancher/issues/5241/labels{/name}","comments_url":"https://api.github.com/repos/rancher/rancher/issues/5241/comments","events_url":"https://api.github.com/repos/rancher/rancher/issues/5241/events","html_url":"https://github.com/rancher/rancher/issues/5241","id":162100075,"number":5241,"title":"Add Amazon EC2 Host sets wrong CATTLE_AGENT_IP when using private IP","user":{"login":"unki2aut","id":851207,"avatar_url":"https://avatars.githubusercontent.com/u/851207?v=3","gravatar_id":"","url":"https://api.github.com/users/unki2aut","html_url":"https://github.com/unki2aut","followers_url":"https://api.github.com/users/unki2aut/followers","following_url":"https://api.github.com/users/unki2aut/following{/other_user}","gists_url":"https://api.github.com/users/unki2aut/gists{/gist_id}","starred_url":"https://api.github.com/users/unki2aut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unki2aut/subscriptions","organizations_url":"https://api.github.com/users/unki2aut/orgs","repos_url":"https://api.github.com/users/unki2aut/repos","events_url":"https://api.github.com/users/unki2aut/events{/privacy}","received_events_url":"https://api.github.com/users/unki2aut/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rancher/rancher/labels/area/host","name":"area/host","color":"FBCA04"},{"url":"https://api.github.com/repos/rancher/rancher/labels/kind/bug","name":"kind/bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/rancher/rancher/milestones/71","html_url":"https://github.com/rancher/rancher/milestones/Unscheduled","labels_url":"https://api.github.com/repos/rancher/rancher/milestones/71/labels","id":1853807,"number":71,"title":"Unscheduled","description":"This milestone includes bugs we have looked into but have not scheduled into an upcoming release.","creator":{"login":"deniseschannon","id":11410997,"avatar_url":"https://avatars.githubusercontent.com/u/11410997?v=3","gravatar_id":"","url":"https://api.github.com/users/deniseschannon","html_url":"https://github.com/deniseschannon","followers_url":"https://api.github.com/users/deniseschannon/followers","following_url":"https://api.github.com/users/deniseschannon/following{/other_user}","gists_url":"https://api.github.com/users/deniseschannon/gists{/gist_id}","starred_url":"https://api.github.com/users/deniseschannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniseschannon/subscriptions","organizations_url":"https://api.github.com/users/deniseschannon/orgs","repos_url":"https://api.github.com/users/deniseschannon/repos","events_url":"https://api.github.com/users/deniseschannon/events{/privacy}","received_events_url":"https://api.github.com/users/deniseschannon/received_events","type":"User","site_admin":false},"open_issues":831,"closed_issues":157,"state":"open","created_at":"2016-06-28T21:41:11Z","updated_at":"2016-10-13T03:32:25Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-06-24T08:30:36Z","updated_at":"2016-10-13T19:34:15Z","closed_at":null,"body":"**Rancher Version:** v1.0.2\r\n\r\n**Docker Version:** 1.11.2\r\n\r\n**OS and where are the hosts located? (cloud, bare metal, etc):** Ubuntu 14.04.4 LTS, AWS EC2\r\n\r\n**Setup Details: (single node rancher vs. HA rancher, internal DB vs. external DB)**\r\nRancher HA setup with 3 server nodes using AWS RDS\r\n\r\n**Environment Type: Cattle**\r\n\r\n**Steps to Reproduce:**\r\nUse the UI to add a new Host from Amazon EC2, fill in all required fields and select \"Use only private IP address\"\r\n\r\n**Results:** \r\nInstance is created correctly and showing in the UI, but it shows the gateway IP. Also `docker inspect rancher-agent` shows `CATTLE_AGENT_IP` is set to the gateway IP. Therefore inter-host communication is not working correctly.\r\n\r\n**Expected:**\r\nAgent sets the instances private IP for `CATTLE_AGENT_IP`\r\n\r\n**Work around:**\r\n\r\n1. log into host over SSH\r\n2. stop rancher agent with `docker stop rancher-agent`\r\n3. go to _Add Host_ and select _Custom_ view in the UI, fill hosts private IP in step 4, copy the generated command from step 5 and run in the shell. After some time the IP is showing correctly in the UI and inter-host communication is working.\r\n"},"comment":{"url":"https://api.github.com/repos/rancher/rancher/issues/comments/253615286","html_url":"https://github.com/rancher/rancher/issues/5241#issuecomment-253615286","issue_url":"https://api.github.com/repos/rancher/rancher/issues/5241","id":253615286,"user":{"login":"phedoreanu","id":1611001,"avatar_url":"https://avatars.githubusercontent.com/u/1611001?v=3","gravatar_id":"","url":"https://api.github.com/users/phedoreanu","html_url":"https://github.com/phedoreanu","followers_url":"https://api.github.com/users/phedoreanu/followers","following_url":"https://api.github.com/users/phedoreanu/following{/other_user}","gists_url":"https://api.github.com/users/phedoreanu/gists{/gist_id}","starred_url":"https://api.github.com/users/phedoreanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phedoreanu/subscriptions","organizations_url":"https://api.github.com/users/phedoreanu/orgs","repos_url":"https://api.github.com/users/phedoreanu/repos","events_url":"https://api.github.com/users/phedoreanu/events{/privacy}","received_events_url":"https://api.github.com/users/phedoreanu/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T19:34:15Z","updated_at":"2016-10-13T19:34:15Z","body":"Create the EC2 instances manually, you also get to specify the ssh key-pair, then ssh in and run:\r\n```sh\r\ndocker run \\\r\n  -e CATTLE_AGENT_IP=\"$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')\"  \\\r\n  -d --restart=always --privileged \\\r\n  -v /var/run/docker.sock:/var/run/docker.sock \\\r\n  -v /var/lib/rancher:/var/lib/rancher \\\r\n  rancher/agent:v1.0.2 \\\r\n  http://<rancher-server>:<rancher-port>/v1/scripts/<token>:<token>:<token>\r\n```"}}
{"actor":{"display_login":"phedoreanu"}}