update cpu checks

This commit is contained in:
2026-07-25 23:38:23 -05:00
parent 70f5c09cec
commit baa7846a15
4 changed files with 83 additions and 10 deletions
+37 -9
View File
@@ -1219,11 +1219,30 @@ for guest in json.load(sys.stdin):
TAPM_QEMU_CPU_MODEL() {
local vmid="$1"
local node="$2"
local config_file
local config_output
local cpu_model
[[ "$vmid" =~ ^[1-9][0-9]{2,8}$ ]] || return 1
[[ "$node" =~ ^[A-Za-z0-9][A-Za-z0-9._-]{0,62}$ ]] || return 1
config_file="/etc/pve/nodes/${node}/qemu-server/${vmid}.conf"
if [[ -r "$config_file" ]]; then
cpu_model="$(
awk '
$1 == "cpu:" {
sub(/^[^:]*:[[:space:]]*/, "")
print
exit
}
' "$config_file"
)" || return 1
[[ -n "$cpu_model" ]] || cpu_model='kvm64'
printf '%s\n' "$cpu_model"
return 0
fi
# Fall back to the node-aware API if the shared pmxcfs entry is briefly
# unavailable, such as while cluster membership is changing.
config_output="$(
pvesh get "/nodes/${node}/qemu/${vmid}/config" \
--output-format json 2>/dev/null
@@ -1696,7 +1715,11 @@ FORCE_UPDATE_CHECK() {
MENU_HEADER() {
local version_display
LOAD_UPDATE_STATUS
# Reuse a settled update result instead of running Git checks on every
# arrow-key redraw. Continue refreshing only while the worker is pending.
if [[ "$UPDATE_STATUS" == 'unknown' || "$UPDATE_STATUS" == 'checking' ]]; then
LOAD_UPDATE_STATUS
fi
case "$UPDATE_STATUS" in
behind)
version_display="${idsCL[LightYellow]}${VERS} ** UPDATE AVAILABLE **${idsCL[Default]}"
@@ -1844,12 +1867,8 @@ HOST_SETUP_MENU() {
labels+=("Detect CPU model for live migrations")
values+=("cpu")
TAPM_REFRESH_ISO_STORAGES >/dev/null 2>&1 || true
if TAPM_ANY_LOCAL_VIRTIO_ISOS; then
labels+=("VirtIO driver downloads (local ISOs available)")
else
labels+=("VirtIO driver downloads")
fi
# Discover ISO storage only after the VirtIO submenu is selected.
labels+=("VirtIO driver downloads")
values+=("virtio")
command -v glances >/dev/null 2>&1 &&
@@ -1881,10 +1900,19 @@ MONITORING_MENU() {
local -a labels
local -a values=("pulse" "rmm" "acronis" "sentinelone" "screenconnect")
local cluster_resources
local pulse_status
while true; do
cluster_resources="$(pvesh get /cluster/resources --type vm --output-format json 2>/dev/null)"
TAPM_PULSE_RESOURCE_INSTALLED "$cluster_resources" &&
TAPM_PULSE_RESOURCE_INSTALLED_FROM_CONFIGS
pulse_status=$?
if (( pulse_status == 2 )); then
cluster_resources="$(
pvesh get /cluster/resources --type vm --output-format json 2>/dev/null
)"
TAPM_PULSE_RESOURCE_INSTALLED "$cluster_resources"
pulse_status=$?
fi
(( pulse_status == 0 )) &&
labels=("Pulse monitoring (installed)") ||
labels=("Install Pulse monitoring")