Terraform vsphere network interface interface configuration

I have a Terraform config that I want to use to create virtual machines from a Vsphere template (Redhat 7), but I need to specify the network interface to apply the settings (static IP, subnet, gateway, DNS).

provider "vsphere" {
  user           = "${var.vsphere_user}"
  password       = "${var.vsphere_password}"
  vsphere_server = "${var.vsphere_server}"
  allow_unverified_ssl = true
}

resource "vsphere_virtual_machine" "vm1" {

  name   = "vm1"
  folder = "${var.vsphere_folder}"
  vcpu   = 2
  memory = 32768
  datacenter = "dc1"
  cluster = "cluster1"
  skip_customization =  false

  disk {
    template = "${var.vsphere_folder}/${var.template_redhat}"
    datastore = "${var.template_datastore}"
    type = "thin"
  }

  network_interface {
    label = "${var.vlan}"
    ipv4_address = "10.1.1.1"
    ipv4_prefix_length = 16
    ipv4_gateway = "10.1.1.254"
  }

  dns_servers = ["10.1.1.254"]
  time_zone = "004"

}

      

I want to apply static IP to bond0 instead of eth0, is it possible to do this in Terraform?

Thank.

+3
redhat terraform vsphere


source to share


No one has answered this question yet

Check out similar questions:

2
terraform vsphere provider hangs when creating vm
1
Vsphere: Terraform apply fails to complete - hangs while creating virtual machine
1
Terraform vsphere datastore selection based on free space
1
Terraform vSphere Slow Boot
0
Infrastructure automation with packer & terraform on vsphere
0
Terraformed construction disks in unpredictable for vSphere virtual machines
0
Using terraform vsphere resource to set network_interface label
0
Terraform vSphere using snapshots
-2
Terraform error: vsphere provider does not support resource



All Articles
Loading...
X
Show
Funny
Dev
Pics