Error while creating objects of type:Segment (code 500157) on Terraform
search cancel

Error while creating objects of type:Segment (code 500157) on Terraform

book

Article ID: 442195

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Attempted to rename NSX overlay segments with Terraform
  • Fails with an error stating that the NSX overlay segments that were supposed to be deleted already exist.

2026-05-19T11:46:28.357+0200 [INFO] provider.terraform-provider-nsxt_v3.9.0.exe: 2026/05/19 11:46:28 [ERROR]: Failed to create Segment #######################: Error while creating objects of type:Segment (code 500157)

  • Below retry timers are configured in Terraform

      max_retries = 2
      retry_min_delay = 0
      retry_max_delay = 500

Environment

VMware NSX 

Terraform Provider for VMware NSX

Cause

Inadequate retry settings on Terraform cause race conditions on segment deletion.

Resolution

There is no issue on the NSX.

Make sure to set retry times effectively on the Terraform to ensure that the segments are always successfully created after destroy.

Sample timers:

  max_retries = 5
  retry_min_delay = 0
  retry_max_delay = 2000