-
Notifications
You must be signed in to change notification settings - Fork 452
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
feat: add vsan stretched cluster support #1885
Conversation
Hi @zxinyu08 👋 - Could we ask that you open an Ryan Johnson |
47a40a2
to
8162df4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need some changes but I think this PR shouldn't take too long to get ready for merging.
resource "vsphere_compute_cluster" "compute_cluster" { | ||
name = "testacc-compute-cluster" | ||
datacenter_id = data.vsphere_datacenter.rootdc1.id | ||
host_system_ids = [data.vsphere_host.roothost1.id, data.vsphere_host.roothost2.id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unfamiliar with vSAN in general, but for the record the CI and expected testing environment is setup as follows:
roothost1
Physical/main ESXi host expected to be in a default cluster we created on CI.
roothost2
nested ESXi host expected to be in a default cluster we created on CI.
roothost3
nested ESXi host you can feel free to move into a test specific cluster such as this one.
roothost4
same as 3.
Probably you don't want to put roothost1 in this cluster for sure, we can DM offline to get a sense for what you need for these tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also host 2,3,4 are only on a private network, 1 is on both public and private. Doesn't seem to affect the other vSAN tests in the past but thought I should add that context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have the setup of mixed nested and physical ESXis, but the performance might be unstable, so I'll replace hosts with roothost2/3/4 in case, and let's have a try to see if anything else needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To test stretched cluster, we could use roothost3 and roothost4 in primary and secondary fault domains, but we still need one more host outside of any cluster to be witness node, roothost1 and 2 doesn't meet this condition, so maybe this acceptance test will be failed as expected in CI, do we need keep code here and skip it? Or just let it failed and ignore its result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest the failure should be expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this vSAN case requires specific testing infrastructure which is not supported by the Acceptance environment. Looks we should consider skipping the test instead of accepting that it fails. What about introducing some env variables like TF_VSPHERE_VSAN_HOST_1, TF_VSPHERE_VSAN_HOST_2 and TF_VSPHERE_VSAN_WITNESS_HOST which will be the minimal setup for the stretched cluster
and add some info in the skip message or in the function which checks if they are present and set to describe what are the requirements for those hosts ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality looks OK for me, just need to add code to skip the e2e test until we have a infra for it on the Acc environment. Several more environment variables should be introduced
Agreed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
Post merge, follow-up on Vasil's comment is required regarding setting it to skip the e2e test until the CI can support it and the vars that need to be introduced.
Signed-off-by: Ryan Johnson <[email protected]>
This functionality has been released in v2.6.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
1 similar comment
This functionality has been released in v2.6.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
This feature is to support enabling and disabling vSAN stretched cluster. We added a new field
vsan_stretched_cluster
in compute cluster resource for its configurations.preferred_fault_domain_host_ids
- (Mandatory) The managed object IDs of the hosts to put in the first fault domain.secondary_fault_domain_host_ids
- (Mandatory) The managed object IDs of the hosts to put in the second fault domain.witness_node
- (Mandatory) The managed object IDs of the host selected as witness node when enable stretched cluster.preferred_fault_domain_name
- (Optional) The name of first fault domain. Default is Preferred.secondary_fault_domain_name
- (Optional) The name of second fault domain. Default is Secondary.Unit test for vSAN Stretched cluster enable/disable is added.
Testing Details:
We did end to end test based on the vSphere 7.0 and 8.0. A vSAN cluster could be set up from 3 standalone hosts and be converted to vSAN stretched cluster later by applying .tf file which contains the following settings, witness node is under datacenter but not in cluster.
To disable vSAN stretched cluster, we need remove
vsan_stretched_cluster
block. Some Negative E2E cases are passed: lack of mandatory fields, duplicately enable/disable.Acceptance Tests
Output from acceptance testing:
Release Note
References
Closes #1900