blob: 91ad1bda831c29ed01b0a03f24c66110f44982e2 [file] [log] [blame]
Zack Williamsa1f55082017-02-28 22:41:36 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3#
Zack Williamsce63eb02017-02-28 10:46:22 -07004# opencloud Vagrantfile
5
Zack Williamsa1f55082017-02-28 22:41:36 -07006require 'yaml'
Zack Williamsce63eb02017-02-28 10:46:22 -07007settings = YAML.load_file('genconfig/config.yml')
Zack Williamsa1f55082017-02-28 22:41:36 -07008
9Vagrant.configure(2) do |config|
10
11 config.vm.box = "ubuntu/trusty64"
12
13 config.vm.define "head1" do |h|
14 h.vm.hostname = "head1"
15 h.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*'
16 h.vm.provider :libvirt do |v|
Zack Williamsce63eb02017-02-28 10:46:22 -070017 v.memory = settings['head_vm_mem']
18 v.cpus = settings['head_vm_cpu']
Zack Williamsa1f55082017-02-28 22:41:36 -070019 v.machine_virtual_size = 100
20 v.management_network_name = settings['public_network_name'] # public network
21 v.management_network_address = settings['public_network_cidr']
22 end
23 h.vm.network "private_network", # management network, eth1
24 ip: "0.1.1.0", # not used, ignore
25 auto_config: false,
Zack Williamsce63eb02017-02-28 10:46:22 -070026 libvirt__network_name: settings['mgmt_network_name'],
Zack Williamsa1f55082017-02-28 22:41:36 -070027 libvirt__forward_mode: "none",
28 libvirt__dhcp_enabled: false
29 end
30
31 config.vm.define "compute1" do |c|
32 c.vm.hostname = "compute1"
33 c.vm.provider :libvirt do |v|
Zack Williamsce63eb02017-02-28 10:46:22 -070034 v.memory = settings['compute_vm_mem']
35 v.cpus = settings['compute_vm_cpu']
Zack Williamsa1f55082017-02-28 22:41:36 -070036 v.machine_virtual_size = 50
37 v.nested = true
38 v.management_network_name = settings['public_network_name'] # public network
39 v.management_network_address = settings['public_network_cidr']
40 end
41 c.vm.network "private_network", # management network, eth1
42 ip: "0.1.1.0",
43 auto_config: false,
Zack Williamsce63eb02017-02-28 10:46:22 -070044 libvirt__network_name: settings['mgmt_network_name'],
Zack Williamsa1f55082017-02-28 22:41:36 -070045 libvirt__forward_mode: "none",
46 libvirt__dhcp_enabled: false
47 end
48
49 config.vm.define "compute2" do |c|
50 c.vm.hostname = "compute2"
51 c.vm.provider :libvirt do |v|
Zack Williamsce63eb02017-02-28 10:46:22 -070052 v.memory = settings['compute_vm_mem']
53 v.cpus = settings['compute_vm_cpu']
Zack Williamsa1f55082017-02-28 22:41:36 -070054 v.machine_virtual_size = 50
55 v.nested = true
56 v.management_network_name = settings['public_network_name'] # public network
57 v.management_network_address = settings['public_network_cidr']
58 end
59 c.vm.network "private_network", # management network, eth1
60 ip: "0.1.1.0",
61 auto_config: false,
Zack Williamsce63eb02017-02-28 10:46:22 -070062 libvirt__network_name: settings['mgmt_network_name'],
Zack Williamsa1f55082017-02-28 22:41:36 -070063 libvirt__forward_mode: "none",
64 libvirt__dhcp_enabled: false
65 end
66
67end
Zack Williamsce63eb02017-02-28 10:46:22 -070068