I was recently made aware of a KB article titled “Tag associations are not removed from vCenter Server database when associated objects are removed or deleted” (https://knowledge.broadcom.com/external/article?articleNumber=344960). The article includes a script that removes orphaned tag assignments left behind in the vCenter Server database after object deletion.
Investigating the Issue
After reviewing this article, I checked the vpxd.log
file on one of my lab vCenter Server instances and noticed frequent entries like the following:
2025-06-07T17:33:50.765Z error vpxd[06442] [Originator@6876 sub=Authorize opID=4be68587-f898-41b0-bbd4-2764f0941eaa Authz-7c] MoRef: vim.Datastore:datastore-4936 not found. Error: N5Vmomi5Fault21ManagedObjectNotFound9ExceptionE(Fault cause: vmodl.fault.ManagedObjectNotFound
To quantify this, I ran:
cat /var/log/vmware/vpxd/vpxd.log | grep -i vmodl.fault.ManagedObjectNotFound | wc -l
13738
cat /var/log/vmware/vpxd/vpxd.log | wc -l
210258
This showed that roughly 6.5% of the log entries were related to this specific fault, which strongly suggested lingering tag associations.
Reproducing the Issue
To test further, I moved to a clean vCenter environment with no history of tag usage. I created and tagged 10 virtual machines:
$newCat = New-TagCategory -Name 'h378-category' -Cardinality:Multiple -EntityType:VirtualMachine
0..9 |%{ New-Tag -Name "h378-tag$_" -Category $newCat }
new-vm -VMHost test-vesx-71* -Name "h378-vm0" -Datastore vc3-test03-sdrs -Template template-tinycore-160-cli-cc
1..9 | %{ new-vm -VMHost test-vesx-71* -Name "h378-vm$_" -Datastore vc3-test03-sdrs -Template template-tinycore-160-cli-cc }
New-TagAssignment -Tag (Get-Tag "h378*") -Entity (Get-VM "h378*")
Get-VM "h378*" | Remove-VM -DeletePermanently:$true -Confirm:$false
After deletion, there were no log entries related to orphaned tags. I queried the database using a modified version of the cleanup script in read-only mode and confirmed that no orphaned tag rows existed. This led me to revisit the KB and note that:
In vSphere 7 and 8, tag associations are automatically removed for Virtual Machines and Hosts when the associated object is deleted.
Confirming with Cluster Objects
I then repeated the test using cluster objects, which are not automatically cleaned up:
$newCat = New-TagCategory -Name 'h378-category-Cluster' -Cardinality:Multiple -EntityType:ClusterComputeResource
0..9 |%{ New-Tag -Name "h378-cluster-tag$_" -Category $newCat }
0..9 |%{ New-Cluster -Name "h378-cluster-$_" -Location (Get-Datacenter h378-test) }
New-TagAssignment -Tag (Get-Tag "h378-cluster*") -Entity (Get-Cluster "h378*")
get-cluster "h378*" | remove-cluster -Confirm:$false
Shortly after deletion, the vpxd.log
showed ManagedObjectNotFound
errors. I verified the orphaned rows using the following SQL query:
${VMWARE_POSTGRES_BIN}/psql -U postgres VCDB -h /var/run/vpostgres <<EOF
select * from cis_kv_keyvalue where kv_provider like 'tagging:%'
and
kv_key like 'tag_association urn:vmomi:ClusterComputeResource:%'
and
regexp_replace(kv_key, 'tag_association urn:vmomi:ClusterComputeResource:domain-c([0-9]+).*', '\1')::bigint
not in (select id from vpx_entity where type_id=3);
EOF
This confirmed 100 orphaned tag associations, which I then cleaned up using the provided tags_delete_job_all.sh
script.
Returning to the initial vCenter Server with ~6% of vpxd.log
entries coming from this issue, I proceeded to create a snapshot and run the same script. It only removed about 30 orphaned associations. However, now I’m not seeing the new vmodl.fault.ManagedObjectNotFound
entries showing up every few seconds.
Cleanup Results
Back on the original vCenter Server where the log showed high volumes of these errors, I took a snapshot and ran the cleanup script. It only removed around 30 entries, but new ManagedObjectNotFound
messages have stopped appearing.
This reduction is easy to monitor in Aria Operations for Logs, especially across multiple vCenter environments.

Conclusion
In my environments, VM and Host deletions are the most common, and these objects now clean up their tag associations automatically in recent vSphere versions. However, orphaned associations from cluster or other object types may remain, especially in environments upgraded over time.
By reviewing your vpxd.log and using the methods shown here, you can identify and remediate these issues efficiently.