FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

vsphere_virtual_machine

Provides a VMware vSphere virtual machine resource. This can be used to create, modify, and delete virtual machines.

Example Usage

resource "vsphere_virtual_machine" "web" {
  name   = "terraform_web"
  vcpu   = 2
  memory = 4096

  network_interface {
    label = "VM Network"
  }

  disk {
    template = "centos-7"
  }
}

Example Usage VMware Cluster

resource "vsphere_virtual_machine" "lb" {
  name   = "lb01"
  folder = "Loadbalancers"
  vcpu   = 2
  memory = 4096
  domain = "MYDOMAIN"
  datacenter = "EAST"
  cluster = "Production Cluster"
  resource_pool = "Production Cluster/Resources/Production Servers"

  gateway = "10.20.30.254"

  network_interface {
      label = "10_20_30_VMNet"
      ipv4_address = "10.20.30.40"
      ipv4_prefix_length = "24"
  }

  disk {
    datastore = "EAST/VMFS01-EAST"
    template = "Templates/Centos7"
  }
}

Argument Reference

The following arguments are supported:

The network_interface block supports:

The following arguments are maintained for backwards compatibility and may be removed in a future version:

The windows_opt_config block supports:

Disks

The disk block supports:

CDROM

The cdrom block supports:

Attributes Reference

The following attributes are exported:


See the source of this document at Terraform.io