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

fix: add version check for vsan hci mesh #1931

Merged
merged 3 commits into from
Jun 27, 2023
Merged

Conversation

zxinyu08
Copy link
Contributor

@zxinyu08 zxinyu08 commented Jun 16, 2023

Description

Add version check before handling vSAN HCI Mesh, since this feature is supported in 70U1 or later.

Test Result:

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:
End-to-end test on vSphere 7.0 with only vSAN enabled. Configuration won't be failed anymore.

$ terraform apply
data.vsphere_datacenter.datacenter: Reading...
data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-3]
vsphere_compute_cluster.cluster: Refreshing state... [id=domain-c45]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
  + create

Terraform will perform the following actions:

  # vsphere_compute_cluster.cluster will be created
  + resource "vsphere_compute_cluster" "cluster" {
      + datacenter_id                                         = "datacenter-3"
      + dpm_automation_level                                  = "manual"
      + dpm_enabled                                           = false
      + dpm_threshold                                         = 3
      + drs_automation_level                                  = "manual"
      + drs_enable_vm_overrides                               = true
      + drs_enabled                                           = false
      + drs_migration_threshold                               = 3
      + drs_scale_descendants_shares                          = "disabled"
      + ha_admission_control_host_failure_tolerance           = 1
      + ha_admission_control_performance_tolerance            = 100
      + ha_admission_control_policy                           = "resourcePercentage"
      + ha_admission_control_resource_percentage_auto_compute = true
      + ha_admission_control_resource_percentage_cpu          = 100
      + ha_admission_control_resource_percentage_memory       = 100
      + ha_admission_control_slot_policy_explicit_cpu         = 32
      + ha_admission_control_slot_policy_explicit_memory      = 100
      + ha_datastore_apd_recovery_action                      = "none"
      + ha_datastore_apd_response                             = "disabled"
      + ha_datastore_apd_response_delay                       = 180
      + ha_datastore_pdl_response                             = "disabled"
      + ha_enabled                                            = false
      + ha_heartbeat_datastore_policy                         = "allFeasibleDsWithUserPreference"
      + ha_host_isolation_response                            = "none"
      + ha_host_monitoring                                    = "enabled"
      + ha_vm_component_protection                            = "enabled"
      + ha_vm_dependency_restart_condition                    = "none"
      + ha_vm_failure_interval                                = 30
      + ha_vm_maximum_failure_window                          = -1
      + ha_vm_maximum_resets                                  = 3
      + ha_vm_minimum_uptime                                  = 120
      + ha_vm_monitoring                                      = "vmMonitoringDisabled"
      + ha_vm_restart_priority                                = "medium"
      + ha_vm_restart_timeout                                 = 600
      + host_cluster_exit_timeout                             = 3600
      + id                                                    = (known after apply)
      + name                                                  = "test"
      + proactive_ha_automation_level                         = "Manual"
      + proactive_ha_moderate_remediation                     = "QuarantineMode"
      + proactive_ha_severe_remediation                       = "QuarantineMode"
      + resource_pool_id                                      = (known after apply)
      + vsan_compression_enabled                              = false
      + vsan_dedup_enabled                                    = false
      + vsan_dit_encryption_enabled                           = false
      + vsan_dit_rekey_interval                               = (known after apply)
      + vsan_enabled                                          = true
      + vsan_network_diagnostic_mode_enabled                  = false
      + vsan_performance_enabled                              = false
      + vsan_stretched_cluster_enabled                        = false
      + vsan_unmap_enabled                                    = false
      + vsan_verbose_mode_enabled                             = false
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

vsphere_compute_cluster.cluster: Creating...
vsphere_compute_cluster.cluster: Creation complete after 7s [id=domain-c47]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
$ make testacc TESTARGS='-run=TestAccXXX'

...

Release Note

Release note for CHANGELOG:

BUG FIXES:

`r/vsphere_compute_cluster`:  Added version check for [vSphere 7.0.1 or later](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vsan.doc/GUID-9113BBD6-5428-4287-9F61-C8C3EE51E07E.html) when enabling vSAN HCI Mesh. ([#1931](https://github.com/terraform-providers/terraform-provider-vsphere/pull/1931))

References

Closes #1925

@zxinyu08 zxinyu08 requested a review from a team as a code owner June 16, 2023 12:04
@github-actions github-actions bot added provider Type: Provider size/s Relative Sizing: Small labels Jun 16, 2023
@tenthirtyam tenthirtyam changed the title Fix #1925: Add version check for vSAN HCI Mesh. fix: add version check for vsan hci mesh Jun 16, 2023
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :octocat: BUt will ask @appilon for review.

zxinyu08 and others added 2 commits June 26, 2023 15:56
Co-authored-by: Ryan Johnson <ryan@tenthirtyam.org>
Co-authored-by: Ryan Johnson <ryan@tenthirtyam.org>
@zxinyu08
Copy link
Contributor Author

Thanks @appilon @tenthirtyam for catching this, just committed changes.

Copy link
Contributor

@appilon appilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot easily test this situation but it seems fine. In general I don't like that these version edgecases are littered throughout the provider and sort of "silently fail". I think I'd prefer warnings or errors if a user tries to configure an attribute they don't have support for, but we can continue with precedant.

@appilon appilon merged commit 90e694a into hashicorp:main Jun 27, 2023
4 of 5 checks passed
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
provider Type: Provider size/s Relative Sizing: Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to create a cluster with vSAN enabled on 7.0 vSphere
3 participants