-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
37 lines (35 loc) · 1.05 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
def ip2mac(prefix, str_ip)
@mac=prefix
str_ip.split('.').each do |k|
k="%02x" % k
@mac=@mac+":"+k.to_s
end
return @mac
end
Vagrant.configure("2") do |config|
(11..11).each do |i|
config.vm.define "harv#{i}" do |node|
node.ssh.username = 'rancher'
node.ssh.password = 'vagrant'
node.ssh.insert_key = false
node.vm.box = "futuretea/harvester"
node.vm.box_version = "0.1.0"
node.vm.guest = 'linux'
node.vm.hostname = "harv#{i}"
node.vm.synced_folder '.', '/vagrant', disabled: true
node.vm.provider :libvirt do |domain|
domain.driver = 'kvm'
domain.memory = 16384
domain.cpus = 8
domain.nested = true
domain.management_network_name = "harv"
domain.management_network_address = "10.5.6.0/24"
domain.management_network_mac = ip2mac("50:50","10.5.6.#{i}")
domain.storage :file, :size => '2048G', :bus => 'virtio'
domain.storage :file, :size => '1024G', :bus => 'virtio'
end
end
end
end