aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-06-28 16:56:56 +0200
committerAlice Frosi <afrosi@redhat.com>2023-06-29 10:20:42 +0200
commit033faa4b9d0350cb960562b2227f59d5246d95e3 (patch)
tree8dddfb7fe72ca3f41f61b34b1b5c4bbc282fcb2c
parentbeeefb214a2dc8917b5a31945e740ecce4536764 (diff)
downloadseitan-033faa4b9d0350cb960562b2227f59d5246d95e3.tar
seitan-033faa4b9d0350cb960562b2227f59d5246d95e3.tar.gz
seitan-033faa4b9d0350cb960562b2227f59d5246d95e3.tar.bz2
seitan-033faa4b9d0350cb960562b2227f59d5246d95e3.tar.lz
seitan-033faa4b9d0350cb960562b2227f59d5246d95e3.tar.xz
seitan-033faa4b9d0350cb960562b2227f59d5246d95e3.tar.zst
seitan-033faa4b9d0350cb960562b2227f59d5246d95e3.zip
vm-images: add connection to qemu:///system
Use system mode as suggested by the documentation. Added a note for directory permissions
-rwxr-xr-xvm-images/create_coreos_vm.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/vm-images/create_coreos_vm.sh b/vm-images/create_coreos_vm.sh
index 03ac937..e8b11b4 100755
--- a/vm-images/create_coreos_vm.sh
+++ b/vm-images/create_coreos_vm.sh
@@ -28,7 +28,7 @@ IMAGE=${LIBVIRT_IMAGES}/${IMAGE_NAME}
set -e
# Don't execute the script if VM is still exists in libvirt
-if virsh list --all | grep ${VM_NAME} ; then
+if virsh --connect="qemu:///system" list --all | grep ${VM_NAME} ; then
echo "VM ${VM_NAME} still exists"
exit 0
fi
@@ -49,7 +49,10 @@ podman run --interactive --rm --security-opt label=disable \
chcon --verbose --type svirt_home_t ${IGNITION_CONFIG}
# Install the VM
-virt-install --name="${VM_NAME}" --vcpus="${VCPUS}" --memory="${RAM_MB}" \
+# Note: if you encounter any issues with the installation with permission denied
+# for the backing storage, please try to check ACL permissions with getfacl -e
+# $HOME/.local and eventually fix them with setfacl -m u:qemu:rx $HOME/.local
+virt-install --connect="qemu:///system" --name="${VM_NAME}" --vcpus="${VCPUS}" --memory="${RAM_MB}" \
--os-variant="fedora-coreos-$STREAM" --import --graphics=none \
--disk="size=${DISK_GB},backing_store=${IMAGE}" \
--network bridge=virbr0 "${IGNITION_DEVICE_ARG[@]}"