Added default vga

This commit is contained in:
root 2024-01-21 03:52:19 +02:00
parent 92b86cebb2
commit f41ba1fbed
5 changed files with 87 additions and 8 deletions

39
Makefile Normal file
View File

@ -0,0 +1,39 @@
all:
echo OK
enable-alma-8:
touch flags/alma-8
enable-alma-9:
touch flags/alma-9
enable-debian-12:
touch flags/debian-12
enable-ubuntu-2204:
touch flags/ubuntu-2204
enable-all: enable-alma-8 enable-alma-9 enable-debian-12 enable-ubuntu-2204
cleanup-flags:
rm -fv flags/*
create:
bash create-proxmox-cloudinit-images.sh
create-all: enable-all create
destroy-debian-12:
qm destroy 9000
destroy-alma-8:
qm destroy 9001
destroy-alma-9:
qm destroy 9002
destroy-ubuntu2204:
qm destroy 9003
destroy-all: destroy-debian-12 destroy-alma-8 destroy-alma-9 destroy-ubuntu2204

1
REFENCES.md Normal file
View File

@ -0,0 +1 @@
* <https://github.com/Azure/azhpc-images/issues/305>

View File

@ -20,10 +20,11 @@ function createImage() {
apt install -y libguestfs-tools apt install -y libguestfs-tools
case "${IMAGE_TYPE}" in case "${IMAGE_TYPE}" in
deb*|ubuntu*) deb*|ubuntu*)
virt-customize -a ${IMAGE_FILE} --install qemu-guest-agent virt-customize -v -a ${IMAGE_FILE} --install qemu-guest-agent
;; ;;
alma*|rhel*|centos*) alma*|rhel*|centos*)
virt-customize -a ${IMAGE_FILE} --install qemu-guest-agent virt-customize -v -a ${IMAGE_FILE} --commands-from-file
virt-customize -v -a ${IMAGE_FILE} --install qemu-guest-agent
;; ;;
*) *)
echo "Unknown OS type" echo "Unknown OS type"
@ -31,13 +32,41 @@ function createImage() {
esac esac
fi fi
case "${IMAGE_TYPE}" in
deb*|ubuntu*)
DISPLAY_TYPE="serial"
;;
alma*|rhel*|centos*)
DISPLAY_TYPE="default"
;;
*)
DISPLAY_TYPE="default"
echo "Unknown OS type"
;;
esac
qm create ${IMAGE_ID} --name "${IMAGE_NAME}" --memory ${IMAGE_RAM} --cores ${IMAGE_CORES} \ qm create ${IMAGE_ID} --name "${IMAGE_NAME}" --memory ${IMAGE_RAM} --cores ${IMAGE_CORES} \
--net0 virtio,bridge=vmbr0 --net0 virtio,bridge=vmbr0
qm importdisk ${IMAGE_ID} ${IMAGE_FILE} ${IMAGE_STORE} qm importdisk ${IMAGE_ID} ${IMAGE_FILE} ${IMAGE_STORE}
qm set ${IMAGE_ID} --cpu cputype=x86-64-v2
qm set ${IMAGE_ID} --scsihw virtio-scsi-pci --scsi0 ${IMAGE_STORE}:vm-${IMAGE_ID}-disk-0 qm set ${IMAGE_ID} --scsihw virtio-scsi-pci --scsi0 ${IMAGE_STORE}:vm-${IMAGE_ID}-disk-0
qm set ${IMAGE_ID} --boot c --bootdisk scsi0 qm set ${IMAGE_ID} --boot c --bootdisk scsi0
qm set ${IMAGE_ID} --ide2 ${IMAGE_STORE}:cloudinit qm set ${IMAGE_ID} --ide2 ${IMAGE_STORE}:cloudinit
qm set ${IMAGE_ID} --serial0 socket --vga serial0
case "${DISPLAY_TYPE}" in
serial)
qm set ${IMAGE_ID} --serial0 socket --vga serial0
;;
default)
qm set ${IMAGE_ID} --vga std
;;
*)
qm set ${IMAGE_ID} --vga std
;;
esac
qm set ${IMAGE_ID} --agent enabled=1 qm set ${IMAGE_ID} --agent enabled=1
rm -vf "${IMAGE_FILE}" rm -vf "${IMAGE_FILE}"
@ -93,10 +122,12 @@ then
DEBIAN_12_IMAGE_URL="${DEBIAN_12_LOCAL_IMAGE_URL}" DEBIAN_12_IMAGE_URL="${DEBIAN_12_LOCAL_IMAGE_URL}"
fi fi
if [ -f "flags/debian-12" ]
then
createImage "${DEBIAN_12_IMAGE_URL}" "${DEBIAN_12_TEMPLATE_ID}" \ createImage "${DEBIAN_12_IMAGE_URL}" "${DEBIAN_12_TEMPLATE_ID}" \
"${DEBIAN_12_IMAGE_FILENAME}" "${DEBIAN_12_TEMPLATE_NAME}" \ "${DEBIAN_12_IMAGE_FILENAME}" "${DEBIAN_12_TEMPLATE_NAME}" \
"${DEBIAN_12_TEMPLATE_RAM}" "${DEBIAN_12_TEMPLATE_CORES}" "${DEBIAN_12_TEMPLATE_STORE}" "deb" "${DEBIAN_12_TEMPLATE_RAM}" "${DEBIAN_12_TEMPLATE_CORES}" "${DEBIAN_12_TEMPLATE_STORE}" "deb"
fi
## AlmaLinux 8 ## AlmaLinux 8
ALMA_8_IMAGE_URL="https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2" ALMA_8_IMAGE_URL="https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2"
@ -113,10 +144,12 @@ then
ALMA_8_IMAGE_URL="${ALMA_8_LOCAL_IMAGE_URL}" ALMA_8_IMAGE_URL="${ALMA_8_LOCAL_IMAGE_URL}"
fi fi
if [ -f "flags/alma-8" ]
then
createImage "${ALMA_8_IMAGE_URL}" "${ALMA_8_TEMPLATE_ID}" \ createImage "${ALMA_8_IMAGE_URL}" "${ALMA_8_TEMPLATE_ID}" \
"${ALMA_8_IMAGE_FILENAME}" "${ALMA_8_TEMPLATE_NAME}" \ "${ALMA_8_IMAGE_FILENAME}" "${ALMA_8_TEMPLATE_NAME}" \
"${ALMA_8_TEMPLATE_RAM}" "${ALMA_8_TEMPLATE_CORES}" "${ALMA_8_TEMPLATE_STORE}" "alma" "${ALMA_8_TEMPLATE_RAM}" "${ALMA_8_TEMPLATE_CORES}" "${ALMA_8_TEMPLATE_STORE}" "alma"
fi
## AlmaLinux 9 ## AlmaLinux 9
ALMA_9_IMAGE_URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2" ALMA_9_IMAGE_URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
@ -133,10 +166,13 @@ then
ALMA_9_IMAGE_URL="${ALMA_9_LOCAL_IMAGE_URL}" ALMA_9_IMAGE_URL="${ALMA_9_LOCAL_IMAGE_URL}"
fi fi
if [ -f "flags/alma-9" ]
then
createImage "${ALMA_9_IMAGE_URL}" "${ALMA_9_TEMPLATE_ID}" \ createImage "${ALMA_9_IMAGE_URL}" "${ALMA_9_TEMPLATE_ID}" \
"${ALMA_9_IMAGE_FILENAME}" "${ALMA_9_TEMPLATE_NAME}" \ "${ALMA_9_IMAGE_FILENAME}" "${ALMA_9_TEMPLATE_NAME}" \
"${ALMA_9_TEMPLATE_RAM}" "${ALMA_9_TEMPLATE_CORES}" "${ALMA_9_TEMPLATE_STORE}" "alma" "${ALMA_9_TEMPLATE_RAM}" "${ALMA_9_TEMPLATE_CORES}" "${ALMA_9_TEMPLATE_STORE}" "alma"
fi
## Ubuntu 22.04 ## Ubuntu 22.04
UBUNTU_2204_IMAGE_URL="https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img" UBUNTU_2204_IMAGE_URL="https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img"
@ -153,8 +189,10 @@ then
UBUNTU_2204_IMAGE_URL="${UBUNTU_2204_LOCAL_IMAGE_URL}" UBUNTU_2204_IMAGE_URL="${UBUNTU_2204_LOCAL_IMAGE_URL}"
fi fi
if [ -f "flags/ubuntu-2204" ]
then
createImage "${UBUNTU_2204_IMAGE_URL}" "${UBUNTU_2204_TEMPLATE_ID}" \ createImage "${UBUNTU_2204_IMAGE_URL}" "${UBUNTU_2204_TEMPLATE_ID}" \
"${UBUNTU_2204_IMAGE_FILENAME}" "${UBUNTU_2204_TEMPLATE_NAME}" \ "${UBUNTU_2204_IMAGE_FILENAME}" "${UBUNTU_2204_TEMPLATE_NAME}" \
"${UBUNTU_2204_TEMPLATE_RAM}" "${UBUNTU_2204_TEMPLATE_CORES}" "${UBUNTU_2204_TEMPLATE_STORE}" "alma" "${UBUNTU_2204_TEMPLATE_RAM}" "${UBUNTU_2204_TEMPLATE_CORES}" "${UBUNTU_2204_TEMPLATE_STORE}" "alma"
fi

0
flags/.placeholder Normal file
View File

1
update-alma-gpg.sh Normal file
View File

@ -0,0 +1 @@
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux