-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile.BTRFS
77 lines (60 loc) · 2.53 KB
/
Vagrantfile.BTRFS
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- mode: ruby -*-
# Options {{{
#
VM_MEMORY = "2048"
VM_CPUS = "2"
BTRFS_HDD = "4096"
#
# }}}
Vagrant.require_version ">= 1.8.5"
# Vagrant 2.0.x {{{
#
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box_check_update = false
config.vm.boot_timeout = 300
config.vm.provision :shell, :path => "vagrant_bootstrap/btrfs.sh"
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.vm.synced_folder "./", "/vagrant", id: "vagrant-root"
config.vbguest.auto_update = true
config.vbguest.no_remote = false
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
config.cache.synced_folder_opts = {
type: :nfs,
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
}
end
config.vm.define "master", primary: true do |master|
master.vm.hostname = "ldl-master"
master.vm.network :private_network, ip: "48.44.44.44"
master.vm.provider :virtualbox do |vb|
vb.name = "ldl-master"
vb.customize ["modifyvm", :id, "--memory", VM_MEMORY]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", VM_CPUS]
unless File.exist?("ldl_master_btrfs_disk0.vdi")
vb.customize ["createhd", "--filename", "ldl_master_btrfs_disk0.vdi", "--size", BTRFS_HDD]
end
vb.customize ["storageattach", :id, "--storagectl", "SCSI Controller", "--port", "2", "--type", "hdd", "--medium", "ldl_master_btrfs_disk0.vdi"]
end
end
config.vm.define "slave" do |slave|
slave.vm.hostname = "ldl-slave"
slave.vm.network :private_network, ip: "49.44.44.44"
slave.vm.provider :virtualbox do |vb|
vb.name = "ldl-slave"
vb.customize ["modifyvm", :id, "--memory", VM_MEMORY]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", VM_CPUS]
vb.customize ["createhd", "--filename", "ldl_slave_btrfs_disk0", "--size", BTRFS_HDD]
vb.customize ["storageattach", :id, "--storagectl", "SCSI Controller", "--port", "2", "--type", "hdd", "--medium", "ldl_slave_btrfs_disk0.vdi"]
end
end
end
#
# }}}