Skip to content

[Bug]: ethernet port: error when importing VLANs in multi-node clusters #479

@acch

Description

@acch

Terraform Core Version

1.7.1

ONTAP Provider Version

2.1.1

Affected Resource(s)

  • netapp-ontap_port

Expected Behavior

Importing ethernet_port (VLAN) resources should work in multi-node clusters. The following configuration should apply successfully:

import {
  to = module.....netapp-ontap_port.data["nodea"]
  id = "cluster1,a0a-1234"
}

import {
  to = module.....netapp-ontap_port.data["nodeb"]
  id = "cluster1,a0a-1234"
}

(note that the import identifier does not currently contain the nodename - which makes the portname alone ambiguous)

Actual Behavior

Importing ethernet_port (VLAN) resources does not work in multi-node clusters. The following configuration produces an error:

import {
  to = module.....netapp-ontap_port.data["nodea"]
  id = "cluster1,a0a-1234"
}

import {
  to = module.....netapp-ontap_port.data["nodeb"]
  id = "cluster1,a0a-1234"
}

Relevant Error/Panic Output Snippet

╷
│ Error: Error Reading Ethernet Port Info
│
│ Error on GET /network/ethernet/ports/: received 2 or more records when only
│ one is expected - statusCode 200, err=<nil>,
│ response=restclient.RestResponse{NumRecords:2,
│ Records:[]map[string]interface {}{...}

Terraform Configuration Files

resource "netapp-ontap_port" "data" {
  for_each = toset(["nodea"], ["nodeb"])

  cx_profile_name = "cluster1"

  broadcast_domain = {
    id = netapp-ontap_network_broadcast_domain.data.id
  }

  node = {
    name = each.key
  }

  type = "vlan"
  vlan = {
    base_port = "a0a"
    tag       = "1234"
  }
}

Steps to Reproduce

  • terraform init
  • terraform plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions