Skip to content

Conversation

@SPFZ
Copy link

@SPFZ SPFZ commented Oct 29, 2025

Summary

When trying to create a VM on a ResourcePool in a Cluster on vcsim I ran into the error "error loading default device list:".
When investigating I found an issue that looked like the handling of Clusters was incomplete, therefore I added the missing part and my tests where successfull.

Type

  • fix: Bug Fix
  • feat: Feature or Enhancement
  • docs: Documentation
  • refactor: Refactoring
  • chore: Build, Dependencies, Workflows, etc.
  • other: Other (Please describe.)

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

Tests

  • Tests have been added or updated.
  • Tests have been completed.

Output:

Documentation

  • Documentation has been added or updated.

Issue References

Release Note

  • fix: BaseFromReference support for ClusterComputeResource

Additional Information

@SPFZ SPFZ requested a review from a team as a code owner October 29, 2025 12:29
@github-actions github-actions bot added provider Provider needs-review Needs Review size/xs Relative Sizing: Extra-Small labels Oct 29, 2025
@spacegospod
Copy link
Contributor

Hey @SPFZ your change looks correct but we can't rely on vcsim for validation and testing. You will have to make sure this works on a real vSphere setup.

When trying to create a VM on a ResourcePool in a Cluster on vcsim I ran into the error "error loading default device list:".

I find this odd since VM creation on resource pools works and I'm curious as to what your exact configuration was.

ComputeResouce is a base type that can represent either a standalone host or a cluster. For the latter case there is the derived type ClusterComputeResource.

govmomi should be able to identify a cluster by looking for it as a ComputeResource thus your change should not really be necessary. I suspect that this is only reproducible in vcsim

Also, BaseFromReference doesn't seem to be used when deploying VMs, in fact this is the only reference I could find is related to host management

parentCluster, err := computeresource.BaseFromReference(client, hsProps.Parent.Reference())

I suggest that you open an issue in the backlog that explains what the problem you are facing is and how you are reproducing it.

tenthirtyam
tenthirtyam previously approved these changes Oct 29, 2025
@SPFZ
Copy link
Author

SPFZ commented Oct 30, 2025

@spacegospod Thank you for taking a look so quickly. I might have to come back to creating a reproducible case.
However I just wanted to point out that I only implemented this because the existing comment said that this function should exist:
https://github.com/vmware/terraform-provider-vsphere/pull/2619/files#diff-70dc9e2c8226fbdb739048612c38a9dfc13680357ca2e791d1b39928d2640b7aL45-L47

@tenthirtyam tenthirtyam marked this pull request as draft November 25, 2025 17:31
@tenthirtyam tenthirtyam changed the title fix: BaseFromReference support for ClusterComputeResource [wip] fix: BaseFromReference support for ClusterComputeResource Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Needs Review provider Provider size/xs Relative Sizing: Extra-Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants