From 3a8feb6aebab389655597c7f7c6c3720cdb18e9f Mon Sep 17 00:00:00 2001 From: Recolic <git@me.recolic.net> Date: Tue, 16 Jan 2024 16:16:46 -0800 Subject: [PATCH] .bug fix, use real config as sample --- cron-callback.sh | 4 ++-- init.settings | 7 ++++--- runtime.settings | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cron-callback.sh b/cron-callback.sh index 0d65413..87387ea 100755 --- a/cron-callback.sh +++ b/cron-callback.sh @@ -62,12 +62,12 @@ function create_vm_if_not_exist () { # Check if disk img already exists. [[ -f "vm/$name/disk.img" ]] && return - download_cloud_img_if_not_exist "$cloudimg" || return $? rm -rf "vm/$name" ; mkdir -p "vm/$name" echo2 "+ Creating VM image $name with options $@..." - if [ -z "$disk" ]; then + if [ "$disk" != "" ]; then # create from cloudimg + download_cloud_img_if_not_exist "$cloudimg" || return $? generate_metadata "$name" > "vm/$name/meta-data" || return $? generate_userdata "$username" "$password" "$name" > "vm/$name/user-data" || return $? ( cd "vm/$name" ; genisoimage -output initimg.iso -volid cidata -joliet -rock user-data meta-data ) || return $? diff --git a/init.settings b/init.settings index 5f09d42..9fbb53f 100644 --- a/init.settings +++ b/init.settings @@ -1,8 +1,9 @@ ## init VM from cloudimg # name;cloudimg;disk;username;password (space will be trimmed) -instance1;focal-server-cloudimg-amd64.img;60G;r;1 -gitlab-ci;Arch-Linux-x86_64-cloudimg.qcow2;40G;r;1 +ndpa-build ;focal-server-cloudimg-amd64.img;60G;r;1 +gitlab-ci-ms;focal-server-cloudimg-amd64.img;50G;r;1 ## or init VM from pre-deployed backing image (please put it into data/base/) # name;existing_img_fname -devbox;win10pro-22h2-virtio-uefi.qcow2 +ubuntucorp ;ubuntu-intune.qcow2 +devbox ;win10pro-22h2-virtio-uefi.qcow2 diff --git a/runtime.settings b/runtime.settings index 5204307..85b6ee8 100644 --- a/runtime.settings +++ b/runtime.settings @@ -1,4 +1,5 @@ # name;options (name will be trimmed, options will be passed as-is) -instance1;-m 2G -smp 2 -vnc :11 -net user,hostfwd=tcp::30471-:22 -gitlab-ci;-m 4G -smp 4 -vnc :12 -net user,hostfwd=tcp::30473-:22,hostfwd=tcp::30474-:8080 -devbox ;-m 6G -smp 6 -vnc :13 -net user,hostfwd=tcp::30475-:3389 -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time +ubuntucorp ;-m 2G -smp 2 -vnc :10 -net user,hostfwd=tcp::30471-:22 +ndpa-build ;-m 8G -smp 4 -vnc :11 -net user,hostfwd=tcp::30472-:22 +gitlab-ci-ms;-m 4G -smp 3 -vnc :12 -net user,hostfwd=tcp::30473-:22 +devbox ;-m 8G -smp 8 -vnc :13 -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -nic tap,ifname=vnic0,script=no,downscript=no,mac=10:11:11:11:11:10 -chardev socket,id=chrtpm,path=/tmp/mytpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 -- GitLab