Table of Content

launch ubuntu vm for openstack using vagrant

  • CPU: 2
  • memory: 6GB
  • 1st NIC: NAT
  • 2nd NIC: hostonly 10.110.0.16 private network for openstack
    mkdir -p vagrant/ubopenstack
    cd vagrant/ubopenstack
    curl -LO https://raw.githubusercontent.com/robertluwang/docker-hands-on-guide/master/dreamcloud-vagrant/ubopenstack/Vagrantfile
    

    bring it up,

    vagrant up
    vagrant ssh
    

    2 NIC up now,

    vagrant@ubopenstack:~$ ip addr
    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:a1:e9:fa brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86222sec preferred_lft 86222sec
    inet6 fe80::a00:27ff:fea1:e9fa/64 scope link
       valid_lft forever preferred_lft forever
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:29:ba:eb brd ff:ff:ff:ff:ff:ff
    inet 10.110.0.16/24 brd 10.110.0.255 scope global enp0s8
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe29:baeb/64 scope link
       valid_lft forever preferred_lft forever
    

shared folder mounted,

vagrant@ubopenstack:~$ df -h | grep vagrant
vagrant 440G 260G 181G 59% /vagrant

download devstack

https://docs.openstack.org/devstack/latest/
$ git clone https://git.openstack.org/openstack-dev/devstack
$ cd devstack

the vagrant user is already sudo user so will use it to install devstack.

devstack mini config

vi local.conf

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

run devstack

./stack.sh
last part,
=========================
DevStack Component Timing
 (times are in seconds)
=========================
run_process           28
test_with_retry        2
apt-get-update         1
osc                  114
wait_for_service      23
git_timed            246
dbsync                54
pip_install          374
apt-get              228
-------------------------
Unaccounted time     434
=========================
Total runtime        1504

This is your host IP address: 10.110.0.16
This is your host IPv6 address: fe80::a00:27ff:fe29:baeb
Horizon is now available at http://10.110.0.16/dashboard
Keystone is serving at http://10.110.0.16/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: b5841fa5d65b2c9899bbf45e6ad65138dc08cfa2 Merge "Remove deprecated 'deactivate_image' feature flag setting" 2018-01-18 12:09:14 +0000
OS Version: Ubuntu 17.10 artful

2018-01-21 21:45:32.829 | stack.sh completed in 1504 seconds.

post of install

for cli credential, need to source env file for admin or demo user,

you can download rc file for each user from dashboard GUI,

source admin-openrc.sh
vagrant@ubopenstack:~$ env|grep OS_
OS_IMAGE_API_VERSION=2
OS_AUTH_URL=http://10.110.0.16/identity/v3
OS_PROJECT_DOMAIN_ID=default
OS_REGION_NAME=RegionOne
OS_PROJECT_NAME=admin
OS_PROJECT_DOMAIN_NAME=default
OS_USER_DOMAIN_NAME=Default
OS_IDENTITY_API_VERSION=3
OS_INTERFACE=public
OS_PASSWORD=secret
OS_USERNAME=admin
OS_PROJECT_ID=8cd40ef2721c4086926b9276b840b118

now as admin user to test CLI,

vagrant@ubopenstack:~$ nova service-list
+--------------------------------------+------------------+-------------+----------+---------+-------+----------------------------+-----------------+-------------+
| Id                                   | Binary           | Host        | Zone     | Status  | State | Updated_at                 | Disabled Reason | Forced down |
+--------------------------------------+------------------+-------------+----------+---------+-------+----------------------------+-----------------+-------------+
| e4aacb6c-dad8-4d36-91c7-f2197996b4e3 | nova-scheduler   | ubopenstack | internal | enabled | up    | 2018-01-21T23:09:43.000000 | -               | False       |
| 4460e4c8-0a36-4088-8e7e-cc915328ea3b | nova-consoleauth | ubopenstack | internal | enabled | up    | 2018-01-21T23:09:43.000000 | -               | False       |
| 783a6d9a-84b1-40d0-9357-513d188ab07d | nova-conductor   | ubopenstack | internal | enabled | up    | 2018-01-21T23:09:40.000000 | -               | False       |
| ec572c5f-5351-4aa7-a5cb-1f1b945551ee | nova-conductor   | ubopenstack | internal | enabled | up    | 2018-01-21T23:09:39.000000 | -               | False       |
| 58b071ff-dbc6-4374-8b51-ef730627b618 | nova-compute     | ubopenstack | nova     | enabled | up    | 2018-01-21T23:09:48.000000 | -               | False       |
+--------------------------------------+------------------+-------------+----------+---------+-------+----------------------------+-----------------+-------------+

lazy setup one vm node openstack using vagrant

If you feel boring to run above setup and script, I provide a ready to go Vagrantfile, you can launch a one node openstack box automatically.

mkdir -p vagrant/ubopenstack
cd vagrant/ubopenstack
curl -Lo Vagrantfile https://raw.githubusercontent.com/robertluwang/cloud-hands-on-guide/master/dc-vagrant-cloud/ubopenstack/Vagrantfile.devstack

then openstack box ready for you!

If you like it, don’t mind to give a star :)