Skip to content

Commit

Permalink
Fix libvirt integration for multi-nets
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
  • Loading branch information
Bogdan Dobrelya committed Oct 9, 2015
1 parent 8dfa294 commit 3457ccc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 40 deletions.
21 changes: 0 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,6 @@ For details see Customizing `vagrant-settings.yaml` section.
Setup environment:
```bash
cd solar
```
* 1. Configure vagrant-settings.yml, for example:
```
vagrant_provider: virtualbox
vagrant_box: cgenie/solar-master
slaves_count: 2
slaves_ram: 2048
slaves_cpu: 2
slaves_ips:
- 10.0.0.
- 10.1.0.
- 192.168.121.
master_ram: 2048
master_cpu: 2
master_ips:
- 10.0.0.2
- 10.1.0.2
- 192.168.121.12
```
* 2. Provision the env
```
vagrant up
```

Expand Down
7 changes: 3 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
"--cpus", MASTER_CPUS,
"--ioapic", "on",
]

if PARAVIRT_PROVIDER
v.customize ['modifyvm', :id, "--paravirtprovider", PARAVIRT_PROVIDER] # for linux guest
end
v.name = "solar-dev"
end

config.vm.provider :libvirt do |libvirt|
Expand Down Expand Up @@ -115,7 +115,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
ip_index = i + 3
config.vm.define "solar-dev#{index}" do |config|
# standard box with all stuff preinstalled
config.vm.box = "cgenie/solar-master"
config.vm.box = SLAVES_IMAGE

config.vm.provision "file", source: "bootstrap/ansible.cfg", destination: "/home/vagrant/.ansible.cfg"
Expand All @@ -131,10 +130,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
"--cpus", SLAVES_CPUS,
"--ioapic", "on",
]

if PARAVIRT_PROVIDER
v.customize ['modifyvm', :id, "--paravirtprovider", PARAVIRT_PROVIDER] # for linux guest
end
v.name = "solar-dev#{index}"
end

config.vm.provider :libvirt do |libvirt|
Expand All @@ -155,7 +154,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

index = 0
SLAVE_IPS.each do |ip|
SLAVES_IPS.each do |ip|
begin
# try to configure libvirt network
config.vm.network :private_network, ip: "#{ip}#{ip_index}", :dev => "solbr#{index}", :mode => 'nat'
Expand Down
18 changes: 3 additions & 15 deletions examples/bootstrap/vagrant-settings.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# rename it to vagrant-settings.yml then Vagrantfile
# will use values from this file
vagrant_provider: virtualbox
vagrant_box: cgenie/solar-master
slaves_count: 2
slaves_ram: 1024
slaves_cpu: 1
slaves_ips:
- 10.0.0.
- 10.1.0.
- 192.168.121.
master_ram: 1024
master_cpu: 1
master_ips:
- 10.0.0.2
- 10.1.0.2
- 192.168.121.12

slaves_count: 3
slaves_image: ubuntu/trusty64
8 changes: 8 additions & 0 deletions vagrant-settings.yaml_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ master_image: solar-project/solar-master
slaves_image: solar-project/solar-master
master_ram: 1024
master_cpus: 1
master_ips:
- 10.0.0.2
- 10.1.0.2
- 192.168.121.12
slaves_cpus: 1
slaves_ips:
- 10.0.0.
- 10.1.0.
- 192.168.121.

# if you have virtualbox 5.x then enable it
# if will speedup things a lot
Expand Down

0 comments on commit 3457ccc

Please sign in to comment.