hashicorp / terraform-provider-vsphere

Terraform Provider for VMware vSphere
https://registry.terraform.io/providers/hashicorp/vsphere/
Mozilla Public License 2.0
622 stars 453 forks source link

`vsphere_host_virtual_switch` resource attempts to change the VMNIC order #1503

Closed CSimpiFoN closed 2 years ago

CSimpiFoN commented 3 years ago

Terraform Version

v1.0.3

vSphere Provider Version

v2.0.2

Affected Resource(s)

tenthirtyam commented 3 years ago

🤔

This is interesting since each of the elements are a TypeList vs. TypeSet and thus, these should retain the order when a list.

https://github.com/hashicorp/terraform-provider-vsphere/blob/cac9fff27921ab083e6ddd1f34989d54fa0214a2/vsphere/host_virtual_switch_structure.go#L56-L62

https://github.com/hashicorp/terraform-provider-vsphere/blob/cac9fff27921ab083e6ddd1f34989d54fa0214a2/vsphere/host_network_policy_structure.go#L35-L45

Reference: https://www.terraform.io/docs/extend/schemas/schema-types.html

tenthirtyam commented 2 years ago

@appilon, do you have any thoughts on why the order could be lost in the above?

Ryan

tenthirtyam commented 2 years ago

Hi @CSimpiFoN,

I attempted to run a reproduction of this reported issue a testbed today, but I was unable to observe the reported behavior with the same configuration. All tests ran with the expected results - vmnic1 and vmnic4 remained in the same order with every apply.

Terraform v1.1.5
Provider: v2.0.2
vSphere: v7.0.3(c)

Basic example:

resource "vsphere_host_virtual_switch" "switch" {
  name            = "gh-1503"
  host_system_id  = data.vsphere_host.host.id
  number_of_ports = 42
  mtu             = 1500

  network_adapters = ["vmnic1", "vmnic4"]

  active_nics    = ["vmnic1", "vmnic4"]
  standby_nics   = []
  teaming_policy = "loadbalance_ip"

  allow_promiscuous      = false
  allow_forged_transmits = false
  allow_mac_changes      = false

  shaping_average_bandwidth = 0
  shaping_burst_size        = 0
  shaping_peak_bandwidth    = 0
}

Are you still experiencing this issue?

Ryan Johnson Staff II Solutions Architect | VMware, Inc.

tenthirtyam commented 2 years ago

Marking this issue as closed based on the inability to reproduce the issue and no community reactions. 👍🏻 👎🏻

If the issue persists with the latest version of the provider, even using the basic config example above, please open a new issue and reference this issue for additional context. If/when opening a new issue, please provide a copy of the module in a Gist as this would be helpful.

Ryan Johnson Staff II Solutions Architect | VMware, Inc.

github-actions[bot] commented 2 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.