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

vsphere_virtual_disk created on v2.6.1 errors when running terraform plan with v2.7.0 #2162

Closed
4 tasks done
Jusaa opened this issue Apr 3, 2024 · 4 comments
Closed
4 tasks done
Assignees
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage upstream/govmomi Upstream: vmware/govmomi
Milestone

Comments

@Jusaa
Copy link

Jusaa commented Apr 3, 2024

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

v1.6.6

Terraform Provider

v2.7.0

VMware vSphere

v7.0.3.01700

Description

Upgrading to terraform-provider-vsphere v2.7.0 introduced a breaking bug for vsphere_virtual_disks created with older versions.

This happens as the vmdk_path variable is now correctly set after this fix: #1762

I tried changing the vmdk_path to match the actual old value from vsphere but it doesn't work, and it shouldn't work if I understand the code change correctly. What would be the proper steps to be able to upgrade to latest provider version?

Affected Resources or Data Sources

resource/vsphere_virtual_disk

Terraform Configuration

resource "vsphere_virtual_disk" "main" {
  size               = var.size
  vmdk_path          = "${var.path}/${var.name}.vmdk"
  datastore          = var.datastore
  datacenter         = var.datacenter
  type               = "thin"
  create_directories = false
}

Debug Output

Planning failed. Terraform encountered an error while generating this plan.
│ Error: Failed to query disk type

│ with module.example-data.vsphere_virtual_disk.main,
│ on ../../modules/disk/main.tf line 5, in resource "vsphere_virtual_disk" "main":
│ 5: resource "vsphere_virtual_disk" "main" {

Panic Output

No response

Expected Behavior

Plan after update to provider v2.7.0 passes with either no changes or possible change to the vsphere_virtual_disk configuration

Actual Behavior

Plan after update to provider v2.7.0 errors out

Steps to Reproduce

  1. Create vsphere_virtual_disk with vsphere provider v2.6.1
  2. Update provider to v2.7.0
  3. Run terraform plan

Environment Details

No response

Screenshots

No response

References

No response

@Jusaa Jusaa added bug Type: Bug needs-triage Status: Issue Needs Triage labels Apr 3, 2024
Copy link

github-actions bot commented Apr 3, 2024

Hello, Jusaa! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@algofol
Copy link

algofol commented Apr 11, 2024

Same for me:

Terraform
v1.7.2

Terraform Provider
v2.7.0

VMware vSphere
v8.0.1.00000

When changed vsphere provider version to 2.2.0 or even 2.6.1 it worked

@spacegospod
Copy link
Collaborator

We've picked up govmomi 0.37.1

@Jusaa
Copy link
Author

Jusaa commented May 15, 2024

Can confirm it works, we successfully updated to v2.8.1 without any problems!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage upstream/govmomi Upstream: vmware/govmomi
Projects
None yet
Development

No branches or pull requests

4 participants