-
Download and install Virtualbox and Vagrant
Tip: If you already have Vagrant installed, we suggest update to the current version available.
-
Download a copy of this repo in zip format or just clone it
git clone https://github.com/kikitux/devstack_docker.git
-
Navigate into your newly created devstack_docker directory
cd devstack_docker
, then runvagrant up --provider virtualbox
in the local directory where the Vagrantfile is in to download the DevStack Vagrant box and spin up the VMTip: On first run, Vagrant will download the base box required.
-
Go to http://localhost:8888
-
Login to admin with username
admin
and passwordpassword
or login to demo with usernamedemo
and passwordpassword
That's it, you have a fully functioning DevStack environment!
Now that you have your DevStack running, it's time to use it. Below are steps to setup a sample web server on your DevStack.
-
Run
vagrant ssh
in the directory the Vagrantfile is in -
Go to the devstack directory
cd /opt/stack/devstack
-
Source the demo environment
. openrc demo
Tip: the command is
. command argument
, it starts with a dot -
Setup security groups
neutron security-group-rule-create --protocol icmp \ --direction ingress --remote-ip-prefix 0.0.0.0/0 default
neutron security-group-rule-create --protocol tcp \ --port-range-min 22 --port-range-max 22 \ --direction ingress --remote-ip-prefix 0.0.0.0/0 default
neutron security-group-rule-create --protocol tcp \ --port-range-min 80 --port-range-max 80 \ --direction ingress --remote-ip-prefix 0.0.0.0/0 default
-
Provide internet access to the containers
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-
Source the admin environment
. openrc admin
Tip: the command is
. command argument
, it starts with a dot -
Pull down the larsks/thttpd Docker image
docker pull larsks/thttpd
-
Create a glance image
docker save larsks/thttpd | glance image-create --name larsks/thttpd \ --is-public true --container-format docker \ --disk-format raw
-
Source the demo environment
. openrc demo
Tip: the command is
. command argument
, it starts with a dot -
Boot the glance image
nova boot --image larsks/thttpd --flavor m1.small test0
-
Grab the private ip by running the command
nova list
nova list
+----...+-------+--------+...+-------------+--------------------+ | ID ...| Name | Status |...| Power State | Networks | +----...+-------+--------+...+-------------+--------------------+ | 0c3...| test0 | ACTIVE |...| Running | private=internal_ip| +----...+-------+--------+...+-------------+--------------------+
2. Run `curl http://internal_ip` to verify we have a working web server
-
In the browser go to http://localhost:888n where n is the IP of the server
10.0.0.1 -> localhost 8881 10.0.0.2 -> localhost 8882 10.0.0.3 -> localhost 8883 10.0.0.4 -> localhost 8884 10.0.0.5 -> localhost 8885
-
Login to your OpenStack dashboard and view your newly created instance
At somepoint if you require rebuild the environment, you can use devstack tools
-
Connect to the guest
vagrant ssh
-
Deconfigure using unstack.sh
cd /opt/devstack ./unstack.sh
-
Run stack.sh
cd /opt/devstack ./stack.sh
example run:
This is your host ip: 10.0.2.15 Horizon is now available at http://10.0.2.15/ Keystone is serving at http://10.0.2.15:5000/ The default users are: admin and demo The password: password real 7m29.726s
At somepoint if you require rebuild the environment, you can use vagrant
-
vagrant destroy
-
vagrant up --provider=virtualbox