-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
83 lines (67 loc) · 2.56 KB
/
Vagrantfile
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
78
79
80
81
82
83
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
IP_VLAN = "192.168.50."
TRACKER_BASE_IP = 250
SEEDER_AMOUNT = 1 # max. 98
SEEDER_BASE_IP = 1
PEERFLIX_AMOUNT = 9 # max. 149
PEERFLIX_BASE_IP = 100
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "TFDuesing/Fedora-20"
config.vm.provider "vmware_workstation" do |v|
v.vmx["memsize"] = "512"
v.vmx["numvcpus"] = "2"
end
config.vm.define "tracker" do |tracker|
tracker.vm.hostname = "pf-tracker"
tracker.vm.network "private_network", ip: "#{IP_VLAN}#{TRACKER_BASE_IP}"
tracker.vm.provision :shell, :path => "provision/tracker.sh"
tracker.vm.provider "vmware_workstation" do |v|
# Limitations on download
v.vmx["ethernet1.rxbw.limit"] = "100000" # Kbps
v.vmx["ethernet1.rxfi.droprate"] = "0" # * 0.1%
v.vmx["ethernet1.rxfi.dropsize"] = "0" # set to 1 if droprate > 0
# Limitations on upload
v.vmx["ethernet1.txbw.limit"] = "100000" # Kbps
v.vmx["ethernet1.txfi.droprate"] = "0" # * 0.1%
v.vmx["ethernet1.txfi.dropsize"] = "0" # set to 1 if droprate > 0
end
end
(1..SEEDER_AMOUNT).each do |i|
config.vm.define "seeder-#{i}" do |seeder|
nodeId = SEEDER_BASE_IP + i
seeder.vm.hostname = "pf-seeder-#{i}"
seeder.vm.network "private_network", ip: "#{IP_VLAN}#{nodeId}"
seeder.vm.provision :shell, :path => "provision/seeder.sh"
seeder.vm.provider "vmware_workstation" do |v|
# Limitations on download
v.vmx["ethernet1.rxbw.limit"] = "2048" # Kbps
v.vmx["ethernet1.rxfi.droprate"] = "0" # * 0.1%
v.vmx["ethernet1.rxfi.dropsize"] = "0" # set to 1 if droprate > 0
# Limitations on upload
v.vmx["ethernet1.txbw.limit"] = "2048" # Kbps
v.vmx["ethernet1.txfi.droprate"] = "0" # * 0.1%
v.vmx["ethernet1.txfi.dropsize"] = "0" # set to 1 if droprate > 0
end
end
end
(1..PEERFLIX_AMOUNT).each do |i|
config.vm.define "peerflix-#{i}" do |peerflix|
nodeId = PEERFLIX_BASE_IP + i
peerflix.vm.hostname = "pf-peerflix-#{i}"
peerflix.vm.network "private_network", ip: "#{IP_VLAN}#{nodeId}"
peerflix.vm.provision :shell, :path => "provision/peerflix.sh"
peerflix.vm.provider "vmware_workstation" do |v|
# Limitations on download
v.vmx["ethernet1.rxbw.limit"] = "1024" # Kbps
v.vmx["ethernet1.rxfi.droprate"] = "0" # * 0.1%
v.vmx["ethernet1.rxfi.dropsize"] = "0" # set to 1 if droprate > 0
# Limitations on upload
v.vmx["ethernet1.txbw.limit"] = "1024" # Kbps
v.vmx["ethernet1.txfi.droprate"] = "0" # * 0.1%
v.vmx["ethernet1.txfi.dropsize"] = "0" # set to 1 if droprate > 0
end
end
end
end