Upload files to "/"
This commit is contained in:
parent
75c9a72981
commit
f3a73f9201
23
cloud-init-agent.sh
Normal file
23
cloud-init-agent.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# installing libguestfs-tools only required once, prior to first run
|
||||||
|
apt update -y
|
||||||
|
apt install libguestfs-tools -y
|
||||||
|
|
||||||
|
VMID=9002
|
||||||
|
|
||||||
|
IMAGE=lunar-server-cloudimg-amd64.img
|
||||||
|
# remove existing image in case last execution did not complete successfully
|
||||||
|
rm *-server-cloudimg-amd64.img
|
||||||
|
wget http://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
|
||||||
|
virt-customize -a $IMAGE --install qemu-guest-agent rsyslog
|
||||||
|
|
||||||
|
qm create 9002 --name "ubuntu-k3s-agent-template" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr1
|
||||||
|
qm importdisk 9002 noble-server-cloudimg-amd64.img local-zfs
|
||||||
|
qm set 9002 --scsihw virtio-scsi-pci --scsi0 local-zfs:vm-9002-disk-0
|
||||||
|
qm set 9002 --boot c --bootdisk scsi0
|
||||||
|
qm set 9002 --ide2 local-zfs:cloudinit
|
||||||
|
qm set 9002 --serial0 socket --vga serial0
|
||||||
|
qm set 9002 --agent enabled=1
|
||||||
|
|
||||||
|
qm template 9002
|
||||||
|
|
||||||
|
rm $IMAGE
|
24
cloud-init-template.sh
Normal file
24
cloud-init-template.sh
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# installing libguestfs-tools only required once, prior to first run
|
||||||
|
apt update -y
|
||||||
|
apt install libguestfs-tools -y
|
||||||
|
|
||||||
|
VMID=9004
|
||||||
|
|
||||||
|
IMAGE=jammy-server-cloudimg-amd64.img
|
||||||
|
# remove existing image in case last execution did not complete successfully
|
||||||
|
rm *-server-cloudimg-amd64.img
|
||||||
|
wget http://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
|
||||||
|
virt-customize -a $IMAGE --install qemu-guest-agent
|
||||||
|
virt-customize -a $IMAGE --install rsyslog
|
||||||
|
|
||||||
|
qm create 9004 --name "ubuntu-2204-cloudinit-template" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr1
|
||||||
|
qm importdisk 9004 jammy-server-cloudimg-amd64.img local-ssd
|
||||||
|
qm set 9004 --scsihw virtio-scsi-pci --scsi0 local-ssd:vm-9004-disk-0
|
||||||
|
qm set 9004 --boot c --bootdisk scsi0
|
||||||
|
qm set 9004 --ide2 local-ssd:cloudinit
|
||||||
|
qm set 9004 --serial0 socket --vga serial0
|
||||||
|
qm set 9004 --agent enabled=1
|
||||||
|
|
||||||
|
qm template 9004
|
||||||
|
|
||||||
|
#rm $IMAGE
|
Loading…
Reference in New Issue
Block a user