How to set up development environment for OpenStack with DevStack
DevStack can be used to quickly bring up a complete OpenStack environment for development, based on the latest versions of everything from git master. However running it will make substantial changes to the system during installation, so it is advisable to only run DevStack on servers or virtual machines that are dedicated to this purpose.
With that in mind, I will be setting up a virtual machine using VirtualBox with Ubuntu 18.04 (Bionic Beaver).
I have downloaded VirtualBox from https://www.virtualbox.org/ and installed it to my machine. I can use it now to create a virtual machine and give it 4GB of RAM and 40GB of disk (requirements for DevStack).
Before starting the VM, one more thing to do, open Settings/Network and choose Bridged Adapter.
Now I am ready to start the machine and in the promt window select the ubuntu .iso file downloaded from https://ubuntu.com/download/server .
When the machine is up and running, I want to be able to ssh into the machine from Terminal and Visual Studio Code, so I run the commands :
$ sudo apt-get install ssh
$ sudo service ssh start
Next up, I can start setting up DevStack on the machine. For that I will follow the steps described here https://docs.openstack.org/devstack/latest/ :
$ git clone https://opendev.org/openstack/devstack
$ dc devstack/
To create a local.conf file :
$ nano local.conf
Minimum required config for this file would be :
[[local|localrc]] ADMIN_PASSWORD=secret DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD
But this file can be customised to run DevStack with selected components. In my case I will be adding config info to include manila and manila-ui.
To include manila-ui, for example, I added:
enable_plugin manila-ui https://opendev.org/openstack/manila-ui
If you are an intern or applicant like me I suggest ask your mentor how to set up the conf file for all the components you need for your project and make your initial setup as smooth as possible.
When the file is created, I run the script :
$ ./stack.sh (this will take quite some time)
*If you need to make changes in the conf file afterwards, just make the desired changes, run ./unstack.sh and again ./stack.sh
Now when the script has finished, I am all set! I can go to /opt/stack/ and see all the basic set of repos plus manila and manila-ui 🙂