Created
December 29, 2015 07:49
-
-
Save cp16net/e9fea8b8e6a5170757e9 to your computer and use it in GitHub Desktop.
Test VagrantFile for KVM with nested enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt' | |
Vagrant.configure("2") do |config| | |
if Vagrant.has_plugin?("vagrant-cachier") | |
config.cache.scope = :box | |
end | |
config.vm.define :devstack do |machine| | |
# It should be an Ubuntu 14.04 box | |
machine.vm.box = "ubuntu-1404-server" | |
# networking | |
machine.vm.network "private_network", ip: '192.168.33.11' | |
# machine.vm.network "public_network" | |
machine.vm.network "forwarded_port", guest: 80, host: 8080 | |
# With so much RAM and CPUs | |
machine.vm.provider :libvirt do |domain| | |
domain.memory = 16384 | |
domain.cpus = 4 | |
domain.nested = true | |
end | |
# Finally, let's provision it by running a script. You can also run | |
# puppet, chef, ansible, and others. Check the Vagrant website for | |
# details. | |
# machine.vm.provision :shell, path: "bootstrap.sh", args: "42", keep_color: true | |
# share the development directories with the vm | |
# machine.vm.synced_folder "../", "/trove", owner: "vagrant", group: "vagrant" | |
# machine.vm.synced_folder "../trove", "/opt/stack/trove", | |
# owner: "vagrant", group: "vagrant", type: "rsync", rsync__exclude: [".tox/", "*.egg-info/", "*.log", "*.sqlite"] | |
# machine.vm.synced_folder "../trove-integration", "/opt/stack/trove-integration", | |
# owner: "vagrant", group: "vagrant", type: "rsync", rsync__exclude: [".tox/", "*.egg-info/", "*.log", "*.sqlite"] | |
# machine.vm.synced_folder "../python-troveclient", "/opt/stack/python-troveclient", | |
# owner: "vagrant", group: "vagrant", type: "rsync", rsync__exclude: [".tox/", "*.egg-info/", "*.log", "*.sqlite"] | |
# machine.vm.synced_folder "../trove-tester", "/opt/stack/trove-tester", | |
# owner: "vagrant", group: "vagrant", type: "rsync", rsync__exclude: [".tox/", "*.egg-info/", "*.log", "*.sqlite"] | |
# machine.vm.provision :shell, :inline => <<-SCRIPT | |
# printf '\nexport USING_VAGRANT=true' >> /home/vagrant/.bashrc | |
# printf '\nexport USE_LARGE_VOLUME=true' >> /home/vagrant/.bashrc | |
# SCRIPT | |
machine.vm.provision :shell, :inline => <<-SCRIPT | |
apt-get update | |
apt-get -y install git curl wget build-essential python-mysqldb \ | |
python-dev libssl-dev python-pip git-core libxml2-dev libxslt-dev \ | |
python-pip libmysqlclient-dev screen emacs24-nox \ | |
libsasl2-dev tmux | |
pip install virtualenv | |
pip install tox==1.6.1 | |
pip install setuptools | |
mkdir -p /opt/stack | |
chown vagrant /opt/stack | |
SCRIPT | |
# machine.vm.provision "shell", path: "prep.sh", args: "vagrant" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment