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