Closed Krishna-Jayanth closed 6 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.
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:
vra7_resource.ubu1: 1 error(s) occurred:
vra7resource.ubu1: Resource Machine Request Failed: vRealize API: [{Code:20117 Message:The data specified within the request is invalid. SystemMessage:The data specified within the request is invalid.} **{Code:11002 Message:The value of the 'cpu' field cannot be less than 4. SystemMessage:The value of the field with id cpu cannot be less than 4.}]_**
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.
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.