Last active
February 23, 2016 22:44
-
-
Save blkperl/9108604 to your computer and use it in GitHub Desktop.
solaris11 with multiple disks vagrant file
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
diskroot = "/home/#{ENV['USER']}/VirtualBox\ VMs/" | |
config.vm.define "sunosfiler" do |v| | |
v.vm.box = "solaris-11.1" | |
v.vm.hostname = "sunosfiler" | |
v.vm.network :private_network, ip: "192.168.2.13" | |
v.vm.box_url = "iso/packer_solaris-11.1-amd64_virtualbox.box" | |
v.vm.provider :virtualbox do |vb| | |
# Create a sata controller for our disks | |
vb.customize ["storagectl", :id, "--name", "SATA Controller", "--add", 'sata'] | |
# Create a second disk for the rpool mirror | |
diskname = "#{diskroot}/sunosfiler-ide1.vdi" | |
vb.customize ['createhd', '--filename', diskname, '--size', 8 * 1024] | |
vb.customize ['storageattach', :id, '--storagectl', 'IDE Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', diskname] | |
end | |
# Create six disks for a zpool | |
v.vm.provider :virtualbox do |vb| | |
["1","2","3","4","5","6"].each do |disk| | |
diskname = "#{diskroot}/sunosfiler-sata#{disk}.vdi" | |
vb.customize ['createhd', '--filename', diskname, '--size', 1024] | |
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', disk, '--device', 0, '--type', 'hdd', '--medium', diskname] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment