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

Deleting a Server Hardware Monitored fails - DL servers #501

Closed ClaireHayard closed 2 years ago

ClaireHayard commented 2 years ago

Scenario/Intent

Hello,

I am trying to destroy a Monitored DL Server Hardware from my infrastructure. However the code fails with an error.

Environment Details

Expected Result

The server is successfully deleted from the infrastructure.

Actual Result

Input: Configuration file

     server_hardwares = [
    {
      hostname = "ip@"
    }
  ]

In the tfstate

{
  "version": 4,
  "terraform_version": "0.13.7",
  "serial": 3,
  "lineage": "6d0dd6e7-da7f-d9f3-a213-eb4f3db628d3",
  "outputs": {},
  "resources": [
    {
      "mode": "managed",
      "type": "oneview_server_hardware",
      "name": "ServerHardwares",
      "provider": "provider[\"registry.terraform.io/hewlettpackard/oneview\"]",
      "instances": [
        {
          "index_key": "ip@",
          "schema_version": 0,
          "attributes": {
            "configuration_state": "Monitored",
            "force": true,
            "hostname": "ip@",
            "id": "37353738-3336-584D-5131-303030343037",
            "initial_scope_uris": [],
            "licensing_intent": "OneViewStandard",
            "location_uri": "null",
            "maintenance_mode": null,
            "mp_dns_name": "",
            "mp_firmware_version": "2.10 (02/18/2020)",
            "mp_hosts_and_ranges": [],
            "mp_ip_address": "",
            "name": "ip@",
            "one_time_boot": "Normal",
            "password": "************",
            "power_state": "Off",
            "server_group_uri": "null",
            "server_hardware_type_uri": "null",
            "server_power_state": [],
            "server_profile_uri": "null",
            "type": "server-hardware-12",
            "uid_state": "Unsupported",
            "uri": "/rest/server-hardware/37353738-3336-584D-5131-303030343037",
            "username": "username",
            "uuid": "37353738-3336-584D-5131-303030343037",
            "virtual_serial_number": "null",
            "virtual_uuid": ""
          }
        }
      ]
    }
  ]
}

Result of the terraform plan

image

alisha-k-kalladassery commented 2 years ago

Hi Claire,

We are not able to reproduce the issue with the configurations given. Please make sure you have the hardware in oneview within the scope which you are using. Kindly share a detailed log for us to debug further.

ClaireHayard commented 2 years ago

I am doing the suppression on DL servers: DL380 Gen10

Variables used in the code

  licensing_intent    = var.licensing_intent
  configuration_state = var.configuration_state
  force               = var.force
  hostname            = var.hostname
  username            = var.username
  password            = var.password

Details Input values

variable "configuration_state" {
  description = "Specifies the desired server state. Valid options are: Managed, Monitored."
  type        = string
  default     = "Monitored"
}

variable "licensing_intent" {
  description = "The type of product license to assign to the server hardware."
  type        = string
  default     = "OneViewStandard"
}
alisha-k-kalladassery commented 2 years ago

Hi Claire,

We have reproduced the issue and we have added it in our backlog. We will be picking it up as per priority.

Thanks