Devstack Installation with Vagrant¶
This documentation is for introducing a deployment tool for Tacker.
You can find a basic installation for deploying
OpenStack environment using devstack
as a part of
Tacker Installation Guide.
This guide expects you have already setup your VMs and installed all
packages required to run OpenStack.
However, it’s something annoying for beginners, or developers frequently cleanup their environment. You may want to use a tool to shortcut such a tasks. This tool enables you to deploy several usecases with minimal effort.
How to Use¶
Install Required Tools¶
This installer consists of vagrant
and ansible
.
Please follow instructions on official sites for installation.
Note
In this documentation, it’s supposed you use
VirtualBox, but you can use any other
hypervisor supported by vagrant
.
You should install plugin vagrant-disksize
before launching your VMs
to enable to expand size of volume of VMs. It is because the default size
of box is fixed and not enough for deploying Tacker.
$ vagrant plugin install vagrant-disksize
Setup Configuration File¶
Note
Create your ssh key before running this tool to enable to direct login
with auto-generated ssh config although you can still do two step login
starts from vagrant ssh
. You can login to controller
host with
auto-generated config ssh_config
as below.
$ ssh -F /path/to/tacker/vagrant/devstack/ssh_config controller
Setup machines.yml
which is a config file defines parameters of each
VM you deploy.
You can find some templates of machines.yml
in samples
directory.
This config file should be placed at /path/to/tacker/vagrant/devstack
while running vagrant up
, or failed to run the command.
$ cd /path/to/tacker/vagrant/devstack
$ cp samples/machines.yml ./
$ YOUR_FAVORITE_EDITOR machines.yml
As named as machines.yml
, it defines parameters of each VMs.
There are two top sections in the file, global
and machines
.
The former one defines common parameters among the VMs, and later one
is for each VM.
Note
global
is optional currently and only one parameter under the section
is ssh_pub_key
for specifying its location explicitly. You don’t need
to use it if your public key is $HOME/.ssh/id_rsa.pub
.
Here is an example of machine.yml
. It’s is for single node usecase
and machines
has only one entry.
global:
# (optional) Path of your SSH public key. Default is "~/.ssh/id_ed25519.pub".
#ssh_pub_key: "~/.ssh/id_ed25519.pub"
machines:
- hostname: controller
provider: virtualbox
# Refer to the supported boxes in "Requirements" section in README.md
box: bento/ubuntu-22.04
nof_cpus: 4
mem_size: 12
disk_size: 160
private_ips:
- 192.168.56.11
public_ips:
fwd_port_list:
- guest: 80
host: 20080
There are several parameters for each VM supported in this tool.
Attribute |
Description |
---|---|
hostname |
Any hostname for convenience, such as |
provider |
Vagrant box provider. |
box |
Name of the box. |
nof_cpus |
The number of CPUs assigned to the VM. |
mem_size |
The size of memory assigned to the VM. |
disk_size |
The size of disk assigned to the VM. |
private_ips |
Series of private IPs. |
public_ips |
Series of public IPs. |
fwd_port_list |
Series of combination of |
You also update entries of IP addresses in the inventory file
hosts
as you defined each private_ips
in machines.yml
.
Now, you are ready to fire up the VMs and deploying OpenStack with
ansible
.
Deploy OpenStack with Devstack¶
Run vagrant up
so that launches VMs and create stack
user on them.
$ vagrant up
If vagrant up
is completed successfully, you can login to the VMs as
stack
user with your ssh public key.
This tool provides ansible
playbooks for setting up devstack
installation. You don’t need to modify the playbooks usually, but
configurable in group_vars/all.yml
. See Options Configuration
describing how you configure the file.
$ ansible-playbook -i hosts site.yaml
After finished all tasks, you can login to the launched VMs. So, login to
controller node and run stack.sh
for installing OpenStack.
You will find out that local.conf
is already prepared for your
environment.
See instruction how to configure local.conf
described in
DevStack Quick Start
if you customize it furthermore by yourself.
$ ssh stack@192.168.56.11
$ cd devstack
$ YOUR_FAVORITE_EDITOR local.conf
$ ./stack.sh
Options Configuration¶
There some parameters in group_vars/all.yml
such as password on
devstack or optional configurations. You don’t need to update it usually.
---
# 1. Devstack params
# common
admin_password: devstack
database_password: devstack
rabbit_password: devstack
service_password: devstack
# controller
service_token: devstack
# compute nodes
service_host: 192.168.56.11
floating_range: 192.168.56.128/25
fixed_range: 10.4.128.0/20
# 2. Configure optional tools on controller node
# Use the latest stable Neovim.
use_neovim: true
# Use the latest vim on `ppa:jonathonf/vim`, and use plugins with
# vim-plug.
use_vim_latest: false
use_vim_extra_plugins: false
# Clone tacker in addition to devstack.
use_tacker: true
# Use tools useful for developing.
use_extra_tools: true
Developer Tools¶
In the playbools, installation of vim and some extra packages is included
for developers. If you exclude such a developer tools, modify
group_vars/all.yml
before running ansible-playbook
command.
Parameter |
Description |
---|---|
use_vim_latest |
(Only for ubuntu) |
use_vim_extra_plugins |
|
use_extra_tools |
true or false for using extra packages bellow.- jq
- htop (Ubuntu only)
- lnav (Ubuntu only)
|