Libvirt support

This commit is contained in:
Łukasz Oleś 2015-09-14 18:31:07 +02:00
parent ae77c0a5a4
commit 1c2130d84f
2 changed files with 38 additions and 4 deletions

16
Vagrantfile vendored
View File

@ -34,10 +34,7 @@ slave_celery = ansible_playbook_command("celery.yml", ["--skip-tags", "master"])
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "solar-dev", primary: true do |config|
#config.vm.box = "deb/jessie-amd64"
#config.vm.box = "rustyrobot/deb-jessie-amd64"
#config.vm.box = "ubuntu/trusty64"
config.vm.box = "cgenie/solar-master"
config.vm.box = "cgenie/solar-master"
config.vm.provision "shell", inline: solar_script, privileged: true
config.vm.provision "shell", inline: master_celery, privileged: true
@ -54,6 +51,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
]
v.name = "solar-dev"
end
config.vm.provider:libvirt do |libvirt|
config.vm.synced_folder ".", "/vagrant", type: "9p", disabled: false, accessmode: "mapped"
libvirt.driver = 'kvm'
libvirt.memory = MASTER_RAM
end
end
SLAVES_COUNT.times do |i|
@ -78,6 +81,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
]
v.name = "solar-dev#{index}"
end
config.vm.provider:libvirt do |libvirt|
config.vm.synced_folder ".", "/vagrant", type: "9p", disabled: false, accessmode: "mapped"
libvirt.driver = 'kvm'
libvirt.memory = SLAVES_RAM
end
end
end

26
docs/libvirt.md Normal file
View File

@ -0,0 +1,26 @@
# Using Vagrant with livbirt
First install libvirt plugin
```bash
vagrant plugin install vagrant-libvirt
```
If you do not have already vagrant box for VirtualBox, install it:
```bash
vagrant box add cgenie/solar-master
```
To use this box in libvirt you need to convert it using `vagrant-mutate` plugin:
```bash
vagrant plugin install vagrant-mutate
vagrant mutate cgenie/solar-master libvirt
```
# Use solar
``` bash
vagrant up --provider libvirt
```