Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docs: examples cleanup #2222

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions website/docs/d/compute_cluster_host_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ layout: "vsphere"
page_title: "VMware vSphere: vsphere_compute_cluster_host_group"
sidebar_current: "docs-vsphere-data-source-compute-cluster-host-group"
description: |-
Provides a vSphere cluster host group data source. Returns attributes of a vSphere cluster host group.
Provides a vSphere cluster host group data source. Returns attributes of a
vSphere cluster host group.
---

# vsphere\_compute\_cluster\_host\_group
Expand All @@ -17,24 +18,24 @@ resources.

```hcl
data "vsphere_datacenter" "datacenter" {
name = var.vsphere_datacenter
name = "dc-01"
}

data "vsphere_compute_cluster" "cluster" {
name = var.vsphere_cluster
name = "cluster-01"
datacenter_id = data.vsphere_datacenter.datacenter.id
}

data "vsphere_compute_cluster_host_group" "host_group1" {
name = "host_group1"
data "vsphere_compute_cluster_host_group" "host_group" {
name = "hostgroup-01"
compute_cluster_id = data.vsphere_compute_cluster.cluster.id
}

resource "vsphere_compute_cluster_vm_host_rule" "host_rule1" {
resource "vsphere_compute_cluster_vm_host_rule" "host_rule" {
compute_cluster_id = data.vsphere_compute_cluster.cluster.id
name = "terraform-host-rule1"
vm_group_name = "vm_group1"
affinity_host_group_name = data.vsphere_compute_cluster_host_group.host_group1.name
vm_group_name = "vmgroup-01"
affinity_host_group_name = data.vsphere_compute_cluster_host_group.host_group.name
}
```

