forked from sikessle/htwg-lab-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
62 lines (46 loc) · 1.91 KB
/
Vagrantfile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# Download if not existing from vagrantcloud latest Ubuntu 14.04 LTS
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "htwglabcloud"
# Sync this project folder to host @ /htwg-lab-cloud
config.vm.synced_folder ".", "/htwg-lab-cloud"
# Networking
#
# eth0 provides a DHCP, we MUST NOT configure this in DevStack, otherwise
# our instances get an IP from this DHCP instead from nova-network
#
# eth0: devstack (internet)
# eth1: br100 -- vnet0,1,.. -- instances FLAT_INTERFACE
# eth2: floating IPs PUBLIC_INTERFACE
#
# eth0: NAT host access to internet (default from vagrant)
# eth1: Host-Only internal management network (good: has no dhcp from VM)
config.vm.network :private_network, ip: "192.168.35.129"
# eth2: Bridged access from outside of VM and floating IPs from -> internet
config.vm.network :public_network, ip: "192.168.1.111"
# VirtualBox specific
config.vm.provider :virtualbox do |vb|
vb.name = "htwg-lab-cloud"
# Hardware specs of VM
vb.memory = 4096
vb.cpus = 2
vb.customize ["modifyvm", :id, "--vram", "64"]
# Promiscous mode
# allow openstack guests to talk to each other on eth1, eth2
vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
# Use VPN of Host for eth0
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Headless or GUI
#vb.gui = true
end
# Install HTWG Lab Cloud on first boot
script = <<-SHELL
cd /htwg-lab-cloud
./deploy.sh
SHELL
# Use script as provisioner, run as non-root (required by devstack)
config.vm.provision "shell", inline: script, privileged: false
end