Questions tagged [terraform-provider-vsphere]
37 questions
4
votes
2 answers
Terraform vsphere_tag unwanted deletion
I'm using Terraform to deploy some dev and prod VMs on our VMware vCenter infrastructure and use vsphere tags to define responsibilities of VMs. I therefore added the following to the (sub)module:
resource "vsphere_tag" "tag" {
name =…

lulukas86
- 109
- 5
1
vote
0 answers
How to configure vApp properties in Terraform where ovf:userConfigurable="false"
The vapp properties which are set as ovf:userConfigurable="false" are unable to be configured when deploying to vSphere through Terraform.
Ovftool has an option -X EnableHiddenProperties which allows such properties to be edited, when deploying…

Soham Agarwal
- 11
- 2
1
vote
1 answer
Terraform count condition ignoring second parameter vsphere provider
I am trying to create a vm using count. So that, both conditions should be false for the resource to be created.
Main.tf
resource "vsphere_virtual_machine" "ubuntu" {
count = !var.is_ubuntu && var.extra_disk_create ? 0 : 1
name …

korsain
- 17
- 1
- 6
1
vote
1 answer
Iterating network interfaces in vsphere provider with Terraform
Question: How can I iterate through a nested map to assign string values for a data resource block?
Context:
Working on a requirement to deploy multiple VMs via OVA template using the vsphere provider 2.0 on terraform.
As the network interfaces will…

yudodisterra
- 13
- 4
1
vote
2 answers
How to for_each through a list(objects) in Terraform
i am trying to do for_each in a map(object) type for creating a vsphere vm using terraform. below is the codes that I have written.
instances.tf
resource "vsphere_virtual_machine" "vm" {
for_each = var.virtual_machines
# vm-name
name …

Sivakrishnan
- 109
- 3
- 14
1
vote
0 answers
Assign static IP in terraform vsphere_virtual_machine
I am trying to add a vmware machine using vsphere, getting below error. I have followed this document. Terraform Document. I am giving default_ip_address. I am using latest version of terraform. Its a windows box. I am expecting this IP address…

Ashish Mishra
- 411
- 5
- 25
1
vote
1 answer
Terraform How to add Dyanmic number of DATA disks to vSphere VMs
I am trying to create the vSphere VM with Dynamics number of disks. from the resource block not sure how to iterate the number of data disks list.
Here is the code I have:
varible.tf
variable "virtual_machines" {
type = map(object({
…

sfgroups
- 18,151
- 28
- 132
- 204
1
vote
1 answer
Terraform: Error: timeout waiting for an available IP address
I am new to Terraform and I am tying to create a VM using terraform. Below is my code.
I want to clone a VM and don't want to give an IP. The VM gets created in vSphere but terraform kept on waiting for IP. Is there any way I can stop terraform to…

Sivakrishnan
- 109
- 3
- 14
1
vote
1 answer
How do i create multiple instances with Terraform
I want to generate multiple instances of a resource with Terraform.
The following script works great for one instance. Unfortunately, the created VM is simply overwritten with different parameters when a new VM is created.
As far as I know, the…

Alex
- 125
- 2
- 12
1
vote
1 answer
Create multiple new instances with Terraform
I have written a Terraform script which is supposed to create multiple server instances from one template. I have now created two different variable files.
But when I run the script, a new instance is created with the first variable file, but with…

Alex
- 125
- 2
- 12
1
vote
1 answer
How can you accept the vcsa EULA via vapp property?
Does anyone know of a way to accept the EULA when deploying a vcenter server appliance via ova using a vapp property? I'm trying to deploy a vcsa 6.7 instance via terraform using the vsphere_virtual_machine resource with the ovf_deploy property to…

Brandon Beck
- 11
- 4
0
votes
1 answer
Terraform: iterate through variables
I got something like this:
global_tags = {
"Tag_Name1" = "Tag_Value1"
"Tag_Name2" = "Tag_Value2"
}
virtual_machine = {
"my-host-1.foo.bar" {
cores = 3
memory = 2048
host_tags = {
"Tag_Name3" =…

Alucard Hellsing
- 13
- 1
- 4
0
votes
3 answers
Terraform Template each list value
I have a TF module (TF 1.2.8) which creates a vSphere VM. In the metadata template file I want to have it so I can specify X number of nameservers. The current template looks like this:-
metadata.tftpl
instance-id: ${vm_name}
local-hostname:…

Luke
- 603
- 2
- 11
- 35
0
votes
1 answer
Setting a static IP Address to an Virtual Machine from OVF Template
I'm using Terraform's vSphere Provider. I have a local OVF template that I'm trying to deploy a VM from. I wish to set a static IP address for the soon-to-be-deployed VM, but Terraform keeps complaining
"Argument named ipv4_address is not expected…

Ricky Palaguachi
- 101
- 6
0
votes
1 answer
Guest OS customization using Terraform - fail on first boot
I am using Terraform to deploy a vm exported from AWS.
The process is the following:
I use Packer to build an AMI in AWS
The ami is then exported in vmdk format to VMware using terraform ( using a clone from an s3 bucket into a datastore )
a…

Danilo Patrucco
- 110
- 3
- 10