From 05d6c5b509e814a12903ca770d6ee24b790c812f Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Mon, 12 Oct 2015 11:42:27 -0500 Subject: [PATCH] vsphere docs; first draft I'm not familiar with vSphere so I had to skip over details in some places, but this at least gets the basic structure in for the docs. --- website/source/assets/stylesheets/_docs.scss | 1 + .../providers/vsphere/index.html.markdown | 56 +++++++++++++++ .../vsphere/r/virtual_machine.html.markdown | 69 +++++++++++++++++++ website/source/layouts/docs.erb | 4 ++ website/source/layouts/vsphere.erb | 26 +++++++ 5 files changed, 156 insertions(+) create mode 100644 website/source/docs/providers/vsphere/index.html.markdown create mode 100644 website/source/docs/providers/vsphere/r/virtual_machine.html.markdown create mode 100644 website/source/layouts/vsphere.erb diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index 6849f9106..0defd251a 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -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, diff --git a/website/source/docs/providers/vsphere/index.html.markdown b/website/source/docs/providers/vsphere/index.html.markdown new file mode 100644 index 000000000..3930519a1 --- /dev/null +++ b/website/source/docs/providers/vsphere/index.html.markdown @@ -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. + diff --git a/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown b/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown new file mode 100644 index 000000000..6ce012d65 --- /dev/null +++ b/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown @@ -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. + + +## 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. + + +## 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. diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index af96b52c1..937c120de 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -188,6 +188,10 @@ > Template + + > + vSphere + diff --git a/website/source/layouts/vsphere.erb b/website/source/layouts/vsphere.erb new file mode 100644 index 000000000..49e58c057 --- /dev/null +++ b/website/source/layouts/vsphere.erb @@ -0,0 +1,26 @@ +<% wrap_layout :inner do %> + <% content_for :sidebar do %> + + <% end %> + + <%= yield %> +<% end %>