0

Use Vagrant installed devstack. Set the HOST_IP to 127.0.0.1 before the installation config. After finish the installation, it told use these information to access web ui:

=========================
DevStack Component Timing
=========================
Total runtime    3523

run_process      113
test_with_retry    7
pip_install      647
wait_for_service  51
yum_install      338
git_timed        853
=========================



This is your host IP address: 127.0.0.1
This is your host IPv6 address: ::1
Horizon is now available at http://127.0.0.1/dashboard
Keystone is serving at http://127.0.0.1/identity/
The default users are: admin and demo
The password: secret
Services are running under systemd unit files.
For more information see:
https://docs.openstack.org/developer/devstack/systemd.html

I set private_ip in Vagrantfile with 192.168.33.11, I tried this way to access the web ui:

http://192.168.33.11/dashboard

But not works. Therefore, I test used curl in Vagrant can confirm something:

[stack@localhost devstack]$ curl -I http://127.0.0.1/dashboard
HTTP/1.1 302 Found
Date: Mon, 05 Jun 2017 10:38:37 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Vary: Accept-Language,Cookie
X-Frame-Options: SAMEORIGIN
Content-Language: en
Location: http://127.0.0.1/dashboard/auth/login/?next=/dashboard/
Content-Type: text/html; charset=utf-8

How to access the dashboard now?

cloud_cloud
  • 1,921
  • 4
  • 16
  • 30

2 Answers2

1

This does not work because devstack is running on 127.0.0.1 on your VM.

You can change the HOST_IP variable from the config file (under the localrc section - see https://docs.openstack.org/developer/devstack/configuration.html) and use the static IP you set from Vagrantfile

HOST_IP=192.168.33.11
SERVICE_HOST=$HOST_IP
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • Thank you. But what I commit works for me. I can access the service in the browser from outside host. – cloud_cloud Jun 06 '17 at 01:18
  • sure it can but its a bit cumbersome and not straightforward, if you'd pass the box to someone from your team, I guess he would like to work with basic `vagrant up` so either you set the IP from the VM or you make it listen to `0.0.0.0` so its bound to all network interfaces – Frederic Henri Jun 06 '17 at 06:02
0

This way works:

$ ssh -L 8080:localhost:80 vagrant@192.168.33.11

From browser:

http://localhost:8080/dashboard


Reference

$ man ssh
-L [bind_address:]port:host:hostport
         Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.  This works by allocating a socket to listen to
         port on the local side, optionally bound to the specified bind_address.  Whenever a connection is made to this port, the connection is forwarded over the secure channel,
         and a connection is made to host port hostport from the remote machine.  Port forwardings can also be specified in the configuration file.  IPv6 addresses can be specified
         by enclosing the address in square brackets.  Only the superuser can forward privileged ports.  By default, the local port is bound in accordance with the GatewayPorts set‐
         ting.  However, an explicit bind_address may be used to bind the connection to a specific address.  The bind_address of “localhost” indicates that the listening port be
         bound for local use only, while an empty address or ‘*’ indicates that the port should be available from all interfaces.
cloud_cloud
  • 1,921
  • 4
  • 16
  • 30