github.com/leeprovoost/terraform@v0.6.10-0.20160119085442-96f3f76118e7/website/source/docs/providers/vsphere/index.html.markdown (about) 1 --- 2 layout: "vsphere" 3 page_title: "Provider: VMware vSphere" 4 sidebar_current: "docs-vsphere-index" 5 description: |- 6 The VMware vSphere provider is used to interact with the resources supported by 7 VMware vSphere. The provider needs to be configured with the proper credentials 8 before it can be used. 9 --- 10 11 # VMware vSphere Provider 12 13 The VMware vSphere provider is used to interact with the resources supported by 14 VMware vSphere. 15 The provider needs to be configured with the proper credentials before it can be used. 16 17 Use the navigation to the left to read about the available resources. 18 19 ~> **NOTE:** The VMware vSphere Provider currently represents _initial support_ 20 and therefore may undergo significant changes as the community improves it. This 21 provider at this time only supports IPv4 addresses on virtual machines. 22 23 ## Example Usage 24 25 ``` 26 # Configure the VMware vSphere Provider 27 provider "vsphere" { 28 user = "${var.vsphere_user}" 29 password = "${var.vsphere_password}" 30 vsphere_server = "${var.vsphere_server}" 31 } 32 33 # Create a folder 34 resource "vsphere_folder" "frontend" { 35 path = "frontend" 36 } 37 38 # Create a virtual machine within the folder 39 resource "vsphere_virtual_machine" "web" { 40 name = "terraform_web" 41 folder = "${vsphere_folder.frontend.path}" 42 vcpu = 2 43 memory = 4096 44 45 network_interface { 46 label = "VM Network" 47 } 48 49 disk { 50 template = "centos-7" 51 } 52 } 53 ``` 54 55 ## Argument Reference 56 57 The following arguments are used to configure the VMware vSphere Provider: 58 59 * `user` - (Required) This is the username for vSphere API operations. Can also 60 be specified with the `VSPHERE_USER` environment variable. 61 * `password` - (Required) This is the password for vSphere API operations. Can 62 also be specified with the `VSPHERE_PASSWORD` environment variable. 63 * `vsphere_server` - (Required) This is the vCenter server name for vSphere API 64 operations. Can also be specified with the `VSPHERE_SERVER` environment 65 variable. 66 * `allow_unverified_ssl` - (Optional) Boolean that can be set to true to 67 disable SSL certificate verification. This should be used with care as it 68 could allow an attacker to intercept your auth token. If omitted, default 69 value is `false`. Can also be specified with the `VSPHERE_ALLOW_UNVERIFIED_SSL` 70 environment variable. 71 72 ## Acceptance Tests 73 74 The VMware vSphere provider's acceptance tests require the above provider 75 configuration fields to be set using the documented environment variables. 76 77 In addition, the following environment variables are used in tests, and must be set to valid values for your VMware vSphere environment: 78 79 * VSPHERE\_NETWORK\_GATEWAY 80 * VSPHERE\_NETWORK\_IP\_ADDRESS 81 * VSPHERE\_NETWORK\_LABEL 82 * VSPHERE\_NETWORK\_LABEL\_DHCP 83 * VSPHERE\_TEMPLATE 84 85 The following environment variables depend on your vSphere environment: 86 87 * VSPHERE\_DATACENTER 88 * VSPHERE\_CLUSTER 89 * VSPHERE\_RESOURCE\_POOL 90 * VSPHERE\_DATASTORE 91 92 93 These are used to set and verify attributes on the `vsphere_virtual_machine` 94 resource in tests. 95 96 Once all these variables are in place, the tests can be run like this: 97 98 ``` 99 make testacc TEST=./builtin/providers/vsphere 100 ```