IntroductionOpenStack developers in general, and Dragonflow developers in particular, find themselves in need of setting up many OpenStack deployments (for testing, troubleshooting, developing, and what not). Every change requires testing on a 'real' environment.
Doing this manually is impossible. This is a task that must be automated. If a patch is ready, setting up a server to test it should take seconds.
This is where Openstack-Vagrant comes in.
More DetailsIn essence, Openstack-Vagrant (https://github.com/omeranson/openstack-vagrant) is a Vagrantfile (read: Vagrant configuration file) that sets up a virtual machine, configures it and installs all the necessary dependencies (using Ansible), and then runs devstack.
In effect, Openstack-Vagrant allows you to create a new OpenStack deployment by simply updating a configuration file, and running vagrant up.
VagrantVagrant (https://www.vagrantup.com/) allows you to easily manage your virtual machines. They can be deployed on many hosts (e.g. your personal PC, or several lab servers), with many backends (e.g. libvirt, or virtual box), with many distributions (e.g. Ubuntu, Fedora). I am sticking to Linux here, because that's what's relevant to our deployment.
Vagrant also let's you automatically provision your virtual machines, using e.g. shell or Ansible.
AnsibleAnsible (https://www.ansible.com/) allows you to easily provision your remote devices. It was selected for OpenStack-Vagrant for two main reasons:
- It is agent-less. No prior installation is needed.
- It works over SSH - out of the box for Linux cloud images.
DevstackEvery developer in OpenStack should know devstack (https://docs.openstack.org/devstack/latest/). That's how testing setups are deployed.
Really In-DepthLet's review how to set-up an OpenStack and Dragonflow deployment on a single server using Openstack-Vagrant.
- Grab a local.conf file. The Dragonflow project has some with healthy defaults (https://github.com/openstack/dragonflow/tree/master/doc/source/single-node-conf). At the time of writing, redis and etcd are gated. I recommend etcd, since it's now an Openstack base service (https://github.com/openstack/dragonflow/blob/master/doc/source/single-node-conf/etcd_local_controller.conf)
- wget https://raw.githubusercontent.com/openstack/dragonflow/master/doc/source/single-node-conf/etcd_local_controller.conf
- name: one hypervisor: name: localhost username: root memory: 8192 vcpus: 1 box: "fedora/25-cloud-base" local_conf_file: etcd_local_controller.conf
- vagrant up one
- vagrant ssh -p -- -l stack
- tmux attach
How Can It Be Better?There are many ways we can still improve Openstack-Vagrant. Here are some thoughts that come to mind:
- A simple CLI interface that creates the configuration file and fires up the virtual machine.
- Use templates to make the local.conf file more customisable.