github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown (about)

     1  ---
     2  layout: "vsphere"
     3  page_title: "VMware vSphere: vsphere_virtual_machine"
     4  sidebar_current: "docs-vsphere-resource-virtual-machine"
     5  description: |-
     6    Provides a VMware vSphere virtual machine resource. This can be used to create, modify, and delete virtual machines.
     7  ---
     8  
     9  # vsphere\_virtual\_machine
    10  
    11  Provides a VMware vSphere virtual machine resource. This can be used to create,
    12  modify, and delete virtual machines.
    13  
    14  ## Example Usage
    15  
    16  ```
    17  resource "vsphere_virtual_machine" "web" {
    18    name   = "terraform_web"
    19    vcpu   = 2
    20    memory = 4096
    21  
    22    network_interface {
    23      label = "VM Network"
    24    }
    25  
    26    disk {
    27      size = 1
    28      iops = 500
    29    }
    30  }
    31  ```
    32  
    33  ## Argument Reference
    34  
    35  The following arguments are supported:
    36  
    37  * `name` - (Required) The virtual machine name
    38  * `vcpu` - (Required) The number of virtual CPUs to allocate to the virtual machine
    39  * `memory` - (Required) The amount of RAM (in MB) to allocate to the virtual machine
    40  * `datacenter` - (Optional) The name of a Datacenter in which to launch the virtual machine
    41  * `cluster` - (Optional) Name of a Cluster in which to launch the virtual machine
    42  * `resource_pool` (Optional) The name of a Resource Pool in which to launch the virtual machine
    43  * `gateway` - (Optional) Gateway IP address to use for all network interfaces
    44  * `domain` - (Optional) A FQDN for the virtual machine; defaults to "vsphere.local"
    45  * `time_zone` - (Optional) The [time zone](https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/timezone.html) to set on the virtual machine. Defaults to "Etc/UTC"
    46  * `dns_suffixes` - (Optional) List of name resolution suffixes for the virtual network adapter
    47  * `dns_servers` - (Optional) List of DNS servers for the virtual network adapter; defaults to 8.8.8.8, 8.8.4.4
    48  * `network_interface` - (Required) Configures virtual network interfaces; see [Network Interfaces](#network-interfaces) below for details.
    49  * `disk` - (Required) Configures virtual disks; see [Disks](#disks) below for details
    50  * `boot_delay` - (Optional) Time in seconds to wait for machine network to be ready.
    51  * `custom_configuration_parameters` - (Optional) Map of values that is set as virtual machine custom configurations.
    52  
    53  <a id="network-interfaces"></a>
    54  ## Network Interfaces
    55  
    56  Network interfaces support the following attributes:
    57  
    58  * `label` - (Required) Label to assign to this network interface
    59  * `ip_address` - (Optional) Static IP to assign to this network interface. Interface will use DHCP if this is left blank. Currently only IPv4 IP addresses are supported.
    60  * `subnet_mask` - (Optional) Subnet mask to use when statically assigning an IP.
    61  
    62  <a id="disks"></a>
    63  ## Disks
    64  
    65  Disks support the following attributes:
    66  
    67  * `template` - (Required if size not provided) Template for this disk.
    68  * `datastore` - (Optional) Datastore for this disk
    69  * `size` - (Required if template not provided) Size of this disk (in GB).
    70  * `iops` - (Optional) Number of virtual iops to allocate for this disk.