From 0108ef7b1bc177d774ce492e3b9718880059222e Mon Sep 17 00:00:00 2001 From: tommymalmqvist Date: Sat, 16 Apr 2016 09:15:03 +0200 Subject: [PATCH 1/3] fixes-#6198-vsphere-provider-improve-documentation --- website/source/docs/providers/vsphere/index.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/source/docs/providers/vsphere/index.html.markdown b/website/source/docs/providers/vsphere/index.html.markdown index 2138b5084f0b..6f0dbdd5199b 100644 --- a/website/source/docs/providers/vsphere/index.html.markdown +++ b/website/source/docs/providers/vsphere/index.html.markdown @@ -41,6 +41,10 @@ resource "vsphere_virtual_machine" "web" { folder = "${vsphere_folder.frontend.path}" vcpu = 2 memory = 4096 + domain = "${var.vsphere_domain}" + datacenter = "${var.vsphere_datacenter}" + cluster = "${var.vsphere_cluster}" + resource_pool = "${var.vsphere_cluster}/Resources/${var.vsphere_resource_pool}" network_interface { label = "VM Network" From e0fe2df7224f75aaec0f47cc2f154e000a91dbba Mon Sep 17 00:00:00 2001 From: tommymalmqvist Date: Sun, 24 Apr 2016 12:29:17 +0200 Subject: [PATCH 2/3] Moved VMware cluster information to it's own example. --- .../providers/vsphere/index.html.markdown | 4 --- .../vsphere/r/virtual_machine.html.markdown | 31 ++++++++++++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/website/source/docs/providers/vsphere/index.html.markdown b/website/source/docs/providers/vsphere/index.html.markdown index 6f0dbdd5199b..2138b5084f0b 100644 --- a/website/source/docs/providers/vsphere/index.html.markdown +++ b/website/source/docs/providers/vsphere/index.html.markdown @@ -41,10 +41,6 @@ resource "vsphere_virtual_machine" "web" { folder = "${vsphere_folder.frontend.path}" vcpu = 2 memory = 4096 - domain = "${var.vsphere_domain}" - datacenter = "${var.vsphere_datacenter}" - cluster = "${var.vsphere_cluster}" - resource_pool = "${var.vsphere_cluster}/Resources/${var.vsphere_resource_pool}" network_interface { label = "VM Network" diff --git a/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown b/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown index 47791ba381b4..0d37db75dad0 100644 --- a/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown +++ b/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown @@ -29,6 +29,35 @@ resource "vsphere_virtual_machine" "web" { } ``` +## Example Usage VMware Cluster + +``` +resource "vsphere_virtual_machine" "lb" { + name = "lb01" + folder = "Loadbalancers" + vcpu = 2 + memory = 4096 + domain = "MYDOMAIN" + datacenter = "EAST" + cluster = "Production Cluster" + resource_pool = "Production Cluster/Resources/Production Servers" + + gateway = "10.20.30.254" + + network_interface { + label = "10_20_30_VMNet" + ipv4_address = "10.20.30.40" + ipv4_prefix_length = "24" + } + + disk { + datastore = "STO/VMFS135-STO" + datastore = "EAST/VMFS01-EAST" + template = "Templates/Centos7" + } +} +``` + ## Argument Reference The following arguments are supported: @@ -38,7 +67,7 @@ The following arguments are supported: * `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 +* `resource_pool` (Optional) The name of a Resource Pool in which to launch the virtual machine. Requires full path (see cluster example). * `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 [Linux](https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/timezone.html) or [Windows](https://msdn.microsoft.com/en-us/library/ms912391.aspx) time zone to set on the virtual machine. Defaults to "Etc/UTC" From 2ebce2f8fd2bd16200f9aa50b85c2dca45c67cb2 Mon Sep 17 00:00:00 2001 From: tommymalmqvist Date: Sun, 24 Apr 2016 12:32:38 +0200 Subject: [PATCH 3/3] Fix #1 --- .../docs/providers/vsphere/r/virtual_machine.html.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown b/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown index 0d37db75dad0..cbd50a62890c 100644 --- a/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown +++ b/website/source/docs/providers/vsphere/r/virtual_machine.html.markdown @@ -51,7 +51,6 @@ resource "vsphere_virtual_machine" "lb" { } disk { - datastore = "STO/VMFS135-STO" datastore = "EAST/VMFS01-EAST" template = "Templates/Centos7" }