From d14c08845747e57fea2e6db86a2e970bea471e95 Mon Sep 17 00:00:00 2001 From: "martin.cholewa" Date: Fri, 26 Sep 2025 08:23:12 +0200 Subject: [PATCH] createVM_script --- .gitea/workflows/01_deploy_VM.yaml | 2 +- scripts/create_cloud_VM_140.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 scripts/create_cloud_VM_140.sh diff --git a/.gitea/workflows/01_deploy_VM.yaml b/.gitea/workflows/01_deploy_VM.yaml index e1eab77..b15c345 100644 --- a/.gitea/workflows/01_deploy_VM.yaml +++ b/.gitea/workflows/01_deploy_VM.yaml @@ -27,5 +27,5 @@ jobs: password: ${{ secrets.PASSWORD }} port: 22 script: | - pveversion + bash /scripts/create_cloud_VM_140.sh diff --git a/scripts/create_cloud_VM_140.sh b/scripts/create_cloud_VM_140.sh new file mode 100644 index 0000000..5622f90 --- /dev/null +++ b/scripts/create_cloud_VM_140.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +VMID=140 +VMNAME="cloudINIT140" +MEMORY=2048 +NET="virtio,bridge=vmbr0" +CORES=2 +SOCKETS=1 +OSTYPE="l26" +DISKPATH="/mnt/storage_sdb/template/iso/noble-server-cloudimg-amd64.img" +DISKSTORAGE="smallDisk" +CLOUDDISK="${DISKSTORAGE}:140/vm-140-disk-0.raw" +CLOUDINIT="${DISKSTORAGE}:cloudinit" +BOOT="order=virtio0" +IPCONFIG="ip=192.168.11.240/24,gw=192.168.11.1" +CIUSER="chs" +CIPASSWORD="genius" +SSHPUBKEY='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAE39D/Dep3EHMWXB6wiMTL0My1SlMZVk0Y80jEv7LOb xchose@freya.local' + +qm create $VMID --name $VMNAME --memory $MEMORY --net0 $NET --cores $CORES --sockets $SOCKETS --ostype $OSTYPE +qm set $VMID --bios seabios +qm importdisk $VMID $DISKPATH $DISKSTORAGE +qm set $VMID --virtio0 $CLOUDDISK +qm set $VMID --ide2 $CLOUDINIT +qm set $VMID --boot $BOOT +qm set $VMID --ipconfig0 $IPCONFIG +qm set $VMID --ciuser $CIUSER --cipassword $CIPASSWORD +qm set $VMID --sshkey <(echo "$SSHPUBKEY") +qm start $VMID +qm resize $VMID virtio0 +30G