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.gitNavigate into your newly created devstack_docker directory
cd devstack_docker, then runvagrant up --provider virtualboxin 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
adminand passwordpasswordor login to demo with usernamedemoand 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 sshin the directory the Vagrantfile is inGo to the devstack directory
cd /opt/stack/devstackSource the demo environment
. openrc demoTip: the command is
. command argument, it starts with a dotSetup security groups
neutron security-group-rule-create --protocol icmp \ --direction ingress --remote-ip-prefix 0.0.0.0/0 defaultneutron security-group-rule-create --protocol tcp \ --port-range-min 22 --port-range-max 22 \ --direction ingress --remote-ip-prefix 0.0.0.0/0 defaultneutron security-group-rule-create --protocol tcp \ --port-range-min 80 --port-range-max 80 \ --direction ingress --remote-ip-prefix 0.0.0.0/0 defaultProvide internet access to the containers
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Source the admin environment
. openrc adminTip: the command is
. command argument, it starts with a dotPull down the larsks/thttpd Docker image
docker pull larsks/thttpdCreate a glance image
docker save larsks/thttpd | glance image-create --name larsks/thttpd \ --is-public true --container-format docker \ --disk-format rawSource the demo environment
. openrc demoTip: the command is
. command argument, it starts with a dotBoot 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 8885Login 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 sshDeconfigure using unstack.sh
cd /opt/devstack ./unstack.shRun stack.sh
cd /opt/devstack ./stack.shexample 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 destroyvagrant up --provider=virtualbox




