export vmid=$1
newtags=$2
mycluster=$(pvesh get /cluster/resources --output json)
myvm=$(jq -er '.[]|select(.id == "qemu/"+env.vmid)' <<< $mycluster)
mynode=$(jq -r '.node' <<< $myvm)
current_tags=$(jq -r '.tags // empty' <<< $myvm)
pvesh set /nodes/$mynode/qemu/$vmid/config --tags "$current_tags $newtags"