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 - create_directories fails if creating multiple disks in parallel in the same directory #2309

Open
4 tasks done
skevir opened this issue Dec 12, 2024 · 1 comment
Assignees
Labels
bug Type: Bug needs-triage Status: Issue Needs Triage
Milestone

Comments

@skevir
Copy link
Contributor

skevir commented Dec 12, 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

1.9.8-1

Terraform Provider

2.9.2

VMware vSphere

8.0.1

Description

Provider fails to create all but one of the disks being created in parallel on a vSAN datastore - with errors:

Failed to create parent directories:  ServerFaultCode: A general system error occurred: Invalid fault: timestamp=2024-12-12T14:43:50.019Z
Failed to create parent directories:  ServerFaultCode: Cannot complete the operation because the file or folder [my-vsan-datastore] test-folder already exists: timestamp=2024-12-12T14:43:50.019Z

Looks to be related to #633 (fixed under #639) - maybe the error message has changed so the implementation of isAlreadyExists() no longer spots this case?

Interestingly I see two different errors for different disks (and that looks to also have been the case in issue 633) and it looks like the original fix only covered the one that specifically indicates the folder already exists (not the "general system error" one).

Affected Resources or Data Sources

resource/vsphere_virtual_disk

Terraform Configuration

resource "vsphere_virtual_disk" "test-disk-1" {
size = 10
vmdk_path = "test-folder/test-disk-1.vmdk"
create_directories = true
datacenter = "my-datacenter"
datastore = "my-vsan-datastore"
count = 1
type = "lazy"
}

resource "vsphere_virtual_disk" "test-disk-2" {
size = 10
vmdk_path = "test-folder/test-disk-2.vmdk"
create_directories = true
datacenter = "my-datacenter"
datastore = "my-vsan-datastore"
count = 1
type = "lazy"
}

resource "vsphere_virtual_disk" "test-disk-3" {
size = 10
vmdk_path = "test-folder/test-disk-3.vmdk"
create_directories = true
datacenter = "my-datacenter"
datastore = "my-vsan-datastore"
count = 1
type = "lazy"
}

Debug Output

https://gist.github.com/skevir/1805f2e30e304151acf0256e9c5cfd6c

Panic Output

No response

Expected Behavior

All vsphere_virtual_disks should be created, within the common parent directory.

Actual Behavior

Only one vsphere_virtual_disk is created.

Steps to Reproduce

terraform apply, using a vSAN datastore.

Environment Details

vSAN datastore being used.

Screenshots

No response

References

#633
#639

@skevir skevir added bug Type: Bug needs-triage Status: Issue Needs Triage labels Dec 12, 2024
@skevir
Copy link
Contributor Author

skevir commented Jan 7, 2025

Hi - any thoughts on this? Is there any additional information you need from me? Thanks.

@tenthirtyam tenthirtyam self-assigned this Jan 7, 2025
@tenthirtyam tenthirtyam added this to the On Deck milestone Jan 7, 2025
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
Projects
None yet
Development

No branches or pull requests

2 participants