Skip to content

Instantly share code, notes, and snippets.

@danrjohnson
Created June 17, 2016 19:38
Show Gist options
  • Save danrjohnson/bf6cb95334ba6dbb38402e937e15cdb6 to your computer and use it in GitHub Desktop.
Save danrjohnson/bf6cb95334ba6dbb38402e937e15cdb6 to your computer and use it in GitHub Desktop.
Vagrantfile with some extra disks for lvm testing
# -*- mode: ruby -*-
# vi: set ft=ruby :
file_to_disk1 = '.vagrant/data_disk1.vdi'
file_to_disk2 = '.vagrant/data_disk2.vdi'
file_to_disk3 = '.vagrant/data_disk3.vdi'
$prov_script = <<SCRIPT
sudo apt-get update
sudo apt-get install -f lvm2
SCRIPT
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do | v |
unless File.exist?(file_to_disk1)
v.customize ['createhd', '--filename', file_to_disk1, '--size', 5 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk1]
end
config.vm.provider "virtualbox" do | v |
unless File.exist?(file_to_disk2)
v.customize ['createhd', '--filename', file_to_disk2, '--size', 5 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', file_to_disk2]
end
config.vm.provider "virtualbox" do | v |
unless File.exist?(file_to_disk3)
v.customize ['createhd', '--filename', file_to_disk3, '--size', 5 * 1024]
end
v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 3, '--device', 0, '--type', 'hdd', '--medium', file_to_disk3]
end
config.vm.provision "shell", inline: $prov_script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment