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

Adding DLs servers in OneView fails #414

Closed ClaireHayard closed 2 years ago

ClaireHayard commented 3 years ago

Scenario/Intent

Hello,

I am adding some DLs servers in my OneView appliance with their hostname but it ends with an error. Suprisingly, the server hardwares are still added in the OneView.

Environment Details

Expected Result

The DLs servers are added in the OneView appliance.

Actual Result

err: unable to retrieve server hardware %!s(<nil>)
ClaireHayard commented 3 years ago

Hello @nabhajit-ray,

I tried to change the value of the licensing_intent = "OneView" to OneViewNoiLO but I get the same error as above.

nabhajit-ray commented 3 years ago

Can you import the resource and share the output of tfstate file.

ClaireHayard commented 3 years ago

Hello @nabhajit-ray,

I tried to import the resource however I still get the same error:

module.server_hardwares.oneview_server_hardware.ServerHardwares["i"]: Importing from ID "<server_hardware_name>"...
module.server_hardwares.oneview_server_hardware.ServerHardwares["i"]: Import prepared!
  Prepared oneview_server_hardware for import
module.server_hardwares.oneview_server_hardware.ServerHardwares["i"]: Refreshing state... [id=<server_hardware_name>]

Error: unable to retrieve server hardware %!s(<nil>)
satoqz commented 3 years ago

I'm facing the exact same issue with the oneview_server_hardware resource when trying to add an iLO (iLO Advanced License) to my OneView instance (6.30.00-0447630) that has available w/o iLO licenses.

Code and error for reference:

terraform {
  required_providers {
    oneview = {
      source  = "HewlettPackard/oneview"
      version = "6.3.1-13"
    }
  }
}

provider "oneview" {
  ov_endpoint   = "https://..."
  ov_username  = "..."
  ov_password   = "..."
  ov_sslverify = false
}

resource "oneview_server_hardware" "esx71_ilo" {
  hostname         = ""
  username         = ""
  password         = ""
  licensing_intent = "OneViewNoiLO"
}
$ terraform apply

Error: unable to retrieve server hardware %!s(<nil>)

The same error occurs when attempting to terraform import the resource.

ClaireHayard commented 3 years ago

Hello,

Is there any news on this issue ?

nabhajit-ray commented 3 years ago

The issue is fixed in master. Please check and let us know