vmware / terraform-provider-nsxt

Terraform VMware NSX-T provider
https://www.terraform.io/docs/providers/nsxt/
Other
128 stars 83 forks source link

order realized VM results by external_id #1194

Closed paulzerkel closed 4 months ago

paulzerkel commented 4 months ago

This PR adds external_id as the sortByParam for calls to the realized VM endpoint. This is needed in larger environments (1k+ VMs) because as of NSX-T 3.2.3 the /policy/api/v1/infra/realized-state/virtual-machines endpoint is not respecting a consistent ordering by default. This means that the internal slice representing VMs returned from listAllPolicyVirtualMachines may include duplicates and may be missing VMs that actually exist. Explicitly setting an order forces consistent results across the paginated calls.

Resolves: #1193

vmwclabot commented 4 months ago

@paulzerkel, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

annakhm commented 4 months ago

/test-all

annakhm commented 4 months ago

Thank you @paulzerkel, merging this. Please note that we'll also be changing implementation for pulling VMs via search API rather than getting a full list. Unfortunately this functionality is not supported with NSX 3.2.3, but only starting from 4.1.2.

paulzerkel commented 4 months ago

Thanks for the heads up on the new functionality, @annakhm ! That will be a great improvement once we get to that version of NSX-T.