Closed ghost closed 3 years ago
This is a core of how Terraform itself functions, not something that can be changed by the vsphere provider. Terraform effectively stores information about your VM in state by referencing the "vm" portion of the resource name resource "vsphere_virtual_machine" "vm"
. When you change the name and ip attributes of that reference, you're telling Terraform to continue to only have a single VM it references as "vm", but change it to have this name and IP instead.
If you want to add a second VM, you'd either need to add a count
or for_each
attribute to your existing block, or do a new resource block to define the second VM resource "vsphere_virtual_machine" "second_vm"
.
thanks
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
I create the server but when I go to create another I modify the file the ip and name 192.168.1.20--->192.168.1.30 and name Aapuntes---->Aproxy but it is not creating a new vm for me, it only modifies the existing one as it would have to be added in the config to create new virtual machines ???