createVM_script
This commit is contained in:
		@@ -27,5 +27,5 @@ jobs:
 | 
				
			|||||||
          password: ${{ secrets.PASSWORD }}
 | 
					          password: ${{ secrets.PASSWORD }}
 | 
				
			||||||
          port: 22
 | 
					          port: 22
 | 
				
			||||||
          script: |
 | 
					          script: |
 | 
				
			||||||
            pveversion
 | 
					            bash /scripts/create_cloud_VM_140.sh
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										30
									
								
								scripts/create_cloud_VM_140.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								scripts/create_cloud_VM_140.sh
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
				
			||||||
		Reference in New Issue
	
	Block a user