From 0e5c6d9f501933ebf19affeb47480cfa8ca5a88c Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 4 Oct 2023 18:06:58 -0700 Subject: [PATCH] util: Resize VM root partition max size to ~128GB Prior to this change we were limited to a root partition with only 60GB of space which caused issues when running larger simulations (see: https://github.com/gem5/gem5/issues/165). There are two factors in this issue which this patch resolves: 1. The root partition in the VM was capped at 60GB despite the virtual machines size being capped at 128GB. This resulted in libvirt giving the VM free space it couldn't use. To fix this `lvextend` was added to the "provision_root.sh" script to resize the root partition to fill the available space. 2. The virtual machine size can be set via the `machine_virtual_size` parameter. The minimum and default value is 128GB. This wasn't exposed previously. Now, if we required, we can increase the size of the VM/Root partition if we require (though I believe 128GB is more than sufficient for now). Fixes: https://github.com/gem5/gem5/issues/165 Change-Id: I82dd500d8807ee0164f92d91515729d5fbd598e3 --- util/github-runners-vagrant/Vagrantfile | 3 ++- util/github-runners-vagrant/provision_root.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/util/github-runners-vagrant/Vagrantfile b/util/github-runners-vagrant/Vagrantfile index ad294a3b38..2a891b9688 100644 --- a/util/github-runners-vagrant/Vagrantfile +++ b/util/github-runners-vagrant/Vagrantfile @@ -40,9 +40,10 @@ Vagrant.configure("2") do |config| config.ssh.password = "vagrant" config.vm.provider "libvirt" do |vb| - # Customize the amount of cpus and memory on the VM: + # Customize the amount of cpus, memory, and storage on the VM: vb.cpus = "4".to_i vb.memory = "16384".to_i + vb.machine_virtual_size = 128 # 128G is the minimum. end # sets up vm diff --git a/util/github-runners-vagrant/provision_root.sh b/util/github-runners-vagrant/provision_root.sh index 5a42556779..f18a170c95 100644 --- a/util/github-runners-vagrant/provision_root.sh +++ b/util/github-runners-vagrant/provision_root.sh @@ -72,3 +72,6 @@ usermod -aG docker vagrant # Cleanup apt-get autoremove -y + +# Resize the root partition to fill up all the free size on the disk +lvextend -l +100%FREE $(df / --output=source | sed 1d)