-
-
Save seanb4t/8ac6908bb89bc68c7011b4417e8cca83 to your computer and use it in GitHub Desktop.
Revisions
-
seanb4t revised this gist
May 25, 2021 . No changes.There are no files selected for viewing
-
seanb4t revised this gist
May 23, 2021 . No changes.There are no files selected for viewing
-
seanb4t revised this gist
May 23, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -191,8 +191,8 @@ qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-d printf "\n** Setting boot\n" qm set $VMID --boot c --bootdisk scsi0 --serial0 socket --vga serial0 printf "\n** Using a dhcp server on $BRIDGE (or change to static IP)\n" qm set $VMID --ipconfig0 ip=dhcp #This would work in a bridged setup, but a routed setup requires a route to be added in the guest #qm set $VMID --ipconfig0 ip=10.10.10.222/24,gw=10.10.10.1 -
seanb4t revised this gist
May 23, 2021 . No changes.There are no files selected for viewing
-
seanb4t revised this gist
May 23, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -191,8 +191,8 @@ qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-d printf "\n** Setting boot\n" qm set $VMID --boot c --bootdisk scsi0 --serial0 socket --vga serial0 # printf "\n** Using a dhcp server on $BRIDGE (or change to static IP)\n" # qm set $VMID --ipconfig0 ip=dhcp #This would work in a bridged setup, but a routed setup requires a route to be added in the guest #qm set $VMID --ipconfig0 ip=10.10.10.222/24,gw=10.10.10.1 -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -189,7 +189,7 @@ printf "\n** Attaching the disk to the vm using VirtIO SCSI\n" qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-disk-0.qcow2 printf "\n** Setting boot\n" qm set $VMID --boot c --bootdisk scsi0 --serial0 socket --vga serial0 printf "\n** Using a dhcp server on $BRIDGE (or change to static IP)\n" qm set $VMID --ipconfig0 ip=dhcp -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -189,7 +189,7 @@ printf "\n** Attaching the disk to the vm using VirtIO SCSI\n" qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-disk-0.qcow2 printf "\n** Setting boot\n" qm set $VMID --boot c --bootdisk scsi0 #--serial0 socket --vga serial0 printf "\n** Using a dhcp server on $BRIDGE (or change to static IP)\n" qm set $VMID --ipconfig0 ip=dhcp -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -188,8 +188,8 @@ qm importdisk $VMID /tmp/$VMIMAGE nas-cluster-store -format qcow2 printf "\n** Attaching the disk to the vm using VirtIO SCSI\n" qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-disk-0.qcow2 printf "\n** Setting boot\n" qm set $VMID --boot c --bootdisk scsi0 --serial0 socket --vga serial0 printf "\n** Using a dhcp server on $BRIDGE (or change to static IP)\n" qm set $VMID --ipconfig0 ip=dhcp -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -188,8 +188,8 @@ qm importdisk $VMID /tmp/$VMIMAGE nas-cluster-store -format qcow2 printf "\n** Attaching the disk to the vm using VirtIO SCSI\n" qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-disk-0.qcow2 # printf "\n** Setting boot and display settings with serial console\n" # qm set $VMID --boot c --bootdisk scsi0 --serial0 socket --vga serial0 printf "\n** Using a dhcp server on $BRIDGE (or change to static IP)\n" qm set $VMID --ipconfig0 ip=dhcp -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -214,7 +214,7 @@ then printf "\n** Adding user configuration\n" cp -v $PWD/$USERCONFIG $SNIPPETSPATH/$VMID-$OSNAME-$USERCONFIG qm set $VMID --cicustom "user=nas-cluster-store:snippets/$VMID-$OSNAME-$USERCONFIG" printf "#* cloud-config: $VMID-$OSNAME-$USERCONFIG\n" >> /etc/pve/nodes/$(hostname)/qemu-server/$VMID.conf else # The SSH key should be supplied either in the cloud-init config file or here printf "\n** Skipping config file, as none was found\n\n** Adding SSH key\n" -
seanb4t revised this gist
May 23, 2021 . No changes.There are no files selected for viewing
-
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ read -p "* Enter number of distro to use: " OSNR RESIZE=+30G MEMORY=2048 BRIDGE=vmbr0 USERCONFIG_DEFAULT=cloud-init-config.yml # cloud-init-config.yml CITYPE=nocloud SNIPPETSPATH=/mnt/pve/nas-cluster-store/snippets SSHKEY=~/.ssh/sean.pub # ~/.ssh/id_rsa.pub -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,7 +49,7 @@ MEMORY=2048 BRIDGE=vmbr0 USERCONFIG_DEFAULT=none # cloud-init-config.yml CITYPE=nocloud SNIPPETSPATH=/mnt/pve/nas-cluster-store/snippets SSHKEY=~/.ssh/sean.pub # ~/.ssh/id_rsa.pub NOTE="" -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,7 +49,7 @@ MEMORY=2048 BRIDGE=vmbr0 USERCONFIG_DEFAULT=none # cloud-init-config.yml CITYPE=nocloud SNIPPETSPATH=/mnt/pve/nas-cluster-store/snippets/ SSHKEY=~/.ssh/sean.pub # ~/.ssh/id_rsa.pub NOTE="" -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -213,7 +213,7 @@ then # The cloud-init user config file overrides the user settings done elsewhere printf "\n** Adding user configuration\n" cp -v $PWD/$USERCONFIG $SNIPPETSPATH/$VMID-$OSNAME-$USERCONFIG qm set $VMID --cicustom "user=nas-cluster-store:snippets/$VMID-$OSNAME-$USERCONFIG" printf "#* cloud-config: $VMID-$OSNAME-$USERCONFIG\n" >> /etc/pve/nodes/proxmox/qemu-server/$VMID.conf else # The SSH key should be supplied either in the cloud-init config file or here -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -225,7 +225,7 @@ else && printf "\n** Adding the password to the config\n" \ && qm set $VMID --cipassword $PASSWORD \ && printf "#* a password has been set for the default user\n" >> /etc/pve/nodes/$(hostname)/qemu-server/$VMID.conf printf "#- cloud-config used: via Proxmox\n" >> /etc/pve/nodes/$(hostname)/qemu-server/$VMID.conf fi # The NOTE is added to the Summary section of the VM (TODO there seems to be no 'qm' command for this) -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -229,7 +229,7 @@ else fi # The NOTE is added to the Summary section of the VM (TODO there seems to be no 'qm' command for this) printf "#$NOTE\n" >> /etc/pve/nodes/$(hostname)/qemu-server/$VMID.conf printf "\n** Increasing the disk size\n" qm resize $VMID scsi0 $RESIZE -
seanb4t revised this gist
May 23, 2021 . No changes.There are no files selected for viewing
-
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -224,7 +224,7 @@ else [ ! -z "$PASSWORD" ] \ && printf "\n** Adding the password to the config\n" \ && qm set $VMID --cipassword $PASSWORD \ && printf "#* a password has been set for the default user\n" >> /etc/pve/nodes/$(hostname)/qemu-server/$VMID.conf printf "#- cloud-config used: via Proxmox\n" >> /etc/pve/nodes/proxmox/qemu-server/$VMID.conf fi -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -202,7 +202,7 @@ qm set $VMID --ide2 nas-cluster-store:cloudinit printf "\n** Specifying the cloud-init configuration format\n" qm set $VMID --citype $CITYPE printf "#** Made with create-cloud-template.sh - https://gist.github.com/seanb4t/8ac6908bb89bc68c7011b4417e8cca83\n" >> /etc/pve/nodes/$(hostname)/qemu-server/$VMID.conf ## TODO: Also ask for a network configuration. Or create a config with routing for a static IP printf "\n*** The script can add a cloud-init configuration with users and SSH keys from a file in the current directory.\n" -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -85,7 +85,7 @@ case $OSNR in VMIMAGE=hirsute-server-cloudimg-amd64.img NOTE="\n## Default user is 'ubuntu'\n" printf "$NOTE\n" wget -P /tmp -N https://cloud-images.ubuntu.com/hirsute/current/$VMIMAGE ;; 5) -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ printf "\n*** This script will download a cloud image and create a Proxmox VM te ## TODO ## - verify authenticity of downloaded images using hash or GPG printf "* Available templates to generate:\n 2) Debian 9\n 3) Debian 10\n 4) Ubuntu 21.04\n 5) Centos 7\n 6) CoreOS/Flatcar\n 7) Arch\n 8) Alpine 3.11\n 9) RancherOS 1.5.5\n\n" read -p "* Enter number of distro to use: " OSNR # defaults which are used for most templates -
seanb4t revised this gist
May 23, 2021 . No changes.There are no files selected for viewing
-
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -202,7 +202,7 @@ qm set $VMID --ide2 nas-cluster-store:cloudinit printf "\n** Specifying the cloud-init configuration format\n" qm set $VMID --citype $CITYPE printf "#** Made with create-cloud-template.sh - https://gist.github.com/seanb4t/8ac6908bb89bc68c7011b4417e8cca83\n" >> /etc/pve/nodes/proxmox/qemu-server/$VMID.conf ## TODO: Also ask for a network configuration. Or create a config with routing for a static IP printf "\n*** The script can add a cloud-init configuration with users and SSH keys from a file in the current directory.\n" -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -186,7 +186,7 @@ printf "\n** Importing the disk in qcow2 format (as 'Unused Disk 0')\n" qm importdisk $VMID /tmp/$VMIMAGE nas-cluster-store -format qcow2 printf "\n** Attaching the disk to the vm using VirtIO SCSI\n" qm set $VMID --scsihw virtio-scsi-pci --scsi0 nas-cluster-store:$VMID/vm-$VMID-disk-0.qcow2 printf "\n** Setting boot and display settings with serial console\n" qm set $VMID --boot c --bootdisk scsi0 --serial0 socket --vga serial0 -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -82,7 +82,7 @@ case $OSNR in VMID_DEFAULT=52000 read -p "Enter a VM ID for $OSNAME [$VMID_DEFAULT]: " VMID VMID=${VMID:-$VMID_DEFAULT} VMIMAGE=hirsute-server-cloudimg-amd64.img NOTE="\n## Default user is 'ubuntu'\n" printf "$NOTE\n" wget -P /tmp -N https://cloud-images.ubuntu.com/bionic/current/$VMIMAGE @@ -183,7 +183,7 @@ printf "\n** Creating a VM with $MEMORY MB using network bridge $BRIDGE\n" qm create $VMID --name $OSNAME-cloud --memory $MEMORY --net0 virtio,bridge=$BRIDGE printf "\n** Importing the disk in qcow2 format (as 'Unused Disk 0')\n" qm importdisk $VMID /tmp/$VMIMAGE nas-cluster-store -format qcow2 printf "\n** Attaching the disk to the vm using VirtIO SCSI\n" qm set $VMID --scsihw virtio-scsi-pci --scsi0 /var/lib/vz/images/$VMID/vm-$VMID-disk-0.qcow2 @@ -197,7 +197,7 @@ qm set $VMID --ipconfig0 ip=dhcp #qm set $VMID --ipconfig0 ip=10.10.10.222/24,gw=10.10.10.1 printf "\n** Creating a cloudinit drive managed by Proxmox\n" qm set $VMID --ide2 nas-cluster-store:cloudinit printf "\n** Specifying the cloud-init configuration format\n" qm set $VMID --citype $CITYPE -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -78,7 +78,7 @@ case $OSNR in ;; 4) OSNAME=ubuntu2104 VMID_DEFAULT=52000 read -p "Enter a VM ID for $OSNAME [$VMID_DEFAULT]: " VMID VMID=${VMID:-$VMID_DEFAULT} -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,7 @@ BRIDGE=vmbr0 USERCONFIG_DEFAULT=none # cloud-init-config.yml CITYPE=nocloud SNIPPETSPATH=/var/lib/vz/snippets SSHKEY=~/.ssh/sean.pub # ~/.ssh/id_rsa.pub NOTE="" case $OSNR in -
seanb4t revised this gist
May 23, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ read -p "* Enter number of distro to use: " OSNR # defaults which are used for most templates RESIZE=+30G MEMORY=2048 BRIDGE=vmbr0 USERCONFIG_DEFAULT=none # cloud-init-config.yml CITYPE=nocloud SNIPPETSPATH=/var/lib/vz/snippets -
seanb4t revised this gist
May 23, 2021 . No changes.There are no files selected for viewing
NewerOlder