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

[Bug] VMware unable to resolve machines when adding to machine catalog #163

Open
davnport opened this issue Dec 12, 2024 · 1 comment
Open
Labels
bug Something isn't working 🔧

Comments

@davnport
Copy link

davnport commented Dec 12, 2024

Describe the bug

When to adding machines to a VMware machine catalog, the module is not able to resolve machines.

The machines are present and can be added from the Daas UI.
The active directory search appears to work as the code fails with a different error if i change the machine_account.

No combination of datacenter / host or datacenter / host / cluster resolve the VM.

The full path to the resources includes a folder - "XX-XXX-Host"
Is the module able to path through a folder?

"FullRelativePath": "hypervisors//allResources?path=XX-XXX.datacenter/XX-XXX-Host.folder/XX-XXX-xDev-01.cluster",

vcenter

  • datacenter
    • folder
      • cluster
        • host

Versions

$ terraform --version
Terraform v1.9.6
on linux_amd64

  • provider registry.terraform.io/citrix/citrix v1.0.8
  • provider registry.terraform.io/hashicorp/azuread v3.0.2
  • provider registry.terraform.io/hashicorp/azurerm v4.13.0

Terraform configuration files

# Create Machine Catalog
resource "citrix_machine_catalog" "machine-catalog" {
  name                     = var.machineCatalogName
  zone                     = data.citrix_zone.daas_zone.id
  allocation_type          = var.allocation_type
  session_support          = var.session_support
  minimum_functional_level = var.minimum_functional_level
  provisioning_type        = var.provisioning_type
  description              = var.description
  is_power_managed         = var.is_power_managed
  is_remote_pc             = var.is_remote_pc
  machine_accounts         = var.machines == null ? null : [
    {
      hypervisor = data.citrix_hypervisor.daas_hosting_connection.id
      machines   = var.machines
    }
  ]
}


variable "machines" {
  description = "List of machine objects or null if not specified"
  type        = list(object({
    region              = string
    resource_group_name = string
    machine_account     = string
    machine_name        = string
    datacenter          = string
    host                = string
  }))
  default     = null
}



module "citrix_machine_catalog" {
  source ="/mnt/local/code/terraform-sie-citrixmachinecatalog/module"
  clientId                          = "removed for example"
  citrixCustomerId                  = "removed for example"
  machineCatalogName                = "mc-Terraform-Test"
  description                       = "Terraform created Example manual power managed multi-session catalog"
  hypervisor                        = "removed for example"
  minimum_functional_level          = "L7_20"
  zone                              = "removed for example"
  machines = [
        {
          machine_account     = domain\\XXXtst-qtnww"
          machine_name        = "XXXTST-QTNWW"
          datacenter          = "removed for example"
          host                = "removed for example; used ip / hostname, host fqdn"
          region              = null
          resource_group_name = null
        },
        {
          machine_account     = "domain\\xxxsdctst-whxn1"
          machine_name        = "XXXTST-WHXN1"
          datacenter          = "removed for example"
          host                = "removed for example; used ip / hostname, host fqdn"
          region              = null
          resource_group_name = null
        }
      ]
}

Terraform console output

module.citrix_machine_catalog.citrix_machine_catalog.machine-catalog: Creating...
╷
│ Error: Error creating Machine Catalog
│ 
│   with module.citrix_machine_catalog.citrix_machine_catalog.machine-catalog,
│   on .terraform/modules/citrix_machine_catalog/main.tf line 49, in resource "citrix_machine_catalog" "machine-catalog":
│   49: resource "citrix_machine_catalog" "machine-catalog" {
│ 
│ TransactionId: bc106528-d9bf-4874-8fac-7573704a536f
│ Failed to resolve machines, error: could not find resource

Terraform log file

CitrixIssueId: 59627

@davnport davnport added the bug Something isn't working label Dec 12, 2024
@davnport davnport changed the title [Bug] [Bug] VMware unable to resolve machines when adding to machine catalog Dec 12, 2024
@zhuolun-citrix
Copy link
Collaborator

Hi @davnport ,

We have identified the cause of the issue. Currently our provider is not capable of locating cluster under folder or a path of folders. We will add a new property to allow specifying the folder path (if there's one) for the cluster.

Thank you,
Zhuolun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔧
Projects
None yet
Development

No branches or pull requests

3 participants