Zack Williams | a1f5508 | 2017-02-28 22:41:36 -0700 | [diff] [blame^] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | # |
| 4 | # OpenCloud-in-a-Box Vagrantfile |
| 5 | require 'yaml' |
| 6 | settings = YAML.load_file('config/opencloud_in_a_box.yaml') |
| 7 | |
| 8 | Vagrant.configure(2) do |config| |
| 9 | |
| 10 | config.vm.box = "ubuntu/trusty64" |
| 11 | |
| 12 | config.vm.define "head1" do |h| |
| 13 | h.vm.hostname = "head1" |
| 14 | h.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: '*' |
| 15 | h.vm.provider :libvirt do |v| |
| 16 | v.memory = 16384 |
| 17 | v.cpus = 8 |
| 18 | v.machine_virtual_size = 100 |
| 19 | v.management_network_name = settings['public_network_name'] # public network |
| 20 | v.management_network_address = settings['public_network_cidr'] |
| 21 | end |
| 22 | h.vm.network "private_network", # management network, eth1 |
| 23 | ip: "0.1.1.0", # not used, ignore |
| 24 | auto_config: false, |
| 25 | libvirt__network_name: settings['mgmt_network'], |
| 26 | libvirt__forward_mode: "none", |
| 27 | libvirt__dhcp_enabled: false |
| 28 | end |
| 29 | |
| 30 | config.vm.define "compute1" do |c| |
| 31 | c.vm.hostname = "compute1" |
| 32 | c.vm.provider :libvirt do |v| |
| 33 | v.memory = 8192 |
| 34 | v.cpus = 4 |
| 35 | v.machine_virtual_size = 50 |
| 36 | v.nested = true |
| 37 | v.management_network_name = settings['public_network_name'] # public network |
| 38 | v.management_network_address = settings['public_network_cidr'] |
| 39 | end |
| 40 | c.vm.network "private_network", # management network, eth1 |
| 41 | ip: "0.1.1.0", |
| 42 | auto_config: false, |
| 43 | libvirt__network_name: settings['mgmt_network'], |
| 44 | libvirt__forward_mode: "none", |
| 45 | libvirt__dhcp_enabled: false |
| 46 | end |
| 47 | |
| 48 | config.vm.define "compute2" do |c| |
| 49 | c.vm.hostname = "compute2" |
| 50 | c.vm.provider :libvirt do |v| |
| 51 | v.memory = 8192 |
| 52 | v.cpus = 4 |
| 53 | v.machine_virtual_size = 50 |
| 54 | v.nested = true |
| 55 | v.management_network_name = settings['public_network_name'] # public network |
| 56 | v.management_network_address = settings['public_network_cidr'] |
| 57 | end |
| 58 | c.vm.network "private_network", # management network, eth1 |
| 59 | ip: "0.1.1.0", |
| 60 | auto_config: false, |
| 61 | libvirt__network_name: settings['mgmt_network'], |
| 62 | libvirt__forward_mode: "none", |
| 63 | libvirt__dhcp_enabled: false |
| 64 | end |
| 65 | |
| 66 | end |