From 4b93360cb057cbababee9fc362631bfea121a0ae Mon Sep 17 00:00:00 2001 From: MickLesk Date: Mon, 25 May 2026 21:09:23 +0200 Subject: [PATCH] fix(add-iptag): use qm set for VM tags to handle snapshot sections correctly --- tools/pve/add-iptag.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/pve/add-iptag.sh b/tools/pve/add-iptag.sh index 4ea32df91..7725a90c5 100644 --- a/tools/pve/add-iptag.sh +++ b/tools/pve/add-iptag.sh @@ -811,13 +811,7 @@ update_tags() { if [[ "$type" == "lxc" ]]; then pct set "${vmid}" -tags "$(IFS=';'; echo "${next_tags[*]}")" &>/dev/null else - local vm_config="/etc/pve/qemu-server/${vmid}.conf" - if [[ -f "$vm_config" ]]; then - sed -i '/^tags:/d' "$vm_config" - if [[ ${#next_tags[@]} -gt 0 ]]; then - echo "tags: $(IFS=';'; echo "${next_tags[*]}")" >> "$vm_config" - fi - fi + qm set "${vmid}" --tags "$(IFS=';'; echo "${next_tags[*]}")" &>/dev/null fi else # Tags unchanged