Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: Only consider VirtualPCIPassthroughDeviceBackingInfo devices #1627

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

tenthirtyam
Copy link
Collaborator

@tenthirtyam tenthirtyam commented Mar 18, 2022

Description

Adds conditional to avoid a provider panic when a vGPU is added as a PCI device outside of Terraform to a virtual machine.

Testing

  • Esisting viirtual machine resource
  • Shutdown virtual machine
  • Add NVIDIA vGPU
  • Power on virtual machine
  • Run terraform apply with DEBUG logging.
TF_LOG=DEBUG TF_LOG_PATH=debug.txt terraform apply -auto-approve
vsphere_virtual_machine.vm: Refreshing state... [id=420c9aa5-4402-fd89-ff97-748c986b3c77]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Debug Log Message:

2022-03-18T18:15:49.176-0400 [INFO]  provider.terraform-provider-vsphere_v2.2.0: 2022/03/18 18:15:49 [DEBUG] vsphere_virtual_machine (ID = 420c9aa5-4402-fd89-ff97-748c986b3c77): PCI passthrough device &{{} "PCI device 0" "Dynamic DirectPath"} has no backing ID: timestamp=2022-03-18T18:15:49.176-0400

Release Note

resource/virtual_machine: Fixes provider panic when a vGPU is added as a PCI device direclty to a virtual machine. (GH-1627)

References

Closes #1265

Adds conditional to avoid a provider panic when a vGPU is added as a PCI device outside of Terraform to a virtual machine. #1265

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@tenthirtyam tenthirtyam added bug Type: Bug crash Impact: Crash needs-review Status: Pull Request Needs Review labels Mar 18, 2022
@tenthirtyam tenthirtyam added this to the v2.2.0 milestone Mar 18, 2022
@tenthirtyam tenthirtyam requested a review from appilon March 18, 2022 22:35
@tenthirtyam tenthirtyam self-assigned this Mar 18, 2022
@github-actions github-actions bot added provider Type: Provider size/xs Relative Sizing: Extra-Small labels Mar 18, 2022
@tenthirtyam tenthirtyam changed the title fix: Add conditional to avoid panic on vGPU additionl fix: Add conditional to avoid panic on vGPU addition Mar 22, 2022
@tenthirtyam tenthirtyam changed the title fix: Add conditional to avoid panic on vGPU addition fix: Only consider VirtualPCIPassthroughDeviceBackingInfo devices Mar 23, 2022
@appilon appilon merged commit 3a91c10 into main Mar 23, 2022
@appilon appilon deleted the bug/gh-1265 branch March 23, 2022 20:13
@tenthirtyam tenthirtyam removed the needs-review Status: Pull Request Needs Review label Mar 23, 2022
@github-actions
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 Apr 23, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Type: Bug crash Impact: Crash provider Type: Provider size/xs Relative Sizing: Extra-Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic if GRID vGPU is attached to VM
2 participants