You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a multi-site NSX-t environment with vSphere replication/SRM in order to protect some VMs, "nsxt_policy_vms" resource only returns one entry for a replicated VM.
A replicated VM from one site creates another VM in a second site with the same name as "placeholder". The "nsxt_policy_vms " resource returns an "items" dictonary based on display_name key. So, two VMs with same name is not possible. Therefore, it returns sometimes the wrong one. Depends on the order in NSX-t VMs inventory.
It would be nice to add some filters like :
VM power state
Compute Manager
Location ID
With thoses filters, we can force the resource to return only the expected VM.
Reproduction steps
Add two vcenters to nsx-t manager. Each one in a separate site.
Replicate a VM from one site to another. Or, create 2 VMs with same name.
Use "nsxt_policy_vms" resource in order to retrieves all VMs.
Expected behavior
Returned dictonary contains two VMs with the same name.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Hi @m-garrido, as you mentioned, this data source is defined by providing a map between display name and a certain type of VM id (single value), so by definition, it can not present two VMs with same name. What it can do, however, is fail the data source in case there are two VMs with same. Would you find this useful?
Hello @annakhm, thanks for the help.
I already know that a dictionary cannot have the same key twice. The aim of my issue is to report an incompatibility for this "data resource" when we use "vSphere replication". I think, VMware developpers can enhanced it by adding another filters like thoses i suggested for example. It would be nice. Just adding a filter for the state should fix that.
annakhm
changed the title
nsxt_policy_vms resource not returning multiple VMs with same name
Add additional filters to nsxt_policy_vms data source
Nov 29, 2022
Describe the bug
In a multi-site NSX-t environment with vSphere replication/SRM in order to protect some VMs, "nsxt_policy_vms" resource only returns one entry for a replicated VM.
A replicated VM from one site creates another VM in a second site with the same name as "placeholder". The "nsxt_policy_vms " resource returns an "items" dictonary based on display_name key. So, two VMs with same name is not possible. Therefore, it returns sometimes the wrong one. Depends on the order in NSX-t VMs inventory.
It would be nice to add some filters like :
With thoses filters, we can force the resource to return only the expected VM.
Reproduction steps
Expected behavior
Returned dictonary contains two VMs with the same name.
Additional context
No response
The text was updated successfully, but these errors were encountered: