Merge pull request #145 from loles/libvirt

Libvirt support
This commit is contained in:
Dmitry Shulyak 2015-09-15 17:13:32 +03:00
commit c3278c7cf2
2 changed files with 38 additions and 4 deletions

16
Vagrantfile vendored
View File

@ -47,10 +47,7 @@ slave_celery = ansible_playbook_command("celery.yaml", ["--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
@ -68,6 +65,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|
@ -92,6 +95,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
```