-
Notifications
You must be signed in to change notification settings - Fork 35
Confusion creating multiple instances #133
Comments
@sametimesolutions From your use-case, 1 is the right way to do it. |
@Prativa20 Thank you for checking. |
I have the same question. I would love to be able to condense my environments under a single vRA deployment, but there doesn't seem to be a way to access the properties of the machines created when I think the intention of |
I have been using: deployment_configuration = { Then I realized that I can't dynamically grow or shrink my deployment. It doesn't trigger VRA to add or remove more instances. It only works for the initial apply. I changed to @sametimesolutions above recommendation: resource_configuration = { but it complains that I can't set vm._cluster higher than 1? Error: 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:11003 Message:The value of the '_cluster' field cannot be more than 1. SystemMessage:The value of the field with id _cluster cannot be more than 1.} {Code:400 Message: SystemMessage:}] |
I asked the same question on the other terraform-provider-vra7 repo (https://github.com/terraform-providers/terraform-provider-vra7/issues/47) and @Prativa20 answered "The scale in/out is a day 2 action and this feature is not implemented yet. Thanks for opening this feature request. I will update soon about the timeline." |
There are a couple of ways to create multiple instances using the VRA provider.
resource "vra7_resource" "my_vmware_node" {
wait_timeout = "${var.my_vmware_node_timeout}"
catalog_name = "my_vmware_node"
resource_configuration {
vSphere__vCenter__Machine_1.memory = "512"
vSphere__vCenter__Machine_1.cpu = "1"
vSphere__vCenter__Machine_1._cluster = "2"
resource "vra7_resource" "brad_vmware_node" {
wait_timeout = "${var.my_vmware_node_timeout}"
catalog_name = "my_vmware_node"
count = 2
Results of deployment:
1), 2 vms are created but the terraform state only has information about vSphere__vCenter__Machine_1. You can not get any of the information for n + 1 vms. This would require another call to vra to get the information.
2), 2 catalogs are created in vra and each catalog has 1 vm. You can access both of the vm state information based on the catalog resource[number] name. Which is better than option 1. The downside is you end up with a lot of catalog request in vra.
What is the right way to spin up multiple vms? Is it ok to have many catalog requests to achieve vm multiplicity? Is this the best practice? Or are these 2 distinct usecases and there is a bug in 1)?
The text was updated successfully, but these errors were encountered: