Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update docs for vsphere_distributed_virtual_switch #1504

Merged
merged 1 commit into from
Jan 19, 2022
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
32 changes: 16 additions & 16 deletions website/docs/d/distributed_virtual_switch.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ layout: "vsphere"
page_title: "VMware vSphere: vsphere_distributed_virtual_switch"
sidebar_current: "docs-vsphere-data-source-distributed-virtual-switch"
description: |-
Provides a vSphere distributed virtual switch data source. This can be used to get select attributes of a DVS.
Provides a vSphere Distributed Switch data source. This can be used to get select attributes of a VDS.
---

# vsphere\_distributed\_virtual\_switch

The `vsphere_distributed_virtual_switch` data source can be used to discover
the ID and uplink data of a of a vSphere distributed virtual switch (DVS). This
can then be used with resources or data sources that require a DVS, such as the
the ID and uplink data of a of a vSphere Distributed Switch (VDS). This
can then be used with resources or data sources that require a VDS, such as the
[`vsphere_distributed_port_group`][distributed-port-group] resource, for which
an example is shown below.

[distributed-port-group]: /docs/providers/vsphere/r/distributed_port_group.html

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

## Example Usage

The following example locates a DVS that is named `terraform-test-dvs`, in the
datacenter `dc1`. It then uses this DVS to set up a
The following example locates a VDS that is named `terraform-test-vds`, in the
datacenter `dc1`. It then uses this VDS to set up a
`vsphere_distributed_port_group` resource that uses the first uplink as a
primary uplink and the second uplink as a secondary.

Expand All @@ -31,28 +31,28 @@ data "vsphere_datacenter" "datacenter" {
name = "dc1"
}

data "vsphere_distributed_virtual_switch" "dvs" {
name = "terraform-test-dvs"
data "vsphere_distributed_virtual_switch" "vds" {
name = "terraform-test-vds"
datacenter_id = "${data.vsphere_datacenter.datacenter.id}"
}

resource "vsphere_distributed_port_group" "pg" {
name = "terraform-test-pg"
distributed_virtual_switch_uuid = "${data.vsphere_distributed_virtual_switch.dvs.id}"
distributed_virtual_switch_uuid = "${data.vsphere_distributed_virtual_switch.vds.id}"

active_uplinks = ["${data.vsphere_distributed_virtual_switch.dvs.uplinks[0]}"]
standby_uplinks = ["${data.vsphere_distributed_virtual_switch.dvs.uplinks[1]}"]
active_uplinks = ["${data.vsphere_distributed_virtual_switch.vds.uplinks[0]}"]
standby_uplinks = ["${data.vsphere_distributed_virtual_switch.vds.uplinks[1]}"]
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The name of the distributed virtual switch. This can be a
* `name` - (Required) The name of the VDS. This can be a
name or path.
* `datacenter_id` - (Optional) The [managed object reference
ID][docs-about-morefs] of the datacenter the DVS is located in. This can be
ID][docs-about-morefs] of the datacenter the VDS is located in. This can be
omitted if the search path used in `name` is an absolute path. For default
datacenters, use the id attribute from an empty `vsphere_datacenter` data
source.
Expand All @@ -63,8 +63,8 @@ The following arguments are supported:

The following attributes are exported:

* `id`: The UUID of the distributed virtual switch.
* `uplinks`: The list of the uplinks on this DVS, as per the
* `id`: The UUID of the VDS.
* `uplinks`: The list of the uplinks on this VDS, as per the
[`uplinks`][distributed-virtual-switch-uplinks] argument to the
[`vsphere_distributed_virtual_switch`][distributed-virtual-switch-resource]
resource.
Expand Down
Loading