vmware-archive / legacy-terraform-provider-vra7

Terraform provider for vRealize Automation 7
Mozilla Public License 2.0
60 stars 35 forks source link

Unable to pass deployment_name to vRA #76

Open g1ps opened 6 years ago

g1ps commented 6 years ago

Hi,

I have been tryng to do this as our system requires this field for certain templates. Nothing I have tried works and, looking at the source code, there's no provision for it. I have tried adding various spellings of deployment_name to all of the resource groups. None of them work. Is this possible? If not, can it be added?

Many thanks.

hobovirtual commented 6 years ago

Hi @g1ps

Try this

catalog_configuration = { reasons = "Test" description = "deployment via terraform" provider-_deploymentName = "g1ps-test" }

Should meet your need. Thanks!

g1ps commented 6 years ago

Thank you. I'm not surprised I didn't find that.

I now have the problem that no Windows VMs in our catalogue are returning either name or IP at any time, even from refresh. I am using:

  resource_configuration = {
   ...
      ip_address  = ""
      name        = ""
  ...

with

output "ip" {
  value = "${vra7_resource.ansible_master.resource_configuration.ip_address}"
}

output "name" {
  value = "${vra7_resource.ansible_master.resource_configuration.name}"
}

Is it possible that I need to use different fields for Windows templates or is it likely to be something our IT guys have done with the templates?

hobovirtual commented 6 years ago

I haven't personally tested this in the past, quick test on my side and i get the same issue, nothing is getting returned.

I would suggest to open a new issue to get a better tracking on this issue/bug.

Here's my request request template

resource "vra7_resource" "deployment1" {
  count = 1
  catalog_name = "centOS 7"
  wait_timeout = 30

  resource_configuration = {
    vm1.datacenter_location = "New York Prod"
    vm1.cpu = 1
    vm1.VirtualMachine.Disk1.Size = 5
    vm1.custom.additional.ip = "true"
    vm1.ip_address = ""
    vm1.name = ""
  }

  catalog_configuration = {
    reasons = "Test"
    description = "deployment via terraform"
    provider-_deploymentName = "g1ps-test"
  }
}
output "vm1 IP Address" {
  value = "${vra7_resource.deployment1.resource_configuration.vm1.ip_address}"
}
output "vm1 Name" {
  value = "${vra7_resource.deployment1.resource_configuration.vm1.name}"
}

Here's the result

terraform show

vra7_resource.deployment1:
  id = 993126a6-fba9-4c40-9daa-9bd615e52de9
  catalog_configuration.% = 2
  catalog_configuration.description = deployment via terraform
  catalog_configuration.reasons = Test
  catalog_id = 2a01c902-6337-446e-ab6f-d6ee5cd38862
  catalog_name = centOS 7
  request_status = SUCCESSFUL
  resource_configuration.% = 5
  resource_configuration.vm1.VirtualMachine.Disk1.Size = 5
  resource_configuration.vm1.cpu = 1
  resource_configuration.vm1.custom.additional.ip = true
  resource_configuration.vm1.ip_address =
  resource_configuration.vm1.name =
  wait_timeout = 30

Outputs:

vm1 IP Address =
vm1 Name =

I'm running

Terraform v0.11.8
+ provider.vra7 (unversioned)
g1ps commented 6 years ago

I can't comment on show. refresh works for me with our RHEL template. Not with the Windows templates. I have the script returning name and IP as outputs, so refresh returns them as well.

hobovirtual commented 6 years ago

I haven't personally tested this in the past, quick test on my side and i get the same issue, nothing is getting returned.

I would suggest to open a new issue to get a better tracking on this issue/bug.

Here's my request request template

resource "vra7_resource" "deployment1" {
  count = 1
  catalog_name = "centOS 7"
  wait_timeout = 30

  resource_configuration = {
    vm1.datacenter_location = "New York Prod"
    vm1.cpu = 1
    vm1.VirtualMachine.Disk1.Size = 5
    vm1.custom.additional.ip = "true"
    vm1.ip_address = ""
    vm1.name = ""
  }

  catalog_configuration = {
    reasons = "Test"
    description = "deployment via terraform"
    provider-_deploymentName = "g1ps-test"
  }
}
output "vm1 IP Address" {
  value = "${vra7_resource.deployment1.resource_configuration.vm1.ip_address}"
}
output "vm1 Name" {
  value = "${vra7_resource.deployment1.resource_configuration.vm1.name}"
}

Here's the result

terraform show

vra7_resource.deployment1:
  id = 993126a6-fba9-4c40-9daa-9bd615e52de9
  catalog_configuration.% = 2
  catalog_configuration.description = deployment via terraform
  catalog_configuration.reasons = Test
  catalog_id = 2a01c902-6337-446e-ab6f-d6ee5cd38862
  catalog_name = centOS 7
  request_status = SUCCESSFUL
  resource_configuration.% = 5
  resource_configuration.vm1.VirtualMachine.Disk1.Size = 5
  resource_configuration.vm1.cpu = 1
  resource_configuration.vm1.custom.additional.ip = true
  resource_configuration.vm1.ip_address =
  resource_configuration.vm1.name =
  wait_timeout = 30

Outputs:

vm1 IP Address =
vm1 Name =

I'm running

Terraform v0.11.8
+ provider.vra7 (unversioned)

FYI

In my case the output field was corrected after refreshing properly my terraform provider installation/setup