HAOS VM: fall back to Home Assistant's own hosts for version and image (#18900)

* HAOS VM: fall back to Home Assistant's own hosts for version and image

40 runs in 14 days failed downloading the image from GitHub Releases, 18
of them outside the GitHub outage. os-artifacts.home-assistant.io serves
the same file (identical sha256), and version.home-assistant.io the same
channel files.

* Add alternative URL for Home Assistant image fetc
This commit is contained in:
CanbiZ (MickLesk)
2026-11-21 18:33:08 +01:00
committed by GitHub
parent 561add6ad7
commit 0b13c1288f

View File

@@ -18,6 +18,7 @@ DISK_SIZE="32G"
for channel in stable beta dev; do
channel_version=$(curl -fsSL "https://raw.githubusercontent.com/home-assistant/version/master/${channel}.json" | grep '"ova"' | cut -d '"' -f 4) || channel_version=""
[ -n "$channel_version" ] || channel_version=$(curl -fsSL "https://version.home-assistant.io/${channel}.json" | grep '"ova"' | cut -d '"' -f 4) || channel_version=""
printf -v "$channel" '%s' "$channel_version"
done
if [ -z "$stable" ]; then
@@ -117,7 +118,10 @@ fi
CACHE_FILE="$(vm_image_cache_path "$URL")"
msg_ok "${CL}${BL}${URL}${CL}"
vm_fetch_image "$URL" "$CACHE_FILE" --cache --verify-xz || exit 115
ALT_URL="https://os-artifacts.home-assistant.io/${BRANCH}/haos_ova-${BRANCH}.qcow2.xz"
if ! vm_fetch_image "$URL" "$CACHE_FILE" --cache --verify-xz; then
[ "$URL" != "$ALT_URL" ] && vm_fetch_image "$ALT_URL" "$CACHE_FILE" --cache --verify-xz || exit 115
fi
msg_info "Creating Home Assistant OS VM shell"
qm create $VMID${MACHINE} -bios ovmf -agent 1 -tablet 0 -localtime 1 ${CPU_TYPE} \