How to set disk size for a virtualbox vm in Chef's Test Kitchen

1k Views Asked by At

Pretty much what the title says: I need Kitchen to tell VirtualBox that the VM's hard drive should be 500gb. I've scoured the docs and not found anything (kitchen.ci).

Am I just not looking in the right places?

1

There are 1 best solutions below

0
On

the disk size is given by the box that you are using. though, you can override it using vagrant-disksize.

  1. install vagrant-disksize plugin for vagrant

    vagrant plugin install vagrant-disksize
    
  2. create a Vagrantfile that looks like the following

    Vagrant.configure('2') do |config|
      config.vagrant.plugins = ['vagrant-disksize']
      config.disksize.size = '50GB'
    end
    
  3. add the Vagrantfil to the vagrantfiles in the driver configuration in .kitchen.yaml

    ---
    driver:
      vagrantfiles:
        - Vagrantfile