HewlettPackard/terraform-provider-oneview

Can not retrieve some networks as data source

pgsmith123 opened this issue · 2 comments

OneView 6.1
HewlettPackard/oneview 6.4.0-13

When attempting to retrieve networks as data sources some networks return null values. Some work and some don't. There is no visible difference in the GUI nor the API return data between the results that work and those that don't.


NOT WORKING

data "oneview_ethernet_network" "_2533" {
name = "2533-ict.​az1.mpsbatch.test"
}
output "_2533" {
value = data.oneview_ethernet_network._2533.uri
}

PS C:\Users\pgsmith\Documents\GIT\hpe\networking\network_sets\DC-AZ2> terraform plan
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

PS C:\Users\pgsmith\Documents\GIT\hpe\networking\network_sets\DC-AZ2> $result = invoke-restmethod -uri "$url/ethernet-networks?count=1000" -method GET -contentType $ct -Headers $header

PS C:\Users\pgsmith\Documents\GIT\hpe\networking\network_sets\DC-AZ2> $result.members | ? {$_.name -eq '2533-ict.az1.mpsbatch.test'}

type : ethernet-network
uri : /rest/ethernet-networks/8eaf3b34-d712-4731-83db-872257aceb48
category : ethernet-networks
eTag : d38a65ab-6369-4f29-9938-a7ddb833a4da
created : 10/26/2020 3:32:31 PM
modified : 10/26/2020 3:32:31 PM
vlanId : 2533
connectionTemplateUri : /rest/connection-templates/f6e094c0-e84d-403f-86dc-22618471778a
privateNetwork : False
smartLink : False
internalVlanId : 0
purpose : General
description :
state : Active
name : 2533-ict.az1.mpsbatch.test
status : OK


WORKING

data "oneview_ethernet_network" "_2529" {
name = "2529-ict.az1.dft-biztalk-prod"
}
output "_2529" {
value = data.oneview_ethernet_network._2529.uri
}

PS C:\Users\pgsmith\Documents\GIT\hpe\networking\network_sets\DC-AZ2> terraform plan
Changes to Outputs:

  • _2529 = "/rest/ethernet-networks/fa98b44c-dbe3-41e9-afc3-13adbfe8c870"
    You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.

PS C:\Users\pgsmith\Documents\GIT\hpe\networking\network_sets\DC-AZ2> $result.members | ? {$_.name -eq '2529-ict.az1.dft-biztalk-prod'}

type : ethernet-network
uri : /rest/ethernet-networks/fa98b44c-dbe3-41e9-afc3-13adbfe8c870
category : ethernet-networks
eTag : 57703f57-1848-4dee-909d-00c1e1adb0bd
created : 10/2/2020 7:22:34 PM
modified : 10/2/2020 7:22:34 PM
vlanId : 2529
connectionTemplateUri : /rest/connection-templates/1a1a1916-da36-474b-9a3e-7d2f73bddcd7
privateNetwork : False
smartLink : False
internalVlanId : 0
purpose : General
description :
state : Active
name : 2529-ict.az1.dft-biztalk-prod
status : OK

Hi @pgsmith123

Can you share the result of terraform apply in the first scenario where terraform plan did not show any changes?

We did not hear from you. Please feel free to re-open if it is not resolved.