Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- mode: ruby -*-
- # vi: set ft=ruby :
- Vagrant.configure(2) do |config|
- config.vm.box = "centos/7"
- # Create a private network, which allows host-only access to the machine
- # using a specific IP.
- config.vm.network "private_network", ip: "172.16.12.100"
- parityDisk = './parityDisk.vdi'
- dataDisk1 = './dataDisk1.vdi'
- dataDisk2 = './dataDisk2.vdi'
- config.vm.provider "virtualbox" do |vb|
- vb.memory = "8196"
- # Building disk files if they don't exist
- if not File.exists?(parityDisk)
- vb.customize ['createhd', '--filename', parityDisk, '--variant', 'Fixed', '--size', 10 * 1024]
- end
- if not File.exists?(dataDisk1)
- vb.customize ['createhd', '--filename', dataDisk1, '--variant', 'Fixed', '--size', 10 * 1024]
- end
- if not File.exists?(dataDisk2)
- vb.customize ['createhd', '--filename', dataDisk2, '--variant', 'Fixed', '--size', 10 * 1024]
- # Adding a SATA controller that allows 4 hard drives
- vb.customize ['storagectl', :id, '--name', 'SATA Controller', '--add', 'sata', '--portcount', 4]
- # Attaching the disks using the SATA controller
- vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', parityDisk]
- vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', dataDisk1]
- vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 3, '--device', 0, '--type', 'hdd', '--medium', dataDisk2]
- end
- end
- config.vm.provision "shell", inline: <<-SHELL
- sudo mkfs.ext4 /dev/sdb
- sudo mkfs.ext4 /dev/sdc
- sudo mkfs.ext4 /dev/sdd
- SHELL
- end
Add Comment
Please, Sign In to add comment