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

MAC address missing from server profile connections #552

Open linkages opened 10 months ago

linkages commented 10 months ago

Scenario:

I need the MAC address of the various interfaces after creating a server profile from a server profile template deployed on a Synergy OneView cluster. This is to automate the creation of DHCP reservations in preparation for OS install.

Environment:

Terraform OneView Provider 8.6 API Version: 3800

Example:

resource "oneview_server_profile" "profile" { name = "servername" hardware_name = data.oneview_server_hardware.frame1-bay1.name server_hardware_type = data.oneview_server_profile_template.AZ1-SY480G11-20231215.server_hardware_type template = data.oneview_server_profile_template.AZ1-SY480G11-20231215.name scopes_uri = data.oneview_scope.scope.uri }

output "profile" { value = oneview_server_profile.profile.connection_settings sensitive = true }

Abbreviated output from "terraform output -json":

profile = toset([
  {
    "allocated_mbps" = 2500
    "allocated_vfs" = 0
    "boot" = tolist([
      {
        "boot_target" = toset([])
        "boot_vlan_id" = 0
        "boot_volume_source" = ""
        "ethernet_boot_type" = ""
        "iscsi" = tolist([])
        "priority" = "NotBootable"
      },
    ])
    "function_type" = "Ethernet"
    "id" = 2
    "interconnect_port" = 0
    "interconnect_uri" = "/rest/interconnects/c4867c10-59f7-4627-b51a-fd415e13372c"
    "ipv4" = tolist([])
    "isolated_trunk" = false
    "lag_name" = ""
    "mac" = ""
    "mac_type" = "Virtual"
    "managed" = true
    "maximum_mbps" = 50000
    "name" = "eth-1-b"
    "network_name" = ""
    "network_uri" = "/rest/ethernet-networks/c05a919a-9a37-49cc-814e-371a95892e45"
    "port_id" = "Mezz 3:2-a"
    "private_vlan_port_type" = "None"
    "requested_mbps" = "2500"
    "requested_vfs" = ""
    "state" = "Deployed"
    "status" = "OK"
    "wwnn" = ""
    "wwpn" = ""
    "wwpn_type" = ""
  },

notice how "mac" is empty.

Expected output from "terraform output -json":

profile = toset([
  {
    "allocated_mbps" = 2500
    "allocated_vfs" = 0
    "boot" = tolist([
      {
        "boot_target" = toset([])
        "boot_vlan_id" = 0
        "boot_volume_source" = ""
        "ethernet_boot_type" = ""
        "iscsi" = tolist([])
        "priority" = "NotBootable"
      },
    ])
    "function_type" = "Ethernet"
    "id" = 2
    "interconnect_port" = 0
    "interconnect_uri" = "/rest/interconnects/c4867c10-59f7-4627-b51a-fd415e13372c"
    "ipv4" = tolist([])
    "isolated_trunk" = false
    "lag_name" = ""
    "mac" = "66:1A:45:70:00:2B"
    "mac_type" = "Virtual"
    "managed" = true
    "maximum_mbps" = 50000
    "name" = "eth-1-b"
    "network_name" = ""
    "network_uri" = "/rest/ethernet-networks/c05a919a-9a37-49cc-814e-371a95892e45"
    "port_id" = "Mezz 3:2-a"
    "private_vlan_port_type" = "None"
    "requested_mbps" = "2500"
    "requested_vfs" = ""
    "state" = "Deployed"
    "status" = "OK"
    "wwnn" = ""
    "wwpn" = ""
    "wwpn_type" = ""
  },

The same thing happens when you use a data source as well.