vmware-archive / legacy-terraform-provider-vra7

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

The build parameters are not passed to the blueprint request from terraform file. #1

Closed Krishna-Jayanth closed 6 years ago

Krishna-Jayanth commented 7 years ago

The values from the main.tf file is not picked up during provisioning. If I set min cpu less than allowed in blueprint the request has to fail but working we are setting the min value to default without boundary conditions. We need to test boundary conditions for all resources.

cars commented 7 years ago

How are you trying to pass the parameters? I am able to pass them successfully so far in my testing, and in the scenario you mention if they're passed correctly the build will fail. For example using the following blueprint with a single vm (vm1) I have the minimum # of CPUs set to 4. image

Using the main.tf as shown below I try to set the number of CPUs to 2: (vm1.cpu = "2")

provider  "vra7" {
    username = "${var.username}"
    password  = "${var.password}"
    tenant = "${var.tenant}"
    host = "${var.host}"
}

resource "vra7_resource" "ubu1" {
  count            = 1
  catalog_name = "UBU_LTS_tf"
  resource_configuration  {
    vm1.cpu = "2"
    vm1.lab.vm.prop1 = "ubu7 vm1 Prop1"
    vm1.lab.vm.Prop2 = "ubu7 vm1 Prop2"
  }
  catalog_configuration = {
    lab.bp.prop1 = "ubu7 BP Test1",
    lab.bp.Prop2 = "ubu7 BP Test2"
  }
}

When doing the terraform apply I get the following error:


Error: Error applying plan:

1 error(s) occurred:

virajindasrao commented 7 years ago

Hi, I have tested with both boundary test cases with min -1 and max +1 and got expected failure message as mentioned in above comment by @cars . Also, min and max value to the resource went through for me.