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

Unable to use SSD as vSAN capacity disk #1195

Closed
adarobin opened this issue Sep 1, 2020 · 11 comments
Closed

Unable to use SSD as vSAN capacity disk #1195

adarobin opened this issue Sep 1, 2020 · 11 comments
Labels
bug Type: Bug

Comments

@adarobin
Copy link
Contributor

adarobin commented Sep 1, 2020

Terraform Version

0.13.1

vSphere Provider Version

1.23.0

Affected Resource(s)

  • vsphere_compute_cluster

Terraform Configuration Files

resource "vsphere_compute_cluster" "cluster" {
    provider = vsphere.nested
    name = var.nested_cluster_name
    datacenter_id = vsphere_datacenter.datacenter.moid

    drs_enabled = true
    drs_automation_level = "fullyAutomated"
    ha_enabled = true
    ha_admission_control_policy = "disabled"
    vsan_enabled = true

    # I commented this out to confirm the dynamic block wasn't the source of the issue.
    # dynamic "vsan_disk_group" {
    #     for_each = var.esxi_hostname_ip_map
    #     iterator = host
    #     content {
    #         cache = compact([ for disk in vsphere_virtual_machine.nested_esxi[host.key].disk: disk.device_address == "scsi:0:1" ? "naa.${replace(lower(disk.uuid),"-","")}" : "" ])[0]
    #         storage = compact([ for disk in vsphere_virtual_machine.nested_esxi[host.key].disk: disk.device_address == "scsi:0:2" ? "naa.${replace(lower(disk.uuid),"-","")}" : "" ])
    #     }
    # }

    vsan_disk_group {
        cache = "naa.6000c29c4f89ebfb2cecf5e510451d2a"
        storage = [ "naa.6000c2978c0f17d04fa18da9f996e7ae" ]
    }

    host_system_ids = [ for k,v in var.esxi_hostname_ip_map : vsphere_host.nested_esxi[k].id ]
    depends_on = [
        vsphere_virtual_machine.vcenter,
    ]
}

Debug Output

Panic Output

Expected Behavior

terraform apply finished without error and the vSAN disk group was created.

Actual Behavior

module.nested-esxi-lab.vsphere_compute_cluster.cluster: Modifying... [id=domain-c9]

Error: A general system error occurred: Disk: naa.6000c2978c0f17d04fa18da9f996e7ae is an SSD and can not be used as a vSAN HDD

  on ../terraform-vsphere-nested-vsphere-lab/main.tf line 197, in resource "vsphere_compute_cluster" "cluster":
 197: resource "vsphere_compute_cluster" "cluster" {

Steps to Reproduce

If I manually set the capacityFlash flag on the SSD, then terraform apply is successful.

The vCenter GUI has a drop down selection between HDD and SSD for the capacity tier and then filters out drives that don't match. SSD disks seem to get the capacityFlash tag added to them automatically in this process.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@adarobin adarobin added the bug Type: Bug label Sep 1, 2020
@bill-rich bill-rich added needs-triage Status: Issue Needs Triage size/m Relative Sizing: Medium labels Sep 8, 2020
@adarobin
Copy link
Contributor Author

adarobin commented Sep 8, 2020

Since this is nested ESXi deployment I am messing around with, I was able to add a provisioner block to my ESXi virtual machines as a workaround:

  provisioner "remote-exec" {
    connection {
      type     = "ssh"
      user     = "root"
      password = random_password.esxi_root_password.result
      host     = "${each.key}.${var.domain}"
    }

    inline = [
      "esxcli vsan storage tag add -d ${compact([ for disk in self.disk: disk.device_address == "scsi:0:2" ? "naa.${replace(lower(disk.uuid),"-","")}" : "" ])[0]} -t capacityFlash",
    ]
  }

@bill-rich
Copy link
Contributor

Hi @adarobin! I have been having trouble reproducing the issue. Can you tell me what vSphere version you're using?

@adarobin
Copy link
Contributor Author

@bill-rich This was with vSphere 7.0

@bill-rich
Copy link
Contributor

Thanks! That may be what I was missing. I'll get a 7.0 environment to test with and see about getting this fixed.

@tenthirtyam
Copy link
Collaborator

Hi @adarobin - are you still seeing this issue in latest provider and TF?

Ryan

@tenthirtyam tenthirtyam added acknowledged Status: Issue or Pull Request Acknowledged waiting-response Status: Waiting on a Response labels Feb 8, 2022
@github-actions github-actions bot removed the waiting-response Status: Waiting on a Response label Feb 8, 2022
@tenthirtyam
Copy link
Collaborator

Marking this issue as closed as there is a workable solution with the provisioner.

From experience in both nested and physical all-flash vSAN deployment, this is a common requirement to tag SSDs as capacity flash. In fact, it's a requirement in Cloud Foundation before running Cloud Builder if the cache and capacity are the same size.

Ryan

@tenthirtyam tenthirtyam removed size/m Relative Sizing: Medium needs-triage Status: Issue Needs Triage labels Feb 12, 2022
@hashicorp hashicorp locked and limited conversation to collaborators Feb 12, 2022
@hashicorp hashicorp unlocked this conversation Feb 12, 2022
@adarobin
Copy link
Contributor Author

@tenthirtyam I haven’t been able to test this as my home lab is a bit of a mess right now. The workaround doesn’t work with anything newer than 7.0 Update 1 as newer releases have SHA-1 disabled for SSH by default.

@tenthirtyam tenthirtyam reopened this Feb 12, 2022
@tenthirtyam
Copy link
Collaborator

I'll reopen and take a look as some options against your module. We have some methods we (VMware) use to automate this that might be an option with a provisioner, but I'd be reticent to add the capacitFlash tagging to the scope of the provider.

Ryan

@tenthirtyam tenthirtyam added the needs-triage Status: Issue Needs Triage label Feb 12, 2022
@tenthirtyam tenthirtyam self-assigned this Feb 12, 2022
@adarobin
Copy link
Contributor Author

@tenthirtyam I’m ok with this being closed, I just wanted to call out that the workaround doesn’t work for 7.0 U2+ if other folks run into it. It should work once hashicorp/terraform#30134 is fixed.

@tenthirtyam
Copy link
Collaborator

Thanks for the update, Adam.

@tenthirtyam tenthirtyam removed needs-triage Status: Issue Needs Triage acknowledged Status: Issue or Pull Request Acknowledged labels Feb 13, 2022
@tenthirtyam tenthirtyam removed their assignment Feb 17, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants