-
-
Save kun432/6de257e4fdf892c4d76d to your computer and use it in GitHub Desktop.
Add two or more disks to system using Vagrant
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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = 'base' | |
config.vm.provider "virtualbox" do |vb| | |
disk_num = 4 | |
disk_size = 4096 | |
i = 0 | |
while i < disk_num do | |
file_to_disk = "./box-disk#{i}.vmdk" | |
unless File.exist?(file_to_disk) | |
vb.customize ['createhd', '--filename', file_to_disk, '--size', disk_size] | |
end | |
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', i + 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
i += 1 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment