From 816e4fe8791e96a74c76df2e823e0e7c39be3428 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Sat, 4 Apr 2015 11:50:01 +0100 Subject: [PATCH] Support Vagrant Libvirt Change-Id: Ic5e56697cdb5c311d0715d665321e83b70d823c6 --- contrib/vagrant/Vagrantfile | 40 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/contrib/vagrant/Vagrantfile b/contrib/vagrant/Vagrantfile index 82889a608..90f15f1eb 100644 --- a/contrib/vagrant/Vagrantfile +++ b/contrib/vagrant/Vagrantfile @@ -6,25 +6,45 @@ Vagrant.require_version ">= 1.5" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.ssh.forward_agent = true - config.vm.synced_folder "../..", "/opt/stack/designate" - config.vm.network "forwarded_port", guest: 5354, host: 5354, protocol: "tcp" config.vm.network "forwarded_port", guest: 5354, host: 5354, protocol: "udp" - if File.directory?("../../../python-designateclient") - config.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient" - end - - if File.directory?("../../../../stackforge/rally") - config.vm.synced_folder "../../../../stackforge/rally", "/opt/stack/rally" - end - config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--memory", "2048"] if not RUBY_PLATFORM.downcase.include?("mswin") vb.customize ["modifyvm", :id, "--cpus", `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ] end vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] + + config.vm.synced_folder "../..", "/opt/stack/designate" + + if File.directory?("../../../python-designateclient") + config.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient" + end + + if File.directory?("../../../../stackforge/rally") + config.vm.synced_folder "../../../../stackforge/rally", "/opt/stack/rally" + end + end + + config.vm.provider :libvirt do |lv| + lv.graphics_ip = '0.0.0.0' + lv.nested = true + lv.memory = 8192 + if not RUBY_PLATFORM.downcase.include?("mswin") + lv.cpus = `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp + end + + config.vm.synced_folder ".", "/vagrant", type: "nfs" + config.vm.synced_folder "../..", "/opt/stack/designate", type: "nfs" + + if File.directory?("../../../python-designateclient") + config.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient", type: "nfs" + end + + if File.directory?("../../../../stackforge/rally") + config.vm.synced_folder "../../../../stackforge/rally", "/opt/stack/rally", type: "nfs" + end end $script = <