Created
May 21, 2019 12:12
-
-
Save putvr/3245979ecc1c39664538d658b5f1308f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "centos/7" | |
config.vm.provider "virtualbox" do |vb| | |
begin | |
vb.customize ['storagectl', :id, '--name', 'SATA Controller', '--add', 'sata', '--portcount', 4] | |
rescue | |
puts 'SATA Controller already exists' | |
end | |
disks = ['sdb.vdi', 'sdc.vdi', 'sdd.vdi', 'sde.vdi', 'sdf.vdi', 'sdg.vdi'] | |
disks.each_with_index do |disk, index| | |
if not File.exists? disk | |
vb.customize ['createmedium', '--filename', disk, '--format', 'VDI', '--variant', 'Standard', '--size', 512] | |
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', index, '--device', 0, '--type', 'hdd', '--medium', disk] | |
end | |
end | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
yum install -y mdadm lvm2 tmux | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment