openstack vagrant plugin overview

13
1

Upload: marton-kiss

Post on 22-May-2015

1.101 views

Category:

Software


0 download

DESCRIPTION

A quick overview of Openstack vagrant plugin with hpcloud backend.

TRANSCRIPT

Page 1: Openstack Vagrant plugin overview

1

Page 2: Openstack Vagrant plugin overview

2

Openstack as a Vagrant Pluginquick overview of vagrant based vm provisioning

Márton KissOpenstack [email protected]@marton_kiss

Page 3: Openstack Vagrant plugin overview

3

A tool to avoid works for me errors!

/// WHAT IS VAGRANT ///

Page 4: Openstack Vagrant plugin overview

4

1. deploy a vagranthttp://www.vagrantup.com/downloads.html

2. install Openstack plugin$ vagrant plugin install vagrant-openstack-plugin

/// INSTALL VAGRANT TOOLSET ///

Page 5: Openstack Vagrant plugin overview

5

!

$ vagrant box add dummy https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box

/// PREPARE OPENSTACK DUMMY BOX ///

Page 6: Openstack Vagrant plugin overview

6

require 'vagrant-openstack-plugin' Vagrant.configure("2") do |config| config.vm.box = “dummy" # Make sure the private key from the key pair is provided config.ssh.private_key_path = "~/.ssh/id_dsa" ! config.vm.provider :openstack do |os| os.username = ENV['OS_USERNAME'] os.api_key = ENV['OS_PASSWORD'] os.tenant = ENV['OS_TENANT_NAME'] os.region = "region-a.geo-1" os.flavor = /standard.xsmall/ os.image = /20140408/ os.endpoint = "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens" os.keypair_name = "default-keypair" os.ssh_username = "ubuntu" os.floating_ip = "15.125.106.143" end ! # Provision config.vm.provision :shell, :path => "scripts/bootstrap.sh" end

/// Vagrantfile ///

Page 7: Openstack Vagrant plugin overview

7

#!/bin/bash !echo "Custom bootstrap" touch /tmp/H3llo

/// scripts/bootstrap.sh ///

Page 8: Openstack Vagrant plugin overview

8

export OS_USERNAME=user-name export OS_PASSWORD=password export OS_TENANT_NAME=tenant-name

/// openrc file ///

Page 9: Openstack Vagrant plugin overview

9

/// get tenant name ///

Page 10: Openstack Vagrant plugin overview

10

/// vagrant up ///

Page 11: Openstack Vagrant plugin overview

11

vagrant ssh - login to provisioned instancevagrant provision - rerun provisioning scripts (shell script, puppet, etc.)vagrant destroy -f - destroy the instance

/// Use standard vagrant commands ///

Page 12: Openstack Vagrant plugin overview

12

- minimal rsync support- don’t place sensitive data next to Vagrantfile, it is synced to /vagrant directory inside vm

/// Limitations ///

Page 13: Openstack Vagrant plugin overview

13

?/// Questions ///