From 1c2130d84fdf46ae9a187af20489f815326a8f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Mon, 14 Sep 2015 18:31:07 +0200 Subject: [PATCH] Libvirt support --- Vagrantfile | 16 ++++++++++++---- docs/libvirt.md | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 docs/libvirt.md diff --git a/Vagrantfile b/Vagrantfile index 3c5a87a8..2379b50e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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 diff --git a/docs/libvirt.md b/docs/libvirt.md new file mode 100644 index 00000000..04d7da4d --- /dev/null +++ b/docs/libvirt.md @@ -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 +```