From 951282291ba4425addbf3484043f698eb9016060 Mon Sep 17 00:00:00 2001 From: stb Date: Sun, 25 Jan 2026 11:33:08 +0100 Subject: [PATCH] Move to Debian 13 --- build-proxmox-template | 10 +++--- build-proxmox-template.orig | 67 +++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 5 deletions(-) create mode 100755 build-proxmox-template.orig diff --git a/build-proxmox-template b/build-proxmox-template index 31d36ea..5d63fdd 100755 --- a/build-proxmox-template +++ b/build-proxmox-template @@ -7,7 +7,7 @@ : "${VMID:=9023}" : "${STORAGE:=local-zfs}" -: "${OS:=debian-12}" +: "${OS:=debian-13}" : "${NAME:=chaos-${OS}-tmpl-$(date -u +%Y-%m-%d)}" : "${BRIDGE:=vmbr0,tag=208}" : "${AUTHORIZED_KEYS_URL:=https://git.hamburg.ccc.de/CCCHH/infrastructure-authorized-keys/raw/branch/trunk/authorized_keys}" @@ -29,12 +29,12 @@ cleanup() { wget -4 "$AUTHORIZED_KEYS_URL" -O authorized_keys -wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.tar.xz -O debian-12-generic-amd64.tar.xz -wget https://cloud.debian.org/images/cloud/bookworm/latest/SHA512SUMS -O SHA512SUMS +wget https://cloud.debian.org/images/cloud/trixie/latest/debian-13-generic-amd64.tar.xz -O debian-13-generic-amd64.tar.xz +wget https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUMS -O SHA512SUMS sha512sum --ignore-missing -c SHA512SUMS rm SHA512SUMS -tar -xf debian-12-generic-amd64.tar.xz -rm debian-12-generic-amd64.tar.xz +tar -xf debian-13-generic-amd64.tar.xz +rm debian-13-generic-amd64.tar.xz virt-customize -a disk.raw \ --update \ diff --git a/build-proxmox-template.orig b/build-proxmox-template.orig new file mode 100755 index 0000000..31d36ea --- /dev/null +++ b/build-proxmox-template.orig @@ -0,0 +1,67 @@ +#!/bin/bash + +# +# Build a disk image suitable for use as a Proxmox template in the CCCHH clusters. +# Needs apt install libguestfs-tools +# + +: "${VMID:=9023}" +: "${STORAGE:=local-zfs}" +: "${OS:=debian-12}" +: "${NAME:=chaos-${OS}-tmpl-$(date -u +%Y-%m-%d)}" +: "${BRIDGE:=vmbr0,tag=208}" +: "${AUTHORIZED_KEYS_URL:=https://git.hamburg.ccc.de/CCCHH/infrastructure-authorized-keys/raw/branch/trunk/authorized_keys}" + +set -eE + +tempfolder=$(mktemp -d /tmp/cloudinit-XXXXX) +pushd $tempfolder + + +trap cleanup SIGHUP SIGINT SIGQUIT SIGABRT ERR EXIT + +cleanup() { + echo "Removing temporary files" + popd 2> /dev/null || true + rm -rf $tempfolder + exit +} + + +wget -4 "$AUTHORIZED_KEYS_URL" -O authorized_keys +wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.tar.xz -O debian-12-generic-amd64.tar.xz +wget https://cloud.debian.org/images/cloud/bookworm/latest/SHA512SUMS -O SHA512SUMS +sha512sum --ignore-missing -c SHA512SUMS +rm SHA512SUMS +tar -xf debian-12-generic-amd64.tar.xz +rm debian-12-generic-amd64.tar.xz + +virt-customize -a disk.raw \ + --update \ + --install qemu-guest-agent \ + --uninstall openipmi \ + --run-command 'systemctl enable qemu-guest-agent' \ + --run-command 'systemctl enable fstrim.timer' + +qm destroy ${VMID} || true +qm create ${VMID} --name "creating-vm" --memory 2048 --net0 virtio,bridge=${BRIDGE} +qm importdisk ${VMID} disk.raw ${STORAGE} +rm disk.raw + +qm set ${VMID} --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-${VMID}-disk-0,ssd=1,discard=on +qm set ${VMID} --ide2 ${STORAGE}:cloudinit +qm set ${VMID} --boot c --bootdisk scsi0 +qm resize ${VMID} scsi0 16G +qm set ${VMID} --machine q35 +qm set ${VMID} --ostype l26 +qm set ${VMID} --cpu cputype=host +qm set ${VMID} --cores 1 +qm set ${VMID} --serial0 socket --vga serial0 +qm set ${VMID} --agent 1,fstrim_cloned_disks=1 +qm set ${VMID} --ciuser chaos +qm set ${VMID} --sshkeys ./authorized_keys +qm set ${VMID} --ipconfig0 ip=dhcp +qm set ${VMID} --name ${NAME} --tags debian12 +qm cloudinit update ${VMID} +qm template ${VMID} +popd