stack.sh stuck on get_random_port

asked 2018-05-21 16:51:26 -0600

Wajahat gravatar image

I am trying to install devstack on my Ubuntu 16.04 machine, here is my local.conf file:

[[local|localrc]]
HOST_IP=135.207.223.61
FLAT_INTERFACE=eth0
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=135.207.223.128/25
MULTI_HOST=1
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=labstack
DATABASE_PASSWORD=supersecret
RABBIT_PASSWORD=supersecret
SERVICE_PASSWORD=supersecret
PIP_UPGRADE=True

When I run stack.sh it goes through a bunch of stuff but then it seems to get stuck here:

2018-05-21 21:31:40.228 | +lib/glance:configure_glance:229           cp -p /opt/stack/glance/etc/policy.json /etc/glance/policy.json
2018-05-21 21:31:40.237 | +lib/glance:configure_glance:230           cp -p /opt/stack/glance/etc/schema-image.json /etc/glance/schema-image.json
2018-05-21 21:31:40.247 | +lib/glance:configure_glance:232           cp -p /opt/stack/glance/etc/metadefs/cim-processor-allocation-setting-data.json /opt/stack/glance/etc/metadefs/cim-resource-allocation-setting-data.json /opt/stack/glance/etc/metadefs/cim-storage-allocation-setting-data.json /opt/stack/glance/etc/metadefs/cim-virtual-system-setting-data.json /opt/stack/glance/etc/metadefs/compute-aggr-disk-filter.json /opt/stack/glance/etc/metadefs/compute-aggr-iops-filter.json /opt/stack/glance/etc/metadefs/compute-aggr-num-instances.json /opt/stack/glance/etc/metadefs/compute-cpu-pinning.json /opt/stack/glance/etc/metadefs/compute-guest-memory-backing.json /opt/stack/glance/etc/metadefs/compute-guest-shutdown.json /opt/stack/glance/etc/metadefs/compute-host-capabilities.json /opt/stack/glance/etc/metadefs/compute-hypervisor.json /opt/stack/glance/etc/metadefs/compute-instance-data.json /opt/stack/glance/etc/metadefs/compute-libvirt-image.json /opt/stack/glance/etc/metadefs/compute-libvirt.json /opt/stack/glance/etc/metadefs/compute-quota.json /opt/stack/glance/etc/metadefs/compute-randomgen.json /opt/stack/glance/etc/metadefs/compute-trust.json /opt/stack/glance/etc/metadefs/compute-vcputopology.json /opt/stack/glance/etc/metadefs/compute-vmware-flavor.json /opt/stack/glance/etc/metadefs/compute-vmware.json /opt/stack/glance/etc/metadefs/compute-vmware-quota-flavor.json /opt/stack/glance/etc/metadefs/compute-watchdog.json /opt/stack/glance/etc/metadefs/compute-xenapi.json /opt/stack/glance/etc/metadefs/glance-common-image-props.json /opt/stack/glance/etc/metadefs/image-signature-verification.json /opt/stack/glance/etc/metadefs/operating-system.json /opt/stack/glance/etc/metadefs/software-databases.json /opt/stack/glance/etc/metadefs/software-runtimes.json /opt/stack/glance/etc/metadefs/software-webservers.json /opt/stack/glance/etc/metadefs/storage-volume-type.json /etc/glance/metadefs
2018-05-21 21:31:40.259 | +lib/glance:configure_glance:234           is_service_enabled tls-proxy
2018-05-21 21:31:40.302 | +functions-common:is_service_enabled:1911  return 1
2018-05-21 21:31:40.309 | +lib/glance:configure_glance:242           [[ uwsgi == \u\w\s\g\i ]]
2018-05-21 21:31:40.316 | +lib/glance:configure_glance:243           write_local_uwsgi_http_config /etc/glance/glance-uwsgi.ini /usr/local/bin/glance-wsgi-api /image
2018-05-21 21:31:40.323 | +lib/apache:write_local_uwsgi_http_config:301  local file=/etc/glance/glance-uwsgi.ini
2018-05-21 21:31:40.330 | +lib/apache:write_local_uwsgi_http_config:302  local wsgi=/usr/local/bin/glance-wsgi-api
2018-05-21 21:31:40.337 | +lib/apache:write_local_uwsgi_http_config:303  local url=/image
2018-05-21 21:31:40.347 | ++lib/apache:write_local_uwsgi_http_config:304  basename /usr/local/bin/glance-wsgi-api
2018-05-21 21:31:40.354 | +lib/apache:write_local_uwsgi_http_config:304  name=glance-wsgi-api
2018-05-21 21:31:40.361 | +lib/apache:write_local_uwsgi_http_config:310  rm -rf /etc/glance/glance-uwsgi.ini
2018-05-21 21:31:40.370 | +lib/apache:write_local_uwsgi_http_config:311  iniset ...
(more)
edit retag flag offensive close merge delete

Comments

From what I understand, get_random_port(http://git.openstack.org/cgit/opensta...) finds a free network port based on the range in /proc/sys/net/ipv4/ip_local_port_range. It loops forever until it finds a free port using the lsof tool.

Bernd Bausch gravatar imageBernd Bausch ( 2018-05-21 18:31:45 -0600 )edit

If the loop never stops on your system, either your ip_local_port_range contains wrong data (it should be the lower and upper bound of available ports), or the lsof command doesn't work. Not all systems have lsof installed.

Bernd Bausch gravatar imageBernd Bausch ( 2018-05-21 18:35:10 -0600 )edit

It finally went ahead, turns out that lsof itself is taking really really long to execute even when I do it manually. So even though the sleep is of only 1 second, lsof itself takes several minutes to return.

Wajahat gravatar imageWajahat ( 2018-05-22 15:03:58 -0600 )edit

Googling for slow lsof yields a few results. One possible cause may be DNS accesses. Perhaps you have to fix DNS on that server.

Bernd Bausch gravatar imageBernd Bausch ( 2018-05-22 18:38:04 -0600 )edit