Inventory sync not happening on NSX manager due to duplicate entries for dvpg and vnic relation
search cancel

Inventory sync not happening on NSX manager due to duplicate entries for dvpg and vnic relation

book

Article ID: 306106

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

Symptoms:

1. Inventory sync keeps failing and VC disconnection keeps happening with inventory thread. As a result, inventory stops getting updated
2. vsm logs on NSX manager have the following error:

WARN ViInventoryThread SqlExceptionHelper:129 - SQL Error: 0, SQLState: 23505
ERROR ViInventoryThread SqlExceptionHelper:131 - ERROR: duplicate key value violates unique constraint "domain_object_relationships_pkey"
Detail: Key (source_id, target_id, relationship)=(dvportgroup-xxxxxx, <vnic id>, dependent_dependency) already exists.

Environment

VMware NSX for vSphere 6.4.x

Cause

While associating dvpg with VM/vnic, the operation can fail and also cause inventory sync failure. This is in case, relationship between dvpg and vnic already exists in NSX manager DB.

Resolution

The issue has been fixed in NSX version 6.4.4 by checking first for existence of relationship between dvpg id and vnic.
If such relationship exists, the step to create the same relationship is skipped.