Merge pull request #3483 from hashicorp/d-vsphere
vsphere docs; first draft
This commit is contained in:
commit
60e9bec052
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
@ -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.
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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">« 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 %>
|
Loading…
Reference in New Issue