Last active
August 29, 2015 14:11
-
-
Save kotashiratsuka/125ac64cb678698aa2ae to your computer and use it in GitHub Desktop.
ZFS on Linux for Vagrant + VMWare Fusion | Virtualbox
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 : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "insaneworks/centos" | |
config.vm.provider :vmware_fusion do |vmf, override| | |
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager' | |
{ 1 => 30, 2 => 30, 3 => 30, 4 => 30 }.each do |disk, size| | |
unless File.exists?( ".vagrant/#{disk}.vmdk" ) | |
`#{vdiskmanager} -c -s #{size}GB -a lsilogic -t 1 .vagrant/#{disk}.vmdk` | |
end | |
vmf.vmx["scsi0:#{disk}.filename"] = "#{File.dirname(__FILE__)}/.vagrant/#{disk}.vmdk" | |
vmf.vmx["scsi0:#{disk}.present"] = true | |
end | |
end | |
config.vm.provider :virtualbox do |vb, override| | |
{ 1 => 30, 2 => 30, 3 => 30, 4 => 30 }.each do |disk, size| | |
vb.customize ['createhd', '--filename', "#{File.dirname(__FILE__)}/.vagrant/#{disk}.vdi", '--size', size * 1024] | |
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', disk, '--device', 0, '--type', 'hdd', '--medium', "#{File.dirname(__FILE__)}/.vagrant/#{disk}.vdi" ] | |
end | |
end | |
config.vm.provision :shell, inline: "yum -y localinstall --nogpgcheck https://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm" | |
config.vm.provision :shell, inline: "yum -y localinstall --nogpgcheck http://archive.zfsonlinux.org/epel/zfs-release.el6.noarch.rpm" | |
config.vm.provision :shell, inline: "yum -y install kernel-devel zfs" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment