Enable Host IO cache on SATA controller by default

This commit is contained in:
Mitchell Hashimoto 2012-03-22 13:41:48 -07:00
parent 641a8daac8
commit 1749e4cf94
4 changed files with 32 additions and 0 deletions

View File

@ -9,6 +9,7 @@
- `vagrant ssh` now works on Solaris, where `IdentitiesOnly` was not
an available option. [GH-820]
- Output works properly in the face of broken pipes. [GH-819]
- Enable Host IO Cache on the SATA controller by default.
## 1.0.1 (March 11, 2012)

View File

@ -54,6 +54,7 @@ module Vagrant
autoload :ProvisionerCleanup, 'vagrant/action/vm/provisioner_cleanup'
autoload :PruneNFSExports, 'vagrant/action/vm/prune_nfs_exports'
autoload :Resume, 'vagrant/action/vm/resume'
autoload :SaneDefaults, 'vagrant/action/vm/sane_defaults'
autoload :ShareFolders, 'vagrant/action/vm/share_folders'
autoload :SetupPackageFiles, 'vagrant/action/vm/setup_package_files'
autoload :Suspend, 'vagrant/action/vm/suspend'

View File

@ -46,6 +46,7 @@ module Vagrant
use VM::HostName
use VM::ClearNetworkInterfaces
use VM::Network
use VM::SaneDefaults
use VM::Customize
use VM::Boot
end

View File

@ -0,0 +1,29 @@
module Vagrant
module Action
module VM
# This middleware enforces some sane defaults on the virtualbox
# VM which help with performance, stability, and in some cases
# behavior.
class SaneDefaults
def initialize(app, env)
@app = app
end
def call(env)
# Enable the host IO cache on the sata controller. Note that
# if this fails then its not a big deal, so we don't raise any
# errors. The Host IO cache vastly improves disk IO performance
# for VMs.
command = [
"storagectl", env[:vm].uuid,
"--name", "SATA Controller",
"--hostiocache", "on"
]
env[:vm].driver.execute_command(command)
@app.call(env)
end
end
end
end
end