Update file cloudinit.sh

This commit is contained in:
2023-07-26 21:50:26 +00:00
parent caa513bad7
commit 1308a8fc74

View File

@@ -2,19 +2,18 @@ export URL="https://cloud.debian.org/images/cloud/bookworm/20230711-1438/debian-
export NAME="Debian12.qcow2" export NAME="Debian12.qcow2"
export VM="Debian12-Template" export VM="Debian12-Template"
export VMID="99999" export VMID="99999"
export LOCATION="NVMeSSD" export LOCATION="ssd-domains"
echo Downloading Image echo Downloading Image
wget $URL -O $NAME wget $URL -O $NAME
echo adding qemu agent echo adding qemu agent
virt-customize -a $NAME --install qemu-guest-agent,epel-release virt-customize -a $NAME --install qemu-guest-agent
virt-customize -a $NAME --install ansible
echo setting up VM echo setting up VM
qm create $VMID --name $VM --memory 1024 --cores 1 -cpu host --net0 virtio,bridge=vmbr1 qm create $VMID --name $VM --memory 1024 --cores 1 -cpu host --net0 virtio,bridge=vmbr1
qm importdisk $VMID $NAME $LOCATION qm importdisk $VMID $NAME $LOCATION
qm set $VMID --scsihw virtio-scsi-pci --scsi0 $LOCATION:vm-$VMID-disk-0,size=10G qm set $VMID --scsihw virtio-scsi-pci --scsi0 $LOCATION:$VMID/vm-$VMID-disk-0.raw,size=10G
qm set $VMID --boot c --bootdisk scsi0 qm set $VMID --boot c --bootdisk scsi0
qm set $VMID --ide2 $LOCATION:cloudinit qm set $VMID --ide2 $LOCATION:cloudinit
qm set $VMID --serial0 socket --vga serial0 qm set $VMID --serial0 socket --vga serial0