Skip to content
Snippets Groups Projects
Commit 3a8feb6a authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.bug fix, use real config as sample

parent 0e8f22d6
No related branches found
No related tags found
No related merge requests found
......@@ -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 $?
......
## 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
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment