cloudfoundry / bosh-openstack-cpi-release

BOSH OpenStack CPI
Apache License 2.0
36 stars 59 forks source link

Uploading stemcell bosh-openstack-kvm-ubuntu-trusty-go_agent/3262.14 to the cloud. Failed: Unable to connect to the OpenStack Keystone API http://ctl:5000/v3/auth/tokens #51

Closed ifding closed 8 years ago

ifding commented 8 years ago

I am deploying cloud foundry on openstack keystone v3, trying to upload the bosh stemcell image. But it prints this error message:

Uploading stemcell bosh-openstack-kvm-ubuntu-trusty-go_agent/3262.14 to the cloud. Failed: Unable to connect to the OpenStack Keystone API http://ctl:5000/v3/auth/tokens getaddrinfo: Name or service not known (SocketError) (00:00:05)

Error 100: Unable to connect to the OpenStack Keystone API http://ctl:5000/v3/auth/tokens getaddrinfo: Name or service not known (SocketError)

The complete output of the bosh upload stemcell command can be seen here: http://pastebin.com/bk3jNV0w

I used the same approach mentioned in https://github.com/cloudfoundry-incubator/bosh-openstack-cpi-release/issues/44 But all I get is the same error as above. Anyone could tell me how to solve this? Thanks!

voelzmo commented 8 years ago

Dear @kenfting

It seems like the host ctl cannot be resolved from the BOSH Director VM (that's what the error says). Are you running a DevStack? Here is a few things you can try to figure out your networking problem:

Warm regards Marco

ifding commented 8 years ago

@voelzmo Dear Marco,

Thanks very much for your answers. I am not sure whether it is DevStack, the openstack is provided by cloudlab.us. I will check with them. I tried to use IP address and hostname instead right now. but it also didn't work. About your suggestion, the result is ( vm_ip, ip_addresss and hostname replace the relative details):

  1. I am not sure how to access Horizon from Director VM. I used ssh vcap@vm_ip -i ./bosh.pem to log in Director VM. and used curl http://ip_address:5000/v3, it got: {"version": {"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "http://ip_addres:5000/v3/", "rel": "self"}]}}
  2. the DNS server inside VM is 8.8.8.8, I used dig @8.8.8.8 ctl and dig @8.8.8.8 hostname, it got:
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> @8.8.8.8 ctl
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 62703
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;ctl.               IN  A

;; AUTHORITY SECTION:
.           1790    IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2016092300 1800 900 604800 86400

;; Query time: 6 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Sep 23 13:50:02 UTC 2016
;; MSG SIZE  rcvd: 107
-------------------------------------------------------------------------------------------
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> @8.8.8.8 hostname
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43689
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;hostname.  IN  A

;; ANSWER SECTION:
hostname. 29 IN A   130.127.1**.4*
;; Query time: 75 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Sep 23 14:03:35 UTC 2016
;; MSG SIZE  rcvd: 74
voelzmo commented 8 years ago

If you're not using a custom nameserver, ctl cannot be resolved to your actual OpenStack API endpoint. 8.8.8.8 is hosted by google, they have no chance to know where ctl should point to.

Try to use Keystone's IP address as OpenStack endpoint in your deployment manifest and re-deploy your BOSH Director.

ifding commented 8 years ago

Thanks @voelzmo

I used Keystone's IP address and re-deploy. the manifest is:
auth_url: http://130.127.***.**:5000/v3 endpoint_type: publicURL human_readable_vm_names: false ignore_server_availability_zone: false state_timeout: 300 boot_from_volume: false use_dhcp: true wait_resource_poll_interval: 5 project: admin domain: default username: admin api_key: ea53a4c22 default_key_name: bosh default_security_groups: [bosh] connection_options: connect_timeout: 360 ssl_verifypeer: false But it failed. Also I used cat /etc/resolv.conf command and got nameserver 130.127.._\ as DNS server. It also failed. Same errors: Failed: Unable to connect to the OpenStack Keystone API http://130.127.***.**:5000/v3/auth/tokens getaddrinfo: Name or service not known (SocketError) (00:00:06)

Error 100: Unable to connect to the OpenStack Keystone API http://130.127.**.**:5000/v3/auth/tokens getaddrinfo: Name or service not known (SocketError)

voelzmo commented 8 years ago

I'm not sure how you're supposed to connect to the cloudlab.us OpenStack. Is this over some VPN connection? Did you add some nameserver entries manually?

ifding commented 8 years ago

I use ssh to connect the cloudlab.us Openstack controller, and deploy cloud foundry. is there something wrong with it? I tried to use different nameservers in /etc/resolv.conf, but no luck.

ifding commented 8 years ago

@voelzmo Dear Marco, I have updated the pulic URL, changed the hostname(ctl) to FQDN and restarted all services. Re-deployed and now the stemcell is uploaded successfully. Thanks all the same.