Skip to content

Commit

Permalink
Merge pull request #3483 from hashicorp/d-vsphere
Browse files Browse the repository at this point in the history
vsphere docs; first draft
  • Loading branch information
phinze committed Oct 15, 2015
2 parents 2a24d52 + 05d6c5b commit 60e9bec
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 0 deletions.
1 change: 1 addition & 0 deletions website/source/assets/stylesheets/_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ body.layout-openstack,
body.layout-packet,
body.layout-rundeck,
body.layout-template,
body.layout-vsphere,
body.layout-docs,
body.layout-downloads,
body.layout-inner,
Expand Down
56 changes: 56 additions & 0 deletions website/source/docs/providers/vsphere/index.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
layout: "vsphere"
page_title: "Provider: vSphere"
sidebar_current: "docs-vsphere-index"
description: |-
The vSphere provider is used to interact with the resources supported by
vSphere. The provider needs to be configured with the proper credentials before
it can be used.
---

# vSphere Provider

The vSphere provider is used to interact with the resources supported by vSphere.
The provider needs to be configured with the proper credentials before it can be used.

Use the navigation to the left to read about the available resources.

## Example Usage

```
# Configure the vSphere Provider
provider "vsphere" {
user = "${var.vsphere_user}"
password = "${var.vsphere_password}"
vcenter_server = "${var.vsphere_vcenter_server}"
}
# Create a virtual machine
resource "vsphere_virtual_machine" "web" {
name = "terraform_web"
vcpu = 2
memory = 4096
network_interface {
label = "VM Network"
}
disk {
size = 1
iops = 500
}
}
```

## Argument Reference

The following arguments are used to configure the vSphere Provider:

* `user` - (Required) This is the username for vSphere API operations. Can also
be specified with the `VSPHERE_USER` environment variable.
* `password` - (Required) This is the password for vSphere API operations. Can
also be specified with the `VSPHERE_PASSWORD` environment variable.
* `vcenter_server` - (Required) This is the vCenter server name for vSphere API
operations. Can also be specified with the `VSPHERE_VCENTER` environment
variable.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
layout: "vsphere"
page_title: "vSphere: vsphere_virtual_machine"
sidebar_current: "docs-vsphere-resource-virtual-machine"
description: |-
Provides a vSphere virtual machine resource. This can be used to create, modify, and delete virtual machines.
---

# vsphere\_virtual\_machine

Provides a vSphere virtual machine resource. This can be used to create,
modify, and delete virtual machines.

## Example Usage

```
resource "vsphere_virtual_machine" "web" {
name = "terraform_web"
vcpu = 2
memory = 4096
network_interface {
label = "VM Network"
}
disk {
size = 1
iops = 500
}
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The virtual machine name
* `vcpu` - (Required) The number of virtual CPUs to allocate to the virtual machine
* `memory` - (Required) The amount of RAM (in MB) to allocate to the virtual machine
* `datacenter` - (Optional) The name of a Datacenter in which to launch the virtual machine
* `cluster` - (Optional) Name of a Cluster in which to launch the virtual machine
* `resource_pool` (Optional) The name of a Resource Pool in which to launch the virtual machine
* `gateway` - (Optional) Gateway IP address to use for all network interfaces
* `domain` - (Optional) A FQDN for the virtual machine; defaults to "vsphere.local"
* `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"
* `dns_suffixes` - (Optional) List of name resolution suffixes for the virtual network adapter
* `dns_servers` - (Optional) List of DNS servers for the virtual network adapter; defaults to 8.8.8.8, 8.8.4.4
* `network_interface` - (Required) Configures virtual network interfaces; see [Network Interfaces](#network-interfaces) below for details.
* `disk` - (Required) Configures virtual disks; see [Disks](#disks) below for details
* `boot_delay` - (Optional) Time in seconds to wait for machine network to be ready.

<a id="network-interfaces"></a>
## Network Interfaces

Network interfaces support the following attributes:

* `label` - (Required) Label to assign to this network interface
* `ip_address` - (Optional) Static IP to assign to this network interface. Interface will use DHCP if this is left blank.
* `subnet_mask` - (Optional) Subnet mask to use when statically assigning an IP.

<a id="disks"></a>
## Disks

Disks support the following attributes:

* `template` - (Required if size not provided) Template for this disk.
* `datastore` - (Optional) Datastore for this disk
* `size` - (Required if template not provided) Size of this disk (in GB).
* `iops` - (Optional) Number of virtual iops to allocate for this disk.
4 changes: 4 additions & 0 deletions website/source/layouts/docs.erb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
<li<%= sidebar_current("docs-providers-template") %>>
<a href="/docs/providers/template/index.html">Template</a>
</li>

<li<%= sidebar_current("docs-providers-vsphere") %>>
<a href="/docs/providers/vsphere/index.html">vSphere</a>
</li>
</ul>
</li>

Expand Down
26 changes: 26 additions & 0 deletions website/source/layouts/vsphere.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<% wrap_layout :inner do %>
<% content_for :sidebar do %>
<div class="docs-sidebar hidden-print affix-top" role="complementary">
<ul class="nav docs-sidenav">
<li<%= sidebar_current("docs-home") %>>
<a href="/docs/providers/index.html">&laquo; Documentation Home</a>
</li>

<li<%= sidebar_current("docs-vsphere-index") %>>
<a href="/docs/providers/vsphere/index.html">vSphere Provider</a>
</li>

<li<%= sidebar_current(/^docs-vsphere-resource/) %>>
<a href="#">Resources</a>
<ul class="nav nav-visible">
<li<%= sidebar_current("docs-vsphere-resource-virtual-machine") %>>
<a href="/docs/providers/vsphere/r/virtual_machine.html">vsphere_virtual_machine</a>
</li>
</ul>
</li>
</ul>
</div>
<% end %>

<%= yield %>
<% end %>

0 comments on commit 60e9bec

Please sign in to comment.