For vagrant-libvirt, the second disk can be added w/ libvirt.storage :file, :size => '5G'.
To make use of this disk, we can use docker-storage-setup, as described in http://www.projectatomic.io/docs/docker-storage-recommendation.
The lines in the config.vm.provision section below add DEVS="/dev/vdb" to /etc/sysconfig/docker-storage-setup. The commented-out line is supposed to run docker-storage-setup to set up the storage, but this isn't working when run from the Vagrantfile here. Once logged in to the vagrant VM, however, running sudo docker-storage-setup works as expected, except for a syntax error with part of the setup script which doesn't appear to stop the script from doing its job.
Vagrant.configure("2") do |config|
config.vm.box = "f22atomic"
config.vm.provider "libvirt" do |libvirt|
libvirt.driver = "kvm"
libvirt.memory = 2048
libvirt.cpus = 2
libvirt.storage :file, :size => '5G'
end
config.vm.provision "shell" do |s|
s.inline = "echo $1 > /etc/sysconfig/docker-storage-setup"
s.args = ['DEVS="/dev/vdb"']
end
config.vm.provision "shell" do |s|
s.inline = "docker-storage-setup"
end
end
The syntax error I mentioned, issue upstream: projectatomic/container-storage-setup#5
failed [sfd_geom:1] sfdisk /dev/vda --show-pt-geometry
sfdisk: unrecognized option '--show-pt-geometry'
Usage:
sfdisk [options] <dev> [[-N] <part>]
sfdisk [options] <command>
Display or manipulate a disk partition table.
Commands:
-a, --activate <dev> [<part> ...] list or set bootable MBR partitions
-d, --dump <dev> dump partition table (usable for later input)
-g, --show-geometry [<dev> ...] list geometry of all or specified devices