New scripts and sudo rules. Implement qemu session mode.

This commit is contained in:
Andreas B. Mundt 2023-04-04 13:29:00 +02:00
parent 91aab8e75b
commit 7871936a67
19 changed files with 176 additions and 67 deletions

View file

@ -3,7 +3,7 @@
set -eu
show_help() {
cat << EOF
cat << EOF >&2
Usage: $(basename "$0") [-u vmname] [-d vmname] [-a]"
When using option -u (upload), the disk from VM vmname will be synced on server.
Otherwise the images from images.list and xml-directory will be synced from server.
@ -13,12 +13,12 @@ EOF
upload_image() {
# check if VM-Diskimage exists
if [[ ! -f "/var/lib/libvirt/images/${VM_NAME}.qcow2" ]]; then
echo "File not found ${VM_NAME}.qcow2"
echo "File not found ${VM_NAME}.qcow2" >&2
exit 1
fi
# check if VM-Machine-Definition XML exists
if [[ ! -f "/var/lib/libvirt/images/xml/${VM_NAME}.xml" ]]; then
echo "File not found ${VM_NAME}.xml"
echo "File not found ${VM_NAME}.xml" >&2
exit 1
fi
rsync -av --password-file=/etc/rsync.secret "/var/lib/libvirt/images/${VM_NAME}.qcow2" \