LAB ONE
21.	Oct	2016			|		BERATUNG@FLORIANHEIGL.ME
Vagrant running on OpenNebula?
what I do
Sysadmin,	Consultant
I	need	to	test	shiny	new	things	for	other	people
I	need	to	pin	down	bugs	noone	ever	noticed
• avg	95	browser	tabs
• aaand	100‘s	more	in	OneTab
Present	new	things:	Use	Vagrant	on	my	MacBook
Lab	ONE
Test new things
Vagrant	is	nice	at	times
Containers:	Just	application	deployment
I	need	a	“full	stack“
Describe	whole	environments
Vagrant	can	do	that,	but:
Sysadmin	stuff	might	need	10+	VMs	just	to	show	basics
(Demoing	datacenter management,	clouds,	etc...)
FrOSCon	demo:	~70	VMs	running	Rudder	Project.
Lab	ONE
Vagrant for Sysadmin
Lab	ONE
Virtualbox
→	Scales	badly	(Overhead)
→	Unstable	10+	VMs
→	portable 32GB	laptops	are	rare		
Why	is	it	we	running	on	laptops if	
we	have	servers???
Lab	ONE
Vagrant provider
opennebula-provider
• Exists	since	early	2015
• By	Evgeni	Cherdancev
• First	based	on	rOCCI,	then	FOG
• Fog	uses	RPC2
• Docs	‘fly	on	thin	air‘	(Cloudy)
• Does	most	of	what	you	need
• https://github.com/eucher/opennebula-provider/
Lab	ONE
Base config
Lab	ONE
ONE-host
Grab	a	random box
• Leftover	from	Check_MK	training
• Spin	up	at	Scaleway
• Rudder		managed
• autoinstalled	ONE
• local	SSD
Lab	ONE
Install
Make	it	work
install	1	rubygem: fog
install	vagrant	plugins:
• opennebula-provider	(1.1.2)
• vagrant-proxyconf	(1.5.2)
• vagrant-share	(1.1.5,	system)
• vagrant-skytap	(0.3.4)
• vagrant-sshfs	(1.2.0)
Dedicated user	created	from	Sunstone
(This	user	will	be	on	someones	computer)
Lab	ONE
Bootup
Lab	ONE
Tuning
The	WaitForCommunicator	thing
Vagrant	won‘t	wait	for	VM	startup!
Boot	Timeout	settings	don‘t	work!
EUNREACHABLE
Class:	Vagrant::Action::Builtin::WaitForCommunicator	->	no	error	
handling	(BAAAAD)
Class:	VagrantPlugins::Skytap::Action::WaitForCommunicator	->	has	
error	handling	(GOOOOOOD)
Lab	ONE
Patch
The	Ruby	smiley!
.vagrant.d/gems/gems/opennebula-provider-1.1.2/
lib/opennebula-provider/action.rb
Lab	ONE
Usage
Summary
find	a Vagrantfile
adjust	Vagrantfile
vagrant	up
vagrant	destroy
vagrant	up	–provision
Lab	ONE
Bootup
Lab	ONE
Running!
Lab	ONE
Limitations
Use	Template	ID	or	newest	Template	ID	resolved	by	Name
Memory	settings:	yes
Shared	folders:	rsync	(default)	or	SSHFS		(little	tricky)
DO	NOT	set	hostname if	one-context	does
(/etc/hosts	might	go	to	hell)
Doesn‘t	download	vagrantbox.es
Adjust	networks:	no(*)
(*it‘s	not	OCCI	after	all)
Lab	ONE
Private Networks
how	about	unlimited private	networks?
brnatN	on	ONE-host
ip	range	/	gw	managed	by	ONE
iptables	nat	or	vrouter
normal	one-context
Just	set	up	OpenVPN	access	to	ONE-host
push	the	route!
=>	can	‚vagrant	ssh‘	to	machine
Lab	ONE
ONE	Vagrant	provider	
does	it	all!
Offload	workloads	from	
Virtualbox	to	ONE
Hand	out	easy	but	
restricted	API	access	to	
devs	for	tests,	QA	and	
raw	performance
With	ruby	skills,	config	
can	autoselect	provider
(or	vagrant	up	–provider)
Use	your	cloud more	often give	choice
Lab	ONE
26.	Oct	2016			|		BERATUNG@FLORIANHEIGL.ME

OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl