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

TF crash if PCI device attached to existing VM #1494

Closed
revog opened this issue Oct 14, 2021 · 3 comments
Closed

TF crash if PCI device attached to existing VM #1494

revog opened this issue Oct 14, 2021 · 3 comments
Labels
bug Type: Bug duplicate Status: Duplicate Issue

Comments

@revog
Copy link

revog commented Oct 14, 2021

Terraform Version

v1.0.5

vSphere Provider Version

v2.0.2

Affected Resource(s)

  • vsphere_virtual_machine with assigned PCI pass-through GPU (assigned in vCenter as Dynamic DirectPath IO)

Terraform Configuration Files

Debug Output

¦ Error: Plugin did not respond
¦
¦   with module.vsphere.vsphere_virtual_machine.node["<redacted-host-name>"],
¦   on modules/vsphere/vm.tf line 1, in resource "vsphere_virtual_machine" "node":
¦    1: resource "vsphere_virtual_machine" "node" {
¦
¦ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
?
2021/10/14 11:22:24 [DEBUG] DELETE https://<redacted-git-url>/api/v4/projects/185/terraform/state/dev/lock

Panic Output

Stack trace from the terraform-provider-vsphere_v2.0.2_x5 plugin:

panic: interface conversion: types.BaseVirtualDeviceBackingInfo is *types.VirtualPCIPassthroughDynamicBackingInfo, not *types.VirtualPCIPassthroughDeviceBackingInfo

goroutine 668 [running]:
github.com/hashicorp/terraform-provider-vsphere/vsphere.resourceVSphereVirtualMachineRead(0xc0008a0280, 0x14351a0, 0xc0006e02e0, 0x237d940, 0xc000059800)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vsphere/resource_vsphere_virtual_machine.go:507 +0x19b3
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc00015ae00, 0x19e30a8, 0xc000de7ac0, 0xc0008a0280, 0x14351a0, 0xc0006e02e0, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00015ae00, 0x19e30a8, 0xc000de7ac0, 0xc000e8d6c0, 0x14351a0, 0xc0006e02e0, 0xc000641a48, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:624 +0x1cb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00000c408, 0x19e30a8, 0xc000de7ac0, 0xc000de7b00, 0xc000de7ac0, 0x40b965, 0x16537a0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:575 +0x43b
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadResource(0xc0005e5300, 0x19e3150, 0xc000de7ac0, 0xc0003ca840, 0xc0005e5300, 0xc00109d890, 0xc0006dbba0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:298 +0x105
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler(0x16b5a40, 0xc0005e5300, 0x19e3150, 0xc00109d890, 0xc0003ca7e0, 0x0, 0x19e3150, 0xc00109d890, 0xc000b93800, 0x17c7)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00061c000, 0x19ed138, 0xc00061f200, 0xc000b27700, 0xc0001c0a20, 0x233e270, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/google.golang.org/grpc/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc00061c000, 0x19ed138, 0xc00061f200, 0xc000b27700, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/google.golang.org/grpc/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc0003d2020, 0xc00061c000, 0x19ed138, 0xc00061f200, 0xc000b27700)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/google.golang.org/grpc/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-vsphere/vendor/google.golang.org/grpc/server.go:857 +0x1fd

Error: The terraform-provider-vsphere_v2.0.2_x5 plugin crashed!

Expected Behavior

Update TF resource state or at least ignore the manual change and DO NOT crash

Actual Behavior

TF Provider crashes

Steps to Reproduce

Assign GPU as Dynamic DirectPath IO to VM in vCenter and run terraform plan

Important Factoids

When using the Non-Dynamic variant (DirectPath IO) - Provider is doing its job.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@revog revog added the bug Type: Bug label Oct 14, 2021
@revog
Copy link
Author

revog commented Oct 15, 2021

Additional information: Error occurs only if GPU is added as Dynamic DirectPath IO ... with DirectPath IO everything is working. For me this issues is now irrelevant - but will leave it open for future support of Dynamic type.

@tenthirtyam
Copy link
Collaborator

Duplicate of #1265.

cc @iBrandyJackson and @appilon

@appilon appilon added the duplicate Status: Duplicate Issue label Jan 27, 2022
@appilon appilon closed this as completed Jan 27, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug duplicate Status: Duplicate Issue
Projects
None yet
Development

No branches or pull requests

3 participants