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.

Then, refer to the Getting Started section to install Enos.

Basic Configuration

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

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

The list of the sizes may be found here.

By default virtualbox will be used. See below to learn how to change the default virtualbox backend.

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
enable_monitoring: false
inventory: inventories/inventory.sample
kolla:
  enable_heat: 'no'
  kolla_base_distro: centos
  kolla_install_type: source
  nova_compute_virt_type: qemu
kolla_ref: stable/stein
kolla_repo: https://git.openstack.org/openstack/kolla-ansible
provider:
  backend: libvirt
  box: generic/debian9
  type: vagrant
registry:
  type: internal
resources:
  extra-large:
    control: 1
  medium:
    compute: 1
    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.

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

Default Configuration

DEFAULT_CONFIG = {
    'backend': 'virtualbox',
    'box': 'generic/debian9',
    'user': 'root',
}

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
  ...