Compare commits

...
Author SHA1 Message Date
Rögl-Brunner Michel 50ebb715eb homeassistant: drop the AVX2 check from the install script
ct/homeassistant.sh already stops on the host before the container is
created, so the install script never runs on a host without AVX2.
2026-12-04 13:36:26 +01:00
Rögl-Brunner Michel 1cee105a39 haos-vm/homeassistant: fail install and update without AVX2
Home Assistant requires AVX2, so warning is not enough. The VM now stops
when the host lacks AVX2 or the chosen CPU model hides it. The LXC script
stops on the host before a container is created and inside the container
on update; the install script stops as well.
2026-12-04 13:28:26 +01:00
Rögl-Brunner Michel f7a5df96c3 haos-vm/homeassistant: default VM CPU to host and check for AVX2
The HAOS VM fell back to kvm64, which hides AVX2 from the guest even on
hosts that have it. Default to host, and warn (with a confirm) when the
host has no AVX2 or the chosen CPU model hides it. The LXC install now
warns on hosts without AVX2, and "Update ALL Containers" asks before
pulling images there.
2026-12-04 13:22:57 +01:00
2 changed files with 27 additions and 2 deletions

No files matched your search

+7
View File
@@ -21,6 +21,13 @@ variables
color
catch_errors
# Home Assistant requires AVX2. This runs on the host before a container is
# created, and inside the container when the update runs this script.
if [[ "$(arch_resolve)" == "amd64" ]] && ! grep -qw avx2 /proc/cpuinfo; then
msg_error "The host CPU does not support AVX2, which Home Assistant requires."
exit 106
fi
function update_script() {
header_info
check_container_storage
+20 -2
View File
@@ -51,7 +51,7 @@ function default_settings() {
DISK_SIZE="32G"
DISK_CACHE=""
HN="homeassistant"
CPU_TYPE=""
CPU_TYPE=" -cpu host"
CORE_COUNT="2"
RAM_SIZE="4096"
BRG="vmbr0"
@@ -81,7 +81,7 @@ function advanced_settings() {
vm_prompt_disk_size "$DISK_SIZE" "Set Disk Size in GiB (e.g., 10, 20)"
vm_prompt_disk_cache "writethrough"
vm_prompt_hostname "homeassistant"
vm_prompt_cpu_model "kvm64"
vm_prompt_cpu_model "host"
vm_prompt_cpu_cores "2"
vm_prompt_ram "4096"
vm_prompt_bridge "vmbr0"
@@ -100,9 +100,27 @@ function advanced_settings() {
fi
}
# Home Assistant requires AVX2. A guest only sees it when the host CPU has it
# and the VM CPU model passes it through (host, x86-64-v3 or x86-64-v4; kvm64
# and x86-64-v2-AES hide it).
function check_avx2() {
[[ "$(vm_arch)" == "amd64" ]] || return 0
if ! grep -qw avx2 /proc/cpuinfo; then
msg_error "The host CPU ($(grep -m1 'model name' /proc/cpuinfo | cut -d: -f2 | xargs)) does not support AVX2, which Home Assistant requires."
exit 106
fi
case "${CPU_TYPE# -cpu }" in
host | x86-64-v3 | x86-64-v4) ;;
*)
msg_error "The CPU model $(vm_cpu_model_label) hides AVX2 from the VM, which Home Assistant requires. Use host or x86-64-v3."
exit 106
;;
esac
}
vm_preflight
vm_start_script "Use Default Settings?" 10 58
check_avx2
post_to_api_vm
vm_select_storage "$HN"