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

Add children datastore information under datastore cluster #2284

Closed
4 tasks done
nikfot opened this issue Oct 11, 2024 · 1 comment · Fixed by #2274
Closed
4 tasks done

Add children datastore information under datastore cluster #2284

nikfot opened this issue Oct 11, 2024 · 1 comment · Fixed by #2274
Labels
enhancement Type: Enhancement

Comments

@nikfot
Copy link
Contributor

nikfot commented Oct 11, 2024

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Currently the datastore cluster object only returns the id of the cluster. There is need to access the children of the cluster ( like supported in the gui under the tab datastores). With this PR we will enable the filtering of datastores based on the cluster object

Use Case(s)

In case the datastores are separated in clusters for some business reason, one would want to know which datastores are available under the required cluster, so the datastore choice will be made between them.

Potential Terraform Provider Configuration

main.tf:

data "vsphere_datastore_cluster" "datastore_cluster_data" {
  name          = var.vsphere_cluster_name
  datacenter_id = var.vsphere_dc_id
}

providers.tf:

provider "vsphere" {
  user                 = var.vcenter_name
  password             = var.vcenter_password
  vsphere_server       = var.vsphere_server
  allow_unverified_ssl = var.allow_unverified_ssl
}

terraform {
  required_providers {
    vsphere = {
      source  = "localhost/test/vsphere"
      version = "1.0.0"
    }
  }
}

outputs.tf:

output "all_ds" {
  value = data.vsphere_datastore_cluster.datastore_cluster_data.datastores
}

variables.tf:

variable "vsphere_cluster_name" {
  description = "Name of the vSpher cluster."
  type        = string
}

variable "vsphere_dc" {
  description = "Name of the vSpher datacenter you want to deploy the VM to."
  type        = string
}

variable "vsphere_dc_id" {
  description = "ID of the vSpher datacenter you want to deploy the VM to."
  type        = string
}

variable "vcenter_name" {
  description = "vSphere username"
  type        = string
}

variable "vcenter_password" {
  description = "Password for vCenter"
  type        = string
  sensitive   = true
}

variable "allow_unverified_ssl" {
  description = "Allow unverified ssl(true or false)"
  type        = bool
  default     = true
}

References

#2274

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 Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant