Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Error when reading data virtual machine with SRIOV adapter #2081

Conversation

vasilsatanasov
Copy link
Contributor

Description

Fixing error reated to the SRIOV feature:
Error: error setting network interfaces: Invalid address to set: []string{"network_interfaces", "3", "physical_function"}

The issue is that the data source schema is different from the resource schema and was missing the network_interfaces.#.physical_function attribute in the schema

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Testing is done manually since the SRIOV feature requires specific hardware.

HCL

// a vm with sr-iov netowrk adapter
data "vsphere_virtual_machine" "sriov-vm" {
  name = "sriov"
  datacenter_id = data.vsphere_datacenter.datacenter.id
}


output "vm" {
  value = data.vsphere_virtual_machine.sriov-vm
}

The network adapter of the vm output

"network_interfaces" = tolist([
    {
      "adapter_type" = "sriov"
      "bandwidth_limit" = 0
      "bandwidth_reservation" = 0
      "bandwidth_share_count" = 0
      "bandwidth_share_level" = ""
      "mac_address" = "00:50:56:9f:8d:d2"
      "network_id" = "dvportgroup-73"
      "physical_function" = "0000:1a:00.1"
    },
  ])

Release Note

Release note for CHANGELOG:

...

References

Fixing error reated to the SRIOV feature:
Error: error setting network interfaces: Invalid address to set: []string{"network_interfaces", "3", "physical_function"}

The issue is that the data source schema is different from the resource
schema and was missing the network_interfaces.#.physical_function
attribute in the schema

Signed-off-by: Vasil Atanasov <[email protected]>
@vasilsatanasov vasilsatanasov requested a review from a team as a code owner December 7, 2023 14:14
@github-actions github-actions bot added provider Type: Provider size/xs Relative Sizing: Extra-Small labels Dec 7, 2023
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tenthirtyam tenthirtyam merged commit 4236acf into hashicorp:main Dec 8, 2023
5 checks passed
@tenthirtyam tenthirtyam added this to the v2.6.1 milestone Dec 11, 2023
Copy link

This functionality has been released in v2.6.1 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
provider Type: Provider size/xs Relative Sizing: Extra-Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants