Closed svpernova09 closed 4 years ago
It seems likely to me that the initial disk size doesn't have anything left over.
More recently, I've been on a project that is all in on Docker, and because Docker for Mac is such a performance problem, I've still been using a vagrant VM. I ended up using the following to provision a separate disk, avoiding any problems with the base disk config at all:
# Create a disk for zfs / docker container images.
zfs_dir = "#{dir}/.vagrant"
config.vm.provider "virtualbox" do |vb|
zfs = File.join(zfs_dir, 'zfs.vdi')
unless File.exists?(zfs)
vb.customize ["createhd", "--filename", zfs, "--size", settings["vb"]["zfssize"] * 1024]
end
vb.customize ["storageattach", :id, "--storagectl", "SCSI", "--port", 2, "--device", 0, "--type", "hdd", "--medium", zfs]
end
I wonder if there's any way to do this in a cross-provider fashion?
The one significant advantage of zfs is that it has built-in compression, which makes a huge difference for databases. Even for SSDs, you generally get improved performance with compression + reduced IO compared to uncompressed IO. It kind of makes me want to create a new version of lmm (in spirit, not implementation) with zfs snapshots.
Perhaps since this isn't "production", an even more robust solution would be to use a loopback device and disk image. I originally used the built in lvm setup with Ubuntu because it seemed to be more straightforward, but perhaps that's not the case.
Think I've got it sorted out
vagrant@homestead:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 393M 1.5M 392M 1% /run
/dev/mapper/homestead--vg-root 54G 4.3G 47G 9% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/sda1 511M 4.0K 511M 1% /boot/efi
/dev/mapper/homestead--vg-mysql--master 63G 237M 60G 1% /homestead-vg/master
vagrant 466G 316G 151G 68% /vagrant
tmpfs 393M 24K 393M 1% /run/user/124
home_vagrant_midsouthmakers 466G 316G 151G 68% /home/vagrant/midsouthmakers
tmpfs 393M 4.0K 393M 1% /run/user/1000
vagrant@homestead:~$
vagrant@homestead:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 394M 8.7M 386M 3% /run
/dev/mapper/homestead--vg-root 54G 5.6G 46G 11% /
tmpfs 2.0G 28K 2.0G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mapper/homestead--vg-mysql--master 63G 262M 60G 1% /homestead-vg/master
vagrant 466G 299G 168G 65% /vagrant
home_vagrant_midsouthmakers 466G 299G 168G 65% /home/vagrant/midsouthmakers
tmpfs 394M 0 394M 0% /run/user/1000
vagrant@homestead:~$
Looks like Ubuntu 20.04 ships with an LVM out of the box? It's at least acting differently than 18.04.
Provisioning script from Settler
This is where we run into issues:
Now I'm running this on a Vagrant VM with this
Vagrantfile
:Is this because the VM I'm running on doesn't have the storage size that it would if I was using Packer? I wanted to check into this, going to work around it but would appreciate some help/guidance.
/cc @deviantintegral