Vagrant

Installation

To get started with the vagrant provider, you need to install

You’ll also need a virtualization backend. EnOS supports both VirtualBox and Libvirt as shown below.

Refer to the Getting Started section to install Enos. Then asks Enos to create a new reservation.yaml file with the provider vagrant and one of the virtualization technology virtualbox or libvirt. Then review the information in the file, and you are ready for the deployment of OpenStack.

$ enos new --provider=vagrant:virtualbox  # or --provider=vagrant:libvirt
$ <editor> reservation.yaml               # optional
$ enos deploy

Provider configuration

The provider comes with the following default options:

DEFAULT_CONFIG = {
    'type': 'vagrant',          # Name of the provider
    'backend': 'virtualbox',    # Name of the virtualization technology
    'box': 'generic/debian10',  # Box -- https://app.vagrantup.com/boxes/search
    'user': 'root',             # SSH user
}

The provider relies on virtual machine sizes to group the wanted resources. For example the following is a valid configuration

 1enable_monitoring: false
 2inventory: inventories/inventory.sample
 3kolla:
 4  enable_heat: 'no'
 5  kolla_base_distro: centos
 6  kolla_install_type: source
 7  nova_compute_virt_type: qemu
 8provider:
 9  backend: virtualbox
10  box: generic/debian9
11  type: vagrant
12registry:
13  type: internal
14resources:
15  extra-large:
16    control: 1
17  medium:
18    compute: 1
19    network: 1

The list of the sizes may be found here.

By default VirtualBox will be used. See below to learn how to change for libvirt.

Use libvirt as the backend for Vagrant

Declaring your provider options as the following will spin up virtual machines using libvirt. Note that vagrant libvirt must be installed on your system.

 1enable_monitoring: false
 2inventory: inventories/inventory.sample
 3kolla:
 4  enable_heat: 'no'
 5  kolla_base_distro: centos
 6  kolla_install_type: source
 7  nova_compute_virt_type: qemu
 8provider:
 9  backend: libvirt
10  box: generic/debian9
11  type: vagrant
12registry:
13  type: internal
14resources:
15  extra-large:
16    control: 1
17  medium:
18    compute: 1
19    network: 1

Use the advanced syntax

The following is equivalent to the basic configuration but allows for a finer grained definition of the resources and associated roles.

 1enable_monitoring: false
 2inventory: inventories/inventory.sample
 3kolla:
 4  enable_heat: 'no'
 5  kolla_base_distro: centos
 6  kolla_install_type: source
 7provider:
 8  backend: libvirt
 9  box: generic/debian9
10  resources:
11    machines:
12    - flavor: extra-large
13      networks:
14      - network_interface
15      - neutron_external_interface
16      number: 1
17      role: control
18    - flavor: medium
19      networks:
20      - network_interface
21      - neutron_external_interface
22      number: 1
23      role: compute
24    - flavor: medium
25      networks:
26      - network_interface
27      - neutron_external_interface
28      number: 1
29      role: network
30  type: vagrant
31registry:
32  type: internal

Build a Box

A reference box for Vagrant, containing all the dependencies to install OpenStack in subsequent deployments, may be built directly from command line on-the-fly without an intermediary deploy execution. Run the command enos build vagrant, changing the default values accordingly.

In order to complete the box construction, after the execution of EnOS execute the following commands to register a box named personal/enos-box-openstack:

$ vagrant package
$ vagrant box add package.box --name personal/enos-box-openstack

Once the box is registed in the vagrant catalog, the name of this box can be used in the EnOS configuration replacing the default one. For example:

provider:
  type: vagrant
  backend: virtualbox
  box: personal/enos-box-openstack
  ...