LAVA: allocate data disk of 2G for local operation
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 21 Nov 2018 19:18:56 +0000 (14:18 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 21 Nov 2018 19:18:56 +0000 (14:18 -0500)
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 <jonathan.rajotte-julien@efficios.com>
lava/kvm/generate_kvm_virsh.sh

index 3f16e73680059612d51f41f0f530d123d0c6775c..21bea4b6abbf351544ed1ae514ee78d906cfa289 100755 (executable)
 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"
 
This page took 0.023558 seconds and 4 git commands to generate.