Expand All @@ -43,8 +44,9 @@ resource "vsphere_compute_cluster_vm_host_rule" "host_rule1" {
The following arguments are supported:

* `name` - (Required) The name of the host group.
* `compute_cluster_id` - (Required) The [managed object reference ID][docs-about-morefs]
of the compute cluster for the host group.
* `compute_cluster_id` - (Required) The
[managed object reference ID][docs-about-morefs] of the compute cluster for
the host group.

[docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider

Expand Down
8 changes: 5 additions & 3 deletions website/docs/d/content_library.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ description: |-

# vsphere\_content\_library

The `vsphere_content_library` data source can be used to discover the ID of a content library.
The `vsphere_content_library` data source can be used to discover the ID of a
content library.

~> **NOTE:** This resource requires vCenter and is not available on direct ESXi host connections.
~> **NOTE:** This resource requires vCenter and is not available on direct ESXi
host connections.

## Example Usage

```hcl
data "vsphere_content_library" "library" {
data "vsphere_content_library" "content_library" {
name = "Content Library"
}
```
Expand Down
32 changes: 18 additions & 14 deletions website/docs/d/guest_os_customization.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ layout: "vsphere"
page_title: "VMware vSphere: vsphere_guest_os_customization"
sidebar_current: "docs-vsphere-data-guest-os-customization"
description: |-
Provides a VMware vSphere guest customization spec data source. This can be used to apply the customization spec when virtual machine is cloned
Provides a VMware vSphere guest customization spec data source.
This can be used to apply the customization spec when virtual machine is
cloned.
---

# vsphere\_guest\_os\_customization
# vsphere_guest_os_customization

The `vsphere_guest_os_customization` data source can be used to discover the details about a customization specification for a guest operating system.

Suggested change
~> **NOTE:** The name attribute is the unique identifier for the customization specification per vCenter Server instance.
The `vsphere_guest_os_customization` data source can be used to discover the
details about a customization specification for a guest operating system.

## Example Usage

Expand Down Expand Up @@ -44,11 +44,15 @@ resource "vsphere_virtual_machine" "vm" {

The following arguments are supported:

* `name` - (Required) The name of the customization specification is the unique identifier per vCenter Server instance.
## Attribute Reference

* `type` - The type of customization specification: One among: Windows, Linux.
* `description` - The description for the customization specification.
* `last_update_time` - The time of last modification to the customization specification.
* `change_version` - The number of last changed version to the customization specification.
* `spec` - Container object for the guest operating system properties to be customized. See [virtual machine customizations](virtual_machine#virtual-machine-customizations)
- `name` - (Required) The name of the customization specification is the unique
identifier per vCenter Server instance. ## Attribute Reference

- `type` - The type of customization specification: One among: Windows, Linux.
- `description` - The description for the customization specification.
- `last_update_time` - The time of last modification to the customization
specification.
- `change_version` - The number of last changed version to the customization
specification.
- `spec` - Container object for the guest operating system properties to be
customized. See
[virtual machine customizations](virtual_machine#virtual-machine-customizations)
34 changes: 18 additions & 16 deletions website/docs/d/host_vgpu_profile.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ layout: "vsphere"
page_title: "VMware vSphere: vsphere_host_vgpu_profile"
sidebar_current: "docs-vsphere-data-source-host_vgpu_profile"
description: |-
A data source that can be used to get information for
one or all vGPU profiles available on an ESXi host.
A data source that can be used to get information for one or all vGPU profiles
available on an ESXi host.
---

# vsphere_host_vgpu_profile
Expand All @@ -17,7 +17,7 @@ available vGPU profiles of a vSphere host.

```hcl
data "vsphere_datacenter" "datacenter" {
name = "dc-01"
name = "dc-01"
}

data "vsphere_host" "host" {
Expand All @@ -26,15 +26,15 @@ data "vsphere_host" "host" {
}

data "vsphere_host_vgpu_profile" "vgpu_profile" {
host_id = data.vsphere_host.host.id
host_id = data.vsphere_host.host.id
}
```

## Example Usage with vGPU profile name_regex

```hcl
data "vsphere_datacenter" "datacenter" {
name = "dc-01"
name = "dc-01"
}

data "vsphere_host" "host" {
Expand All @@ -43,18 +43,19 @@ data "vsphere_host" "host" {
}

data "vsphere_host_vgpu_profile" "vgpu_profile" {
host_id = data.vsphere_host.host.id
name_regex = "a100"
host_id = data.vsphere_host.host.id
name_regex = "a100"
}
```

## Argument Reference

The following arguments are supported:

* `host_id` - (Required) The [managed object reference ID][docs-about-morefs] of a host.
* `host_id` - (Required) The [managed object reference ID][docs-about-morefs] of
a host.
* `name_regex` - (Optional) A regular expression that will be used to match the
host vGPU profile name.
host vGPU profile name.

[docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider

Expand All @@ -68,12 +69,13 @@ The following attributes are exported:
host vGPU profile name.
* `vgpu_profiles` - The list of available vGPU profiles on the ESXi host.
This may be and empty array if no vGPU profile are identified.
* `vgpu` - Name of a particular vGPU available as a shared GPU device (vGPU profile).
* `vgpu` - Name of a particular vGPU available as a shared GPU device (vGPU
profile).
* `disk_snapshot_supported` - Indicates whether the GPU plugin on this host is
capable of disk-only snapshots when VM is not powered off.
* `memory_snapshot_supported` - Indicates whether the GPU plugin on this host is
capable of memory snapshots.
* `migrate_supported` - Indicates whether the GPU plugin on this host is capable
of migration.
* `suspend_supported` - Indicates whether the GPU plugin on this host is capable
of suspend-resume.
* `memory_snapshot_supported` - Indicates whether the GPU plugin on this host
is capable of memory snapshots.
* `migrate_supported` - Indicates whether the GPU plugin on this host is
capable of migration.
* `suspend_supported` - Indicates whether the GPU plugin on this host is
capable of suspend-resume.
13 changes: 7 additions & 6 deletions website/docs/r/distributed_port_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ adding the `vsphere_distributed_port_group` resource, attaching itself to the
vSphere Distributed Switch and assigning VLAN ID 1000.

```hcl
variable "esxi_hosts" {
variable "hosts" {
default = [
"esxi-01.example.com",
"esxi-02.example.com",
Expand All @@ -63,8 +63,8 @@ data "vsphere_datacenter" "datacenter" {
}

data "vsphere_host" "host" {
count = length(var.esxi_hosts)
name = var.esxi_hosts[count.index]
count = length(var.hosts)
name = var.hosts[count.index]
datacenter_id = data.vsphere_datacenter.datacenter.id
}

Expand Down Expand Up @@ -104,9 +104,9 @@ resource "vsphere_distributed_port_group" "pg" {

The following options control the VLAN setting. One of these 3 options may be set:

- `vlan_id` - (Optional) The member VLAN for the ports this policy applies to. A
* `vlan_id` - (Optional) The member VLAN for the ports this policy applies to. A
value of `0` means no VLAN.
- `vlan_range` - (Optional) Used to denote VLAN trunking. Use the `min_vlan`
* `vlan_range` - (Optional) Used to denote VLAN trunking. Use the `min_vlan`
and `max_vlan` sub-arguments to define the tagged VLAN range. Multiple
`vlan_range` definitions are allowed, but they must not overlap. Example
below:
Expand All @@ -126,7 +126,8 @@ resource "vsphere_distributed_virtual_switch" "vds" {
}
}
```
- `port_private_secondary_vlan_id` - (Optional) Used to define a secondary VLAN

* `port_private_secondary_vlan_id` - (Optional) Used to define a secondary VLAN
ID when using private VLANs.

### Overriding VDS policies
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/distributed_virtual_switch.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ used as active, and two being used as passive. Note that the NIC failover order
propagates to any port groups configured on this VDS and can be overridden.

```hcl
variable "esxi_hosts" {
variable "hosts" {
default = [
"esxi-01.example.com",
"esxi-02.example.com",
Expand All @@ -63,8 +63,8 @@ data "vsphere_datacenter" "datacenter" {
}

data "vsphere_host" "host" {
count = length(var.esxi_hosts)
name = var.esxi_hosts[count.index]
count = length(var.hosts)
name = var.hosts[count.index]
datacenter_id = data.vsphere_datacenter.datacenter.id
}

Expand Down
10 changes: 5 additions & 5 deletions website/docs/r/folder.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ The basic example below creates a virtual machine folder named
`terraform-test-folder` in the default datacenter's VM hierarchy.

```hcl
data "vsphere_datacenter" "dc" {}
data "vsphere_datacenter" "datacenter" {}

resource "vsphere_folder" "folder" {
path = "terraform-test-folder"
type = "vm"
datacenter_id = data.vsphere_datacenter.dc.id
datacenter_id = data.vsphere_datacenter.datacenter.id
}
```

Expand All @@ -46,18 +46,18 @@ configuration to this one), your folder will be moved to be under the correct
parent.

```hcl
data "vsphere_datacenter" "dc" {}
data "vsphere_datacenter" "datacenter" {}

resource "vsphere_folder" "parent" {
path = "terraform-test-parent"
type = "vm"
datacenter_id = data.vsphere_datacenter.dc.id
datacenter_id = data.vsphere_datacenter.datacenter.id
}

resource "vsphere_folder" "folder" {
path = "${vsphere_folder.parent.path}/terraform-test-folder"
type = "vm"
datacenter_id = data.vsphere_datacenter.dc.id
datacenter_id = data.vsphere_datacenter.datacenter.id
}
```

Expand Down
Loading