I have a situation where I need a very large root disk on a Ubuntu 14.04 image for some long running integration test scenarios, and we have switched to the official bento/ubuntu-14.04 image as it has a LVM root image which can be expanded.
config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2 # or more for heavy load
# https://stackoverflow.com/a/27878224/53897
v.customize ["createhd", "--filename", "m4_disk0", "--size", "1048576"] # 1 TB
v.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", "1", "--type", "hdd", "--medium", "m4_disk0.vdi"]
end
--
(and do some Linux magic later to expand the root drive)
My problem is that right now the m4_disk0.vdi file is created next to the Vagrantfile and
not along the other files for the virtualbox vm. This is important as my sources is on a fast but
small SSD and the virtualbox images have been configured to be on a slower but much larger HDD.
I would like to be able to specify this!
Apparently Vagrant _knows_ where the files are placed as the commands shown with "VAGRANT_LOG=info vagrant up"
show the appropriate absolute paths, but (also apparently) the only parameter made available
to the Vagrantfile programmer is the ":id" identifier which is not much use here.
I have very little experience with Ruby so I might not read the documentation correctly. Pointers and working snippets would be very helpful.
What is the current "correct approach" to what I want to do?
My host is running UBuntu 17.04 with Vagrant 1.9.1.
Thanks
/Thorbjørn