terraform-provider-vsphere
terraform-provider-vsphere copied to clipboard
`r/vsphere_nas_datastore` not mounted to additional hosts as day-two
Community Guidelines
- [X] I have read and agree to the HashiCorp Community Guidelines .
- [X] Vote on this issue by adding a π reaction to the original issue initial description to help the maintainers prioritize.
- [X] Do not leave "+1" or other comments that do not add relevant information or questions.
- [X] If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Terraform
1.1.4
Terraform Provider
v2.0.2
VMware vSphere
7.0.3
Description
Adding additional ESXi hosts to the "host_system_ids" does not result in the datastore being mounted on the additional ESXi hosts. First after I unmount the datastore, remove the terraform state for the resource, and let terraform provision the datastore again, it is mounted to all hosts defined under ""host_system_ids".
Affected Resources
resource/vsphere_nas_datastore
Terraform Configuration
variable "all_esxi_hosts" {
default = [
"esxi01.sddc.lab",
"esxi02.sddc.lab",
"esxi03.sddc.lab" <--- newly added host
]
}
data "vsphere_host" "all_esxi_hosts" {
count = "${length(var.all_esxi_hosts)}"
name = "${var.all_esxi_hosts[count.index]}"
datacenter_id = "datacenter-1018"
}
resource "vsphere_nas_datastore" "ds15" {
name = "ds15"
host_system_ids = data.vsphere_host.all_esxi_hosts.*.id
remote_hosts = "192.158.1.10"
remote_path = "/ds15"
}
Debug Output
No response
Panic Output
No response
Expected Behavior
The datastore being mounted on the additional hosts.
Actual Behavior
The datastore is not mounted on the additional hosts.
Steps to Reproduce
The datastore is not mounted on the additional host.
Environment Details
No response
Screenshots
No response
References
No response
Hello, Β rutgerblom ! π
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.
Have you tried it similar to the following example:
https://github.com/tenthirtyam/terrafom-examples-vmware/tree/main/vsphere/vsphere-storage-nfs-datastore
Ryan
Of course, you may also need to verify that export can be mounted to the host manually in the event there is a communication or configuration issue (eg network configuration or allow list for the target).
Ryan
Of course, you may also need to verify that export can be mounted to the host manually in the event there is a communication or configuration issue (eg network configuration or allow list for the target).
Ryan
Thanks I will give that method a try.
Manually mounting the datastore works fine. It also gets mounted to all specified hosts if I do a "re-provision" of the datastore resource in terraform, but this is not a workaround that can be used in a production environment.
It's like terraform only performs the mounting during datastore provisioning (e.g. where it gets mounted to hosts for the first time). After that terraform does notice the additional host IDs I add and plans/applies these IDs to the datastore resource, but nothing actually happens
It's quite possibly a bug, or an implementation details of the original developers did not consider.
Let us know the results and we will prioritize as a bug or enhancement if that's the case.
Ryan
It's quite possibly a bug, or an implementation details of the original developers did not consider.
Let us know the results and we will prioritize as a bug or enhancement if that's the case.
Ryan
I tried using the "for each" method you suggested but the result is the same. Terraform applies the changes in its state but nothing happens. The next time I run terraform plan/apply it wants to commit the same changes again. It doesn't look like the vCenter API is contacted when running this or at least there is nothing in the hosts' event logs that indicates something is happening.
And again the very first time during data store resource provisioning the ESXi hosts get the datastore mounted. Thank you.
Rutger
Thanks, @rutgerblom. I've tagged the issue accordingly for bug triage and will discuss with the maintainers regarding options and prioritization.
Ryan
Hi Rutger,
I think I see the issue and will try and get some time next week to provide a working example that addressed the concern. If so, I'll PR the docs and update that as well. Stay tuned.
Ryan
Hi Ryan,
That sounds promising. Thanks for taking the time to look into this.
Rutger
Den lΓΆr 5 mars 2022 kl 01:47 skrev Ryan Johnson @.***>:
Hi Rutger,
I think I see the issue and will try and get some time next week to provide a working example that addressed the concern. If so, I'll PR the docs and update that as well. Stay tuned.
Ryan
β Reply to this email directly, view it on GitHub https://github.com/hashicorp/terraform-provider-vsphere/issues/1589#issuecomment-1059629413, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPMQVMPGWQ752H4LY7RL4LU6KVKRANCNFSM5OROIESQ . You are receiving this because you were mentioned.Message ID: @.***>
π Hi @rutgerblom - just an FYI that I haven't forgotten about this and started to review the code today.
Ryan Johnson Staff II Solutions Architect | VMware, Inc.
Thanks Ryan. Appreciate the effort you put into this.
Rutger
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.