Home OpenStack-Salt Development Documentation

OpenStack-Salt Vagrant deployment

All-in-one (AIO) deployments are a great way to setup an OpenStack-Salt cloud for:

  • a service development environment
  • an overview of how all of the OpenStack services and roles play together
  • a simple lab deployment for testing

Although AIO builds aren’t suitable for large production deployments, they’re great for small proof-of-concept deployments.

It’s strongly recommended to have hardware that meets the following requirements before starting an AIO deployment:

Vagrant setup

Installing Vagrant is extremely easy for many operating systems. Go to the Vagrant downloads page and get the appropriate installer or package for your platform. Install the package using standard procedures for your operating system.

The installer will automatically add vagrant to your system path so that it is available in shell. Try logging out and logging back in to your system (this is particularly necessary sometimes for Windows) to get the updated system path up and running.

Add the generic ubuntu1404 image for virtualbox virtualization.

$ vagrant box add ubuntu/trusty64

==> box: Loading metadata for box 'ubuntu/trusty64'
    box: URL: https://atlas.hashicorp.com/ubuntu/trusty64
==> box: Adding box 'ubuntu/trusty64' (v20160122.0.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20160122.0.0/providers/virtualbox.box
==> box: Successfully added box 'ubuntu/trusty64' (v20160122.0.0) for 'virtualbox'!

Environment setup

The environment consists of three nodes.

FQDN Role IP
config.openstack.local Salt master node 10.10.10.200
control.openstack.local OpenStack control node 10.10.10.201
compute.openstack.local OpenStack compute node 10.10.10.202

Minion configuration files

Download openstack-salt

Look at configuration files for each node deployed.

scripts/minions/config.conf configuration:

id: config.openstack.local

master: 10.10.10.200

scripts/minions/control.conf configuration:

id: control.openstack.local

master: 10.10.10.200

scripts/minions/compute.conf configuration:

id: compute.openstack.local

master: 10.10.10.200

Vagrant configuration file

The main vagrant configuration for OpenStack-Salt deployment is located at scripts/Vagrantfile.

# -*- mode: ruby -*-
# vi: set ft=ruby :

boxes = {
  'ubuntu/trusty64' => {
    'name'  => 'ubuntu/trusty64',
    'url'   => 'ubuntu/trusty64'
  },
}

Vagrant.configure("2") do |config|

  config.vm.define :openstack_config do |openstack_config|

    openstack_config.vm.hostname = 'config.openstack.local'
    openstack_config.vm.box = 'ubuntu/trusty64'
    openstack_config.vm.box_url = boxes['ubuntu/trusty64']['url']
    openstack_config.vm.network :private_network, ip: "10.10.10.200"

    openstack_config.vm.provider :virtualbox do |vb|
      vb.customize ["modifyvm", :id, "--memory", 512]
      vb.customize ["modifyvm", :id, "--cpus", 1]
      vb.name = 'openstack-config'
      vb.gui = false
    end

    openstack_config.vm.provision :salt do |salt|
      salt.minion_config = "minions/config.conf"
      salt.colorize = true
      salt.bootstrap_options = "-F -c /tmp -P"
    end
  
  end

  config.vm.define :openstack_control do |openstack_control|

    openstack_control.vm.hostname = 'control.openstack.local'
    openstack_control.vm.box = 'ubuntu/trusty64'
    openstack_control.vm.box_url = boxes['ubuntu/trusty64']['url']
    openstack_control.vm.network :private_network, ip: "10.10.10.201"

    openstack_control.vm.provider :virtualbox do |vb|
      vb.customize ["modifyvm", :id, "--memory", 4096]
      vb.customize ["modifyvm", :id, "--cpus", 1]
      vb.name = 'openstack-control'
      vb.gui = false
    end

    openstack_control.vm.provision :salt do |salt|
      salt.minion_config = "minions/control.conf"
      salt.colorize = true
      salt.bootstrap_options = "-F -c /tmp -P"
    end
  
  end

  config.vm.define :openstack_compute do |openstack_compute|

    openstack_compute.vm.hostname = 'compute.openstack.local'
    openstack_compute.vm.box = 'ubuntu/trusty64'
    openstack_compute.vm.box_url = boxes['ubuntu/trusty64']['url']
    openstack_compute.vm.network :private_network, ip: "10.10.10.202"

    openstack_compute.vm.provider :virtualbox do |vb|
      vb.customize ["modifyvm", :id, "--memory", 1024]
      vb.customize ["modifyvm", :id, "--cpus", 1]
      vb.name = 'openstack-compute'
      vb.gui = false
    end

    openstack_compute.vm.provision :salt do |salt|
      salt.minion_config = "minions/compute.conf"
      salt.colorize = true
      salt.bootstrap_options = "-F -c /tmp -P"
    end
  
  end

end

Salt master bootstrap from package

The salt-master bootstrap is located at scripts/bootstrap/salt- master-pkg.sh and is accessible from the virtual machine at /vagrant /bootstrap/salt-master-pkg.sh.

Salt master pip based bootstrap

The salt-master bootstrap is located at scripts/bootstrap/salt- master- pip.sh and is accessible from the virtual machine at /vagrant/bootstrap /salt-master-pip.sh.

Launching the Vagrant nodes

Check the status of the deployment environment.

$ cd /srv/vagrant-openstack
$ vagrant status

Current machine states:

openstack_config          not created (virtualbox)
openstack_control         not created (virtualbox)
openstack_compute         not created (virtualbox)

Setup OpenStack-Salt config node, launch it and connect to it using following commands, it cannot be provisioned by vagrant salt, as the salt master is not configured yet.

$ vagrant up openstack_config
$ vagrant ssh openstack_config

Bootstrap Salt master

Bootstrap the salt master service on the config node, it can be configured with following parameters:

$ export RECLASS_ADDRESS=https://github.com/tcpcloud/openstack-salt-model.git
$ export CONFIG_HOST=config.openstack.local

To deploy salt-master from packages, run on config node:

$ /vagrant/bootstrap/salt-master-pkg.sh

To deploy salt-master from pip, run on config node:

$ /vagrant/bootstrap/salt-master-pip.sh

Now setup the OpenStack-Salt control node. Launch it using following command:

$ vagrant up openstack_control

Now setup the OpenStack-Salt compute node. Launch it using following command:

$ vagrant up openstack_compute

To orchestrate the services accross all nodes, run following command on config node:

$ salt-run state.orchestrate orchestrate

The installation is now over, you should be able to access the user interface of cloud deployment at your control node.