Creating additional disks in kitchen-vagrant/virtualbox
Notes on how to set up and use the hooks to create additional ephemeral disks in kitchen-vagrant/virtualbox runs with test-kitchen.
- Gemfile (Requires a minimum kitchen-vagrant version of 0.16.0)
- ruby 2+ - kitchen-vagrant 0.16.0 is currently broken for older rubygems versions
- Enough local disk space to create your desired virtual disk
- Update your Gemfile to use kitchen-vagrant, version 0.16.0 or greater. At this time, it's still beta and not yet packaged in gem, so you'll need to pull from github.com.
- You'll need a recipe to format and mount the additional disk. Add this
.kitche.ymlat the beginning of the
run_listfor the suites that need it.
- In the
:cleanupnamespace and the
integration:pre_cmdstask are added to manage the setup and tear-down for the additional disk.
- You'll want to add the following to the cookbook .gitignore:
.kitchen.local.yml Vagrantfiles/ vagrant_disks/
- The setup script looks for the attribute
add_vagrant_disk: truein the
.kitchen.ymlsuites that need an additional disk.
- By default, the added disk will be 10Gb. For a different size, you can
add the attribute
vagrant_disk_sizeto the suite (value should be an integer, in Gb).
bundle exec berks install
bundle exec rake setup
bundle exec kitchen converge [target instance]
- Test your stuff
- When you're ready to clean up, run
bundle exec rake cleanup
- If you need to update your
.kitchen.yml, you will need to re-run
bundle exec rake setupeach time, as the setup writes a
.kitchen.local.ymlbased on the