-
Notifications
You must be signed in to change notification settings - Fork 4
/
VagrantfileStorageBackends
34 lines (30 loc) · 1.19 KB
/
VagrantfileStorageBackends
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# The number of labvms to provision
$num_labvm = (ENV['NUM_LABVMS'] || 1).to_i
# ip configuration
$labvm_ip_base = ENV['LABVM_IP_BASE'] || "192.168.100.2"
$labvm_ips = $num_labvm.times.collect { |n| $labvm_ip_base + "#{n+3}" }
#$num_labvm.times do |n|
# print $labvm_ips[n]
#end
Vagrant.configure(2) do |config|
config.vm.box = "neependra/linuxconeu"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.ssh.private_key_path = "~/.vagrant.d/insecure_private_key"
config.ssh.insert_key = false
# config.ssh.password = "vagrant"
$num_labvm.times do |n|
config.vm.define "labvm-#{n+1}" do |labvm|
labvm_index = n+1
labvm_ip = $labvm_ips[n]
labvm.vm.network "private_network", ip: "#{labvm_ip}"
labvm.vm.hostname = "lab-vm-#{labvm_index}"
end
config.vm.provider :virtualbox do |vb|
vb.customize ["createhd", "--filename", "./m4_disk0", "--size", "4096"]
vb.customize ["storagectl", :id, "--add", "sata", "--name", "SATA" , "--portcount", 2, "--hostiocache", "on"]
vb.customize ["storageattach", :id, "--storagectl", "SATA", "--port", "1", "--type", "hdd", "--medium", "./m4_disk0.vdi"]
end
end
end