github.com/aznashwan/terraform@v0.4.3-0.20151118032030-21f93ca4558d/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.
    21  
    22  ## Example Usage
    23  
    24  ```
    25  # Configure the VMware vSphere Provider
    26  provider "vsphere" {
    27    user           = "${var.vsphere_user}"
    28    password       = "${var.vsphere_password}"
    29    vcenter_server = "${var.vsphere_vcenter_server}"
    30  }
    31  
    32  # Create a virtual machine
    33  resource "vsphere_virtual_machine" "web" {
    34    name   = "terraform_web"
    35    vcpu   = 2
    36    memory = 4096
    37  
    38    network_interface {
    39      label = "VM Network"
    40    }
    41  
    42    disk {
    43      size = 1
    44      iops = 500
    45    }
    46  }
    47  ```
    48  
    49  ## Argument Reference
    50  
    51  The following arguments are used to configure the VMware vSphere Provider:
    52  
    53  * `user` - (Required) This is the username for vSphere API operations. Can also
    54    be specified with the `VSPHERE_USER` environment variable.
    55  * `password` - (Required) This is the password for vSphere API operations. Can
    56    also be specified with the `VSPHERE_PASSWORD` environment variable.
    57  * `vcenter_server` - (Required) This is the vCenter server name for vSphere API
    58    operations. Can also be specified with the `VSPHERE_VCENTER` environment
    59    variable.
    60  
    61  ## Acceptance Tests
    62  
    63  The VMware vSphere provider's acceptance tests require the above provider
    64  configuration fields to be set using the documented environment variables.
    65  
    66  In addition, the following environment variables are used in tests, and must be set to valid values for your VMware vSphere environment:
    67  
    68   * VSPHERE\_NETWORK\_GATEWAY
    69   * VSPHERE\_NETWORK\_IP\_ADDRESS
    70   * VSPHERE\_NETWORK\_LABEL
    71   * VSPHERE\_NETWORK\_LABEL\_DHCP
    72   * VSPHERE\_TEMPLATE
    73  
    74  The following environment variables depend on your vSphere environment:
    75  	
    76   * VSPHERE\_DATACENTER
    77   * VSPHERE\_CLUSTER
    78   * VSPHERE\_RESOURCE\_POOL
    79   * VSPHERE\_DATASTORE
    80  
    81  
    82  These are used to set and verify attributes on the `vsphere_virtual_machine`
    83  resource in tests.
    84  
    85  Once all these variables are in place, the tests can be run like this:
    86  
    87  ```
    88  make testacc TEST=./builtin/providers/vsphere
    89  ```