Skip to content

Instantly share code, notes, and snippets.

@blkperl
Created February 19, 2014 08:03
Show Gist options
  • Select an option

  • Save blkperl/9087848 to your computer and use it in GitHub Desktop.

Select an option

Save blkperl/9087848 to your computer and use it in GitHub Desktop.
solaris11 with multiple disks vagrant file
# -*- 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|
config.vm.define "sunosfiler" do |v|
v.vm.box = "solaris-11.1"
v.vm.hostname = "sunosfiler"
v.vm.network :private_network, ip: "192.168.1.11"
v.vm.box_url = "/stash/nixmentors/boxes/packer_solaris-11.1-amd64_virtualbox.box"
# Create a sata controller for our disks
v.vm.provider :virtualbox do |vb|
vb.customize ["storagectl", :id, "--name", "SATA Controller", "--add", 'sata']
diskname = "/disk/trump/minerals/#{ENV['USER']}/sun-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 = "/disk/trump/minerals/#{ENV['USER']}/sun-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