Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Confusion creating multiple instances #133

Open
sametimesolutions opened this issue Mar 5, 2019 · 5 comments
Open

Confusion creating multiple instances #133

sametimesolutions opened this issue Mar 5, 2019 · 5 comments

Comments

@sametimesolutions
Copy link

sametimesolutions commented Mar 5, 2019

There are a couple of ways to create multiple instances using the VRA provider.

  1. Using the _cluster property:
    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"
  2. Using the catalog count:
    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)?

@sametimesolutions sametimesolutions changed the title Confusion Creating multiple instances Confusion creating multiple instances Mar 5, 2019
@Prativa20
Copy link
Contributor

@sametimesolutions From your use-case, 1 is the right way to do it.
But, I will have to investigate why terraform show is not showing the states of these two machines separately. Will get back to you

@sametimesolutions
Copy link
Author

@Prativa20 Thank you for checking.

@mcascone
Copy link

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 cluster > 1.

I think the intention of cluster is that you can tell vRA to spin multiple instances of the same blueprint under the deployment, but you can't modify them individually. We (those of us who have discovered the cluster property) might be trying to use the tool in a way it's not designed for. But, I'm not sure either.

@t-settle
Copy link

I have been using:

deployment_configuration = {
"_number_of_instances" = "2"
}

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 = {
"vm._cluster" = "2"
}

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:}]

@t-settle
Copy link

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."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants