From a5a9e95c33f82ea1dea3aa4fb3e243510aeafcb9 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Wed, 21 Nov 2018 14:18:56 -0500 Subject: [PATCH] LAVA: allocate data disk of 2G for local operation This is to replicate /dev/sda1 from baremetal jobs. It also ensure that NFS is not used to perform testing. Signed-off-by: Jonathan Rajotte --- lava/kvm/generate_kvm_virsh.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lava/kvm/generate_kvm_virsh.sh b/lava/kvm/generate_kvm_virsh.sh index 3f16e73..21bea4b 100755 --- a/lava/kvm/generate_kvm_virsh.sh +++ b/lava/kvm/generate_kvm_virsh.sh @@ -18,11 +18,16 @@ export LIBVIRT_DEFAULT_URI="qemu:///system" tmp=$(mktemp) +name=$1 +virsh vol-create-as --pool default --name "${name}.raw" --capacity 2G --format raw +data_disk_path="$(virsh vol-path ${name}.raw --pool default)" +sudo mkfs.ext4 "$data_disk_path" virt-install --print-xml \ - --name "$1" \ + --name "$name" \ --memory 2096\ --disk /var/lib/libvirt/images/ipxe.iso,device=cdrom \ --boot cdrom \ + --disk "$data_disk_path,format=raw" \ --vcpus 2 \ --cpu host \ --serial pty \ @@ -30,6 +35,6 @@ virt-install --print-xml \ --autostart \ --check path_in_use=off > "$tmp" virsh define --validate "$tmp" -virsh start "$1" +virsh start "$name" rm -rf "$tmp" -- 2.34.1