Skip to content
Snippets Groups Projects
devenv-vagrant.rst 4.02 KiB
Newer Older
Harm Weites's avatar
Harm Weites committed
Vagrant up!
===========
Harm Weites's avatar
Harm Weites committed

This guide describes how to use `Vagrant <http://vagrantup.com>`__ to
assist in developing for Kolla.
Harm Weites's avatar
Harm Weites committed

Vagrant is a tool to assist in scripted creation of virtual machines. Vagrant
takes care of setting up CentOS-based VMs for Kolla development, each with
proper hardware like memory amount and number of network interfaces.
Harm Weites's avatar
Harm Weites committed

Getting Started
---------------

The Vagrant script implements All-in-One (AIO) or multi-node deployments. AIO
is the default.

In the case of multi-node deployment, the Vagrant setup builds a cluster with
the following nodes by default:
Harm Weites's avatar
Harm Weites committed

-  3 control nodes
-  1 compute node
-  1 storage node (Note: ceph requires at least 3 storage nodes)
-  1 network node
-  1 operator node

The cluster node count can be changed by editing the Vagrantfile.

Kolla runs from the operator node to deploy OpenStack.
Harm Weites's avatar
Harm Weites committed

All nodes are connected with each other on the secondary NIC. The
primary NIC is behind a NAT interface for connecting with the Internet.
The third NIC is connected without IP configuration to a public bridge
interface. This may be used for Neutron/Nova to connect to instances.
Harm Weites's avatar
Harm Weites committed

Start by downloading and installing the Vagrant package for the distro of
choice. Various downloads can be found at the `Vagrant downloads
<https://www.vagrantup.com/downloads.html>`__.

On Fedora 22 it is as easy as::
Harm Weites's avatar
Harm Weites committed

    sudo dnf install vagrant ruby-devel libvirt-devel

Next install the hostmanager plugin so all hosts are recorded in /etc/hosts
(inside each vm)::
Harm Weites's avatar
Harm Weites committed

    vagrant plugin install vagrant-hostmanager

Vagrant supports a wide range of virtualization technologies. This
documentation describes libvirt. To install vagrant-libvirt plugin::

    vagrant plugin install vagrant-libvirt
Setup NFS to permit file sharing between host and VMs. Contrary to rsync
method, NFS allows both way synchronization and offers much better performances
than VirtualBox shared folders. On Fedora 22::
Harm Weites's avatar
Harm Weites committed

    sudo systemctl start nfs-server
    firewall-cmd --permanent --add-port=2049/udp
    firewall-cmd --permanent --add-port=2049/tcp
    firewall-cmd --permanent --add-port=111/udp
    firewall-cmd --permanent --add-port=111/tcp
Harm Weites's avatar
Harm Weites committed

Find a location in the system's home directory and checkout the Kolla repo::
Harm Weites's avatar
Harm Weites committed

    git clone https://github.com/openstack/kolla.git ~/dev/kolla

Developers can now tweak the Vagrantfile or bring up the default AIO
Centos7-based environment::
Harm Weites's avatar
Harm Weites committed

    cd ~/dev/kolla/vagrant && vagrant up
Harm Weites's avatar
Harm Weites committed

The command ``vagrant status`` provides a quick overview of the VMs composing
the environment.
Harm Weites's avatar
Harm Weites committed

Vagrant Up
Once Vagrant has completed deploying all nodes, the next step is to launch
Kolla. First, connect with the *operator* node::
Harm Weites's avatar
Harm Weites committed

    vagrant ssh operator

To speed things up, there is a local registry running on the operator.  All
nodes are configured so they can use this insecure repo to pull from, and use
it as a mirror. Ansible may use this registry to pull images from.

All nodes have a local folder shared between the group and the hypervisor, and
a folder shared between *all* nodes and the hypervisor.  This mapping is lost
after reboots, so make sure to use the command ``vagrant reload <node>`` when
reboots are required. Having this shared folder provides a method to supply
a different docker binary to the cluster. The shared folder is also used to
store the docker-registry files, so they are save from destructive operations
like ``vagrant destroy``.


Building images
^^^^^^^^^^^^^^^

Once logged on the *operator* VM call the ``kolla-build`` utility::

    kolla-build

``kolla-build`` accept arguments as documented in :doc:`image-building`.


Deploying OpenStack with Kolla
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Deploy AIO with::

    sudo kolla-ansible deploy

Deploy multinode with::
    sudo kolla-ansible deploy -i /usr/share/kolla/ansible/inventory/multinode
Harm Weites's avatar
Harm Weites committed

Validate OpenStack is operational::
Harm Weites's avatar
Harm Weites committed

    openstack user list
Harm Weites's avatar
Harm Weites committed

Or navigate to http://10.10.10.254/ with a web browser.
Harm Weites's avatar
Harm Weites committed


Further Reading
---------------

All Vagrant documentation can be found at
`docs.vagrantup.com <http://docs.vagrantup.com>`__.