HewlettPackard / terraform-provider-oneview

Automates the provisioning of physical infrastructure from a private cloud using templates from HPE OneView with Terraform
Apache License 2.0
49 stars 30 forks source link

fw name and version in datasource does not collect correct data object #463

Closed BoudewijnSwen closed 2 years ago

BoudewijnSwen commented 2 years ago

SDK version = 6.5.0-13 OV appliance version = 6.50.00-0452161

There was an issue (412), it got fixed. You can now add the name, version in the data object ID for a "oneview_firmware_drivers" object. Much better than before, thanks for that. However, I ran into a new issue with this method.

Issue description

I have a Service Pack and a Hotfix.

data "oneview_firmware_drivers" "qlogic_firmware_2_29_2" {
  id = "HPE QLogic NX2 Online Firmware Upgrade Utility for Linux x86_64 firmware, 7.18.82"
}

data "oneview_firmware_drivers" "hpe_service_pack_2021_05_0" {
  id = "Service Pack for ProLiant, 2021.05.0"
}

I created a custom bundle with them.

resource "oneview_firmware_drivers" "hpe_2021_05_0_and_qlogic_2_29_2_bundle" {
  baseline_uri = data.oneview_firmware_drivers.hpe_service_pack_2021_05_0.uri
  hotfix_uris = [data.oneview_firmware_drivers.qlogic_firmware_2_29_2.uri]
  custom_baseline_name = "HPE_2021_05_0_and_QLogic_2_29_2_bundle"
}

So now, if I want to use just the service pack (not the bundle with hotfix), I cannot select that anymore.

Outputting the data object uri shows the problem.

Before creating the bundle:

output "hpe_service_pack_2021_05_0" {
    value = data.oneview_firmware_drivers.hpe_service_pack_2021_05_0.uri
}

OUTPUT:
hpe_service_pack_2021_05_0 = "/rest/firmware-drivers/hpe_service_pack_2021_05_0"

After creating the bundle:

output "hpe_service_pack_2021_05_0" {
    value = data.oneview_firmware_drivers.hpe_service_pack_2021_05_0.uri
}
output "hpe_2021_05_0_and_qlogic_2_29_2_bundle" {
    value = data.oneview_firmware_drivers.hpe_2021_05_0_and_qlogic_2_29_2_bundle.uri
}

OUTPUT:
hpe_service_pack_2021_05_0 = "/rest/firmware-drivers/HPE_2021_05_0_and_QLogic_2_29_2_bundle"
hpe_2021_05_0_and_qlogic_2_29_2_bundle = "/rest/firmware-drivers/HPE_2021_05_0_and_QLogic_2_29_2_bundle"

The "hpe_service_pack_2021_05_0" should still select the same, the Service Pack, not the newly created Bundle. In the UI they are 2 separate objects still. But there is no other way to select them, the 'id' is required, and gives back the bundle in both cases.

nabhajit-ray commented 2 years ago

We will look into it and get back to you

nabhajit-ray commented 2 years ago

This is fixed in master branch, Closing it here,