blob: a52e989d1434261295cd58e3d56a51c7459477f3 [file] [log] [blame]
Zack Williamsa7104e32018-01-03 10:55:26 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3#
4# controlkube Scenario Vagrantfile
5
6require 'yaml'
7settings = YAML.load_file('genconfig/config.yml')
8
9Vagrant.configure("2") do |config|
10
11 config.vm.box = settings["vagrant_box"]
12
13 config.vm.synced_folder '.', '/vagrant', disabled: true
14
15 # set the headnode VM
16 config.vm.define "head1" do |h|
17 h.vm.hostname = "head1"
18 h.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '0.0.0.0'
19 h.vm.provider :virtualbox do |vb|
20 vb.memory = settings['head_vm_mem']
21 vb.cpus = settings['head_vm_cpu']
22 vb.linked_clone = true
23 end
24 h.vm.provider :libvirt do |v, override|
25 v.memory = settings['head_vm_mem']
26 v.cpus = settings['head_vm_cpu']
27 end
28 h.vm.network "private_network", # management network, eth1
Zack Williams9f42b972018-01-10 15:05:35 -070029 ip: "0.1.0.0", # not used, ignore
Zack Williamsa7104e32018-01-03 10:55:26 -070030 auto_config: false,
31 virtualbox__intnet: settings['vm_management_network_name'],
32 libvirt__network_name: settings['vm_management_network_name'],
33 libvirt__forward_mode: "none",
34 libvirt__dhcp_enabled: false
Zack Williams9f42b972018-01-10 15:05:35 -070035 h.vm.network "private_network", # public network, eth2
36 ip: "0.2.0.0", # not used, ignore
37 auto_config: false,
38 virtualbox__intnet: settings['vm_public_network_name'],
39 libvirt__network_name: settings['vm_public_network_name'],
40 libvirt__forward_mode: "none",
41 libvirt__dhcp_enabled: false
Zack Williamsa7104e32018-01-03 10:55:26 -070042 end
43
44 config.vm.define "compute1" do |c|
45 c.vm.hostname = "compute1"
46 c.vm.provider :virtualbox do |vb|
47 vb.memory = settings['compute_vm_mem']
48 vb.cpus = settings['compute_vm_cpu']
49 vb.linked_clone = true
50 end
51 c.vm.provider :libvirt do |v|
52 v.memory = settings['compute_vm_mem']
53 v.cpus = settings['compute_vm_cpu']
54 end
55 c.vm.network "private_network", # management network, eth1
Zack Williams9f42b972018-01-10 15:05:35 -070056 ip: "0.1.0.0",
Zack Williamsa7104e32018-01-03 10:55:26 -070057 auto_config: false,
58 virtualbox__intnet: settings['vm_management_network_name'],
59 libvirt__network_name: settings['vm_management_network_name'],
60 libvirt__forward_mode: "none",
61 libvirt__dhcp_enabled: false
Zack Williams9f42b972018-01-10 15:05:35 -070062 c.vm.network "private_network", # public network, eth2
63 ip: "0.2.0.0", # not used, ignore
64 auto_config: false,
65 virtualbox__intnet: settings['vm_public_network_name'],
66 libvirt__network_name: settings['vm_public_network_name'],
67 libvirt__forward_mode: "none",
68 libvirt__dhcp_enabled: false
Zack Williamsa7104e32018-01-03 10:55:26 -070069 end
70
71 config.vm.define "compute2" do |c|
72 c.vm.hostname = "compute2"
73 c.vm.provider :virtualbox do |vb|
74 vb.memory = settings['compute_vm_mem']
75 vb.cpus = settings['compute_vm_cpu']
76 vb.linked_clone = true
77 end
78 c.vm.provider :libvirt do |v|
79 v.memory = settings['compute_vm_mem']
80 v.cpus = settings['compute_vm_cpu']
81 end
82 c.vm.network "private_network", # management network, eth1
Zack Williams9f42b972018-01-10 15:05:35 -070083 ip: "0.1.0.0",
Zack Williamsa7104e32018-01-03 10:55:26 -070084 auto_config: false,
85 virtualbox__intnet: settings['vm_management_network_name'],
86 libvirt__network_name: settings['vm_management_network_name'],
87 libvirt__forward_mode: "none",
88 libvirt__dhcp_enabled: false
Zack Williams9f42b972018-01-10 15:05:35 -070089 c.vm.network "private_network", # public network, eth2
90 ip: "0.2.0.0", # not used, ignore
91 auto_config: false,
92 virtualbox__intnet: settings['vm_public_network_name'],
93 libvirt__network_name: settings['vm_public_network_name'],
94 libvirt__forward_mode: "none",
95 libvirt__dhcp_enabled: false
Zack Williamsa7104e32018-01-03 10:55:26 -070096 end
97end
98