/var/log/syslog
and /var/log/proton/nsxapi.log
:SEGMENT_PORT promotion error. Manager id: ########-92bc-4306-85a1-############, Error : policy_error_code : Policy:500157 policy_error_message : Error during creating objects of type:SegmentPort policy_error_code : Policy:500045 policy_error_message : An object with the same path=[/infra/segments/dvportgroup-######/ports/default:########-92bc-4306-85a1-###########
] is marked for deletion. Either use another path or wait for the purge cycle (max 5 minutes) for permanent removal of the object.
This issue is resolved in VMware NSX 4.2.0
Workaround:
GET https://{{ip}}/policy/api/v1/infra/realized-state/realized-entities?intent_path=<intent path>
GET https://{{ip}}/policy/api/v1/infra/realized-state/realized-entities?intent_path=/infra/segments/<segment-name>/ports/default:########
-4670-495d-b5c4-###########
DELETE https://{{ip}}/policy/api/<intent path>
DELETE https://{{ip}}/policy/api/v1/infra/segments/<segment-name>/ports/default:########
-4670-495d-b5c4-###########
Note: NSX does a cleanup every 5 minutes, objects marked for delete should be cleaned during that time, with the initial GET you may find the object does not exist anymore, as it has been cleaned up during the cleanup period.
Note: If above DELETE API's say, the entity (realized object or intent) doesn't exists, then they have already been deleted. So, please go ahead and attempt MP to policy promotion.