Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

libvirt provider hostname resolution not working #473

Open
richm opened this issue Jul 18, 2016 · 1 comment
Open

libvirt provider hostname resolution not working #473

richm opened this issue Jul 18, 2016 · 1 comment

Comments

@richm
Copy link
Contributor

richm commented Jul 18, 2016

Host: Fedora 23
using vagrant with --provider=libvirt with

  "libvirt": {
    "box_name": "centos7_inst",
    "box_url": "http://mirror.openshift.com/pub/vagrant/boxes/openshift3/centos7_libvirt_inst.box"
  },

NOTE: Everything works fine with the aws provider, this is only an issue with libvirt/virtualbox.

After successfully running vagrant sync-origin, trying to run test-origin-aggregated-logging:

$ vagrant test-origin-aggregated-logging -d  --env OS_ROOT=/data/src/github.com/openshift/origin --env DEBUG_FAILURES=true

This will run the logging.sh script: https://github.com/openshift/origin-aggregated-logging/blob/master/hack/testing/logging.sh#L69 and

os::util::environment::setup_all_server_vars "origin-aggregated-logging/"
os::util::environment::use_sudo
reset_tmp_dir

os::log::start_system_logger

export KUBELET_HOST=$(hostname)

configure_os_server
start_os_server

start_os_server fails here:

wait_for_url "${API_SCHEME}://${API_HOST}:${API_PORT}/healthz" "apiserver: " 0.25 80

API_HOST is openshiftdev.local API_PORT is 10250

$ getent ahostsv4 openshiftdev.local
127.0.0.1       STREAM openshiftdev.local
127.0.0.1       DGRAM  
127.0.0.1       RAW    

$ grep 127.0.0.1 /etc/hosts
127.0.0.1   openshiftdev.local openshiftdev localhost localhost.localdomain localhost4 localhost4.localdomain4

$ netstat -nlt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 192.168.121.216:4001    0.0.0.0:*               LISTEN     
tcp        0      0 192.168.121.216:10250   0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:6060          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN     
tcp        0      0 192.168.121.216:8053    0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 192.168.121.216:7001    0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 192.168.121.216:8443    0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     

$ getent hosts 192.168.121.216
192.168.121.216 openshiftdev.local
172.17.0.1      openshiftdev.local

The wait_for_url curl is going to fail because it is trying to talk to the server running on localhost, but the server is only listening to the 192.168.121.216 address. I think the server should listen to all interfaces - but when I set --env ALL_IP_ADDRESSES=0.0.0.0 the script fails with

/data/src/github.com/openshift/origin/hack/util.sh: line 51: SERVER_HOSTNAME_LIST: unbound variable

Perhaps this isn't a bug - perhaps there is some documentation about how to set ALL_IP_ADDRESSES and SERVER_HOSTNAME_LIST to make this work properly?

@richm
Copy link
Contributor Author

richm commented Jul 19, 2016

vagrant-aws works - here is some information from an aws machine:

# openshift start --print-ip
172.18.1.188
# ip a - eth0 is 172.18.1.188
# hostname
ip-172-18-1-188
# hostname -f
ip-172-18-1-188.ec2.internal
# getent ahostsv4 ip-172-18-1-188
172.18.1.188
# getent hosts 172.18.1.188
ip-172-18-1-188.ec2.internal
# there is nothing added to /etc/hosts
# cat /etc/resolv.conf
search ec2.internal
nameserver 172.18.0.2

openshift is listening only to 172.18.1.188, but in this case, fortunately, all of the reverse and forward IP/hostname resolution is working correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant