[OpenStack] 透過 DevStack 在 AWS EC2 Linux 上安裝 OpenStack

Veck
2 min readAug 7, 2018
  1. Create a EC2 instance and login
  2. Create a stack user
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
$ echo “stack ALL=(ALL) NOPASSWD: ALL” | sudo tee /etc/sudoers.d/stack
$ sudo su — stack

3. Download DevStack

git clone https://git.openstack.org/openstack-dev/devstack

4. create a local.conf in project

cd devstack
vim local.conf

然後

[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

5. start the install: ./stack.sh. This will take a 15–20 mins. Once the installation done, all is done.

=========================
DevStack Component Timing
(times are in seconds)
=========================
run_process 15
test_with_retry 2
apt-get-update 12
pip_install 287
osc 112
wait_for_service 15
git_timed 193
dbsync 23
apt-get 265
— — — — — — — — — — — — -
Unaccounted time 341
=========================
Total runtime 1265
This is your host IP address: 172.31.21.104
This is your host IPv6 address: ::1
Horizon is now available at http://172.31.21.104/dashboard
Keystone is serving at http://172.31.21.104/identity/
The default users are: admin and demo
The password: secret
WARNING:
Using lib/neutron-legacy is deprecated, and it will be removed in the future
Services are running under systemd unit files.
For more information see:
https://docs.openstack.org/devstack/latest/systemd.html
DevStack Version: queens
Change: 28b4be186105888b72300d27166deb771857df06 Merge “Make stackenv file visible” 2018–01–03 23:19:46 +0000
OS Version: Ubuntu 16.04 xenial
2018–01–08 05:30:33.155 | stack.sh completed in 1265 seconds.

最後完成的訊息就這樣,就算完成安裝了

- DevStack 已經安裝好 keystone, glance, nova, cinder, neutron, 和 horizon,可以試著輸入指令看看
- Floating IPs will be available, guests have access to the external world.
- 可以試著存取 Web Interface horizon (URL 在最後的安裝訊息中)
- `source devstack/openrc 後會多了一個 openstack 指令來管理 DevStack
- You can cd `/opt/stack/tempest` and run tempest tests that have been configured to work with your devstack.
- You can make code changes to OpenStack and validate them.

Note for Using AWS EC2 Ubuntu 16.04

因為 EC2 是在 AWS VPC 中所建立的 VM,所以預設認知到的網卡也是區網內的 private IP,因此上面所匹配的 IP Address 173.x.x.x 是 private IP,只需要替換成這個 instance 的 Public IP 就可以成功連線到 dashboard portal 了

--

--