-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: add support for vSAN unmap #1745
Conversation
This change adds the feature to supporte the vSAN unmap feature. In this code change, the vsan_unmap_enabled field is introduced, which maps to the vSAN enable state. By enabling the feature, vSAN can recognize the Trim/Unmap command from guestOS and relaim the storage space that is mapped to a deleted vSAN object.
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.
Great work, @SlimYang - just one comment that needs clarification in TestAccResourceVSphereComputeCluster_vsanUnmapDisabledwithVsanDisabled
for:
...
{
Config: testAccResourceVSphereComputeClusterConfigVSANUnmapDisabledwithVsanDisabled(),
Check: resource.ComposeTestCheckFunc(
testAccResourceVSphereComputeClusterCheckExists(true),
testAccResourceVSphereComputeClusterCheckVsanEnabled(false),
testAccResourceVSphereComputeClusterCheckUnmapEnabled(true),
}
...
Ryan Johnson
Senior Staff Solutions Architect | Product Engineering @ VMware, Inc.
Updates `TestAccResourceVSphereComputeCluster_vsanUnmapDisabledwithVsanDisabled` tests to use correct values.
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! 🚀
Terraform Configuration:
terraform {
required_providers {
vsphere = {
source = "local/hashicorp/vsphere"
version = "2.3.0"
}
}
required_version = ">= 1.2.5"
}
variable "vsphere_server" {
default = "10.168.185.142"
}
variable "vsphere_user" {
default = "administrator@vsphere.local"
}
variable "vsphere_password" {
default = "************"
}
provider "vsphere" {
user = var.vsphere_user
password = var.vsphere_password
vsphere_server = var.vsphere_server
allow_unverified_ssl = true
}
variable "hosts" {
default = [
"10.168.184.233",
"10.168.186.71",
"10.168.188.241",
"10.168.182.119",
"10.168.180.107",
"10.168.178.213"
]
}
data "vsphere_datacenter" "datacenter" {
name = "vsan-dc"
}
data "vsphere_host" "hosts" {
count = length(var.hosts)
name = var.hosts[count.index]
datacenter_id = data.vsphere_datacenter.datacenter.id
}
resource "vsphere_compute_cluster" "cluster" {
name = "vsan-cluster"
datacenter_id = data.vsphere_datacenter.datacenter.id
host_system_ids = data.vsphere_host.hosts.*.id
drs_enabled = "true"
drs_automation_level = "fullyAutomated"
ha_enabled = false
vsan_enabled = true
vsan_unmap_enabled = true
vsan_dedup_enabled = true
vsan_compression_enabled = true
vsan_performance_enabled = false
vsan_network_diagnostic_mode_enabled = false
vsan_verbose_mode_enabled = false
}
Results:
❯ terraform apply --auto-approve
data.vsphere_datacenter.datacenter: Reading...
data.vsphere_datacenter.datacenter: Read complete after 0s [id=datacenter-28]
data.vsphere_host.hosts[1]: Reading...
data.vsphere_host.hosts[5]: Reading...
data.vsphere_host.hosts[0]: Reading...
data.vsphere_host.hosts[4]: Reading...
data.vsphere_host.hosts[2]: Reading...
data.vsphere_host.hosts[3]: Reading...
data.vsphere_host.hosts[5]: Read complete after 1s [id=host-37]
data.vsphere_host.hosts[1]: Read complete after 1s [id=host-39]
data.vsphere_host.hosts[3]: Read complete after 1s [id=host-46]
data.vsphere_host.hosts[0]: Read complete after 1s [id=host-41]
data.vsphere_host.hosts[2]: Read complete after 1s [id=host-34]
data.vsphere_host.hosts[4]: Read complete after 1s [id=host-49]
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-28"
+ dpm_automation_level = "manual"
+ dpm_enabled = false
+ dpm_threshold = 3
+ drs_automation_level = "fullyAutomated"
+ drs_enable_vm_overrides = true
+ drs_enabled = true
+ 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
+ host_system_ids = [
+ "host-34",
+ "host-37",
+ "host-39",
+ "host-41",
+ "host-46",
+ "host-49",
]
+ id = (known after apply)
+ name = "vsan-cluster"
+ 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_enabled = true
+ vsan_network_diagnostic_mode_enabled = false
+ vsan_performance_enabled = false
+ vsan_unmap_enabled = true
+ vsan_verbose_mode_enabled = false
+ vsan_disk_group {
+ cache = (known after apply)
+ storage = (known after apply)
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
vsphere_compute_cluster.cluster: Creating...
vsphere_compute_cluster.cluster: Still creating... [10s elapsed]
vsphere_compute_cluster.cluster: Still creating... [20s elapsed]
vsphere_compute_cluster.cluster: Still creating... [30s elapsed]
vsphere_compute_cluster.cluster: Still creating... [40s elapsed]
vsphere_compute_cluster.cluster: Still creating... [50s elapsed]
vsphere_compute_cluster.cluster: Still creating... [1m0s elapsed]
vsphere_compute_cluster.cluster: Still creating... [1m10s elapsed]
vsphere_compute_cluster.cluster: Still creating... [1m20s elapsed]
vsphere_compute_cluster.cluster: Still creating... [1m30s elapsed]
vsphere_compute_cluster.cluster: Still creating... [1m40s elapsed]
vsphere_compute_cluster.cluster: Still creating... [1m50s elapsed]
vsphere_compute_cluster.cluster: Still creating... [2m0s elapsed]
vsphere_compute_cluster.cluster: Still creating... [2m10s elapsed]
vsphere_compute_cluster.cluster: Still creating... [2m20s elapsed]
vsphere_compute_cluster.cluster: Still creating... [2m30s elapsed]
vsphere_compute_cluster.cluster: Creation complete after 2m39s [id=domain-c53]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Desktop/untitled folder/vsan via 💠 default took 2m44s
Will merge once the final CI checks complete once more - CodeQL is still in progress. ¯_(ツ)_/¯ Ryan |
Had to make an empty commit to "kick" CodeQL from a stuck state. Checks have now passed. |
Updates `CHANGELOG.md` to include the feature provided in #1745. Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
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 change adds the feature to support the vSAN unmap feature. In this code change, the vsan_unmap_enabled field is introduced, which maps to the vSAN enable state. By enabling the feature, vSAN can recognize the Trim/Unmap command from GuestOS and reclaim the storage space that is mapped to a deleted vSAN object. The introduction for the unmap feature is recorded here: https://core.vmware.com/resource/vsan-space-efficiency-technologies.
Acceptance tests
Output from acceptance testing:
Release Note
Release note for CHANGELOG:
References
#1744