Skip to content

Instantly share code, notes, and snippets.

@debdutdeb
Last active May 17, 2021 03:38
Show Gist options
  • Save debdutdeb/98ed1b6aef36885d07ce8247188dfd5e to your computer and use it in GitHub Desktop.
Save debdutdeb/98ed1b6aef36885d07ce8247188dfd5e to your computer and use it in GitHub Desktop.
Vagrantfile for LVM testing.
  1. Save this file in your disk and change your PWD to that directory.

  2. Set the environment variable VAGRANT_EXPERIMENTAL to "disks".

export VAGRANT_EXPERIMENTAL=disks
  1. Finally start the vm with vagrant up. You'll definitely see a couple of warning messages like these:-
==> vagrant: You have requested to enabled the experimental flag with the following features:
==> vagrant: 
==> vagrant: Features:  disks
==> vagrant: 
==> vagrant: Please use with caution, as some of the features may not be fully
==> vagrant: functional yet.

Ignore them.

  1. SSH into the machine.
vagrant ssh
  1. Destroy the machine once the work is done.
vagrant destroy
Vagrant.configure "2" do |config|
config.vm.box = "ubuntu/focal64"
config.vm.hostname = "lvm"
3.times {|i| config.vm.disk :disk, size: "5GB", name: "drive-#{i}"}
config.vm.provider :virtualbox do |machine|
machine.memory = 1024
machine.cpus = 1
machine.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
end
# vi: set ft=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment