github.com/leeprovoost/terraform@v0.6.10-0.20160119085442-96f3f76118e7/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 template = "centos-7" 28 } 29 } 30 ``` 31 32 ## Argument Reference 33 34 The following arguments are supported: 35 36 * `name` - (Required) The virtual machine name 37 * `vcpu` - (Required) The number of virtual CPUs to allocate to the virtual machine 38 * `memory` - (Required) The amount of RAM (in MB) to allocate to the virtual machine 39 * `datacenter` - (Optional) The name of a Datacenter in which to launch the virtual machine 40 * `cluster` - (Optional) Name of a Cluster in which to launch the virtual machine 41 * `resource_pool` (Optional) The name of a Resource Pool in which to launch the virtual machine 42 * `gateway` - (Optional) Gateway IP address to use for all network interfaces 43 * `domain` - (Optional) A FQDN for the virtual machine; defaults to "vsphere.local" 44 * `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" 45 * `dns_suffixes` - (Optional) List of name resolution suffixes for the virtual network adapter 46 * `dns_servers` - (Optional) List of DNS servers for the virtual network adapter; defaults to 8.8.8.8, 8.8.4.4 47 * `network_interface` - (Required) Configures virtual network interfaces; see [Network Interfaces](#network-interfaces) below for details. 48 * `disk` - (Required) Configures virtual disks; see [Disks](#disks) below for details 49 * `boot_delay` - (Optional) Time in seconds to wait for machine network to be ready. 50 * `custom_configuration_parameters` - (Optional) Map of values that is set as virtual machine custom configurations. 51 52 The `network_interface` block supports: 53 54 * `label` - (Required) Label to assign to this network interface 55 * `ipv4_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. 56 * `ipv4_prefix_length` - (Optional) prefix length to use when statically assigning an IP. 57 58 The following arguments are maintained for backwards compatibility and may be 59 removed in a future version: 60 61 * `ip_address` - __Deprecated, please use `ipv4_address` instead_. 62 * `subnet_mask` - __Deprecated, please use `ipv4_prefix_length` instead_. 63 64 65 The `disk` block supports: 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. 71 72 ## Attributes Reference 73 74 The following attributes are exported: 75 76 * `id` - The instance ID. 77 * `name` - See Argument Reference above. 78 * `vcpu` - See Argument Reference above. 79 * `memory` - See Argument Reference above. 80 * `datacenter` - See Argument Reference above. 81 * `network_interface/label` - See Argument Reference above. 82 * `network_interface/ipv4_address` - See Argument Reference above. 83 * `network_interface/ipv4_prefix_length` - See Argument Reference above. 84 * `network_interface/ipv6_address` - Assigned static IPv6 address. 85 * `network_interface/ipv6_prefix_length` - Prefix length of assigned static IPv6 address.