Add vagrantfile for AIO testing

This patch adds a vagrantfile which enables the build
of an All-In-One (AIO) using vagrant and virtualbox.

Change-Id: Ief7bcac92f06a5dab709639bf281f23c12b84e45
This commit is contained in:
Jesse Pretorius 2017-02-26 12:56:41 +00:00
parent f438c65028
commit dfdda46239
1 changed files with 52 additions and 0 deletions

52
Vagrantfile vendored Normal file
View File

@ -0,0 +1,52 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provider "virtualbox" do |v|
v.name = "OpenStack-Ansible_#{Time.now.getutc.to_i}"
v.memory = 8192
v.cpus = 4
image_path = "#{ENV["HOME"]}/VirtualBox VMs/#{v.name}"
image_name = 'ubuntu-xenial-16.04-cloudimg'
# We clone the image to a resizable format
v.customize [
"clonehd", "#{image_path}/#{image_name}.vmdk",
"#{image_path}/#{image_name}.vdi",
"--format", "VDI"
]
# Then resize it to 60 GB
v.customize [
"modifymedium", "disk",
"#{image_path}/#{image_name}.vdi",
"--resize", 60 * 1024
]
# Then attach it as the primary disk
v.customize [
"storageattach", :id,
"--storagectl", "SCSI Controller",
"--port", "0",
"--device", "0",
"--type", "hdd",
"--nonrotational", "on",
"--medium", "#{image_path}/#{image_name}.vdi"
]
# Then remove the original disk
v.customize [
"closemedium", "disk",
"#{image_path}/#{image_name}.vmdk",
"--delete"
]
# Now we can execute the build
config.vm.provision "shell", inline: <<-SHELL
sudo su -
cd /vagrant
./scripts/gate-check-commit.sh
SHELL
end
end