From bc7d78cf9ac1c78605a10e66b53becd0354faa60 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Mon, 17 Jun 2024 09:50:39 -0400 Subject: [PATCH] docs: markdown linting Addressed markdownlint issues for documentation. Signed-off-by: Ryan Johnson --- .github/pull_request_template.md | 5 + README.md | 74 ++++++------ acctests/README.md | 46 ++++--- docs/CODE_OF_CONDUCT.md | 5 +- docs/CONTRIBUTING.md | 85 ++++++++----- docs/FAQ.md | 27 +++-- docs/INSTALL.md | 79 +++++++----- docs/ISSUES.md | 59 ++++++--- docs/PULL_REQUESTS.md | 43 +++++-- docs/SUPPORT.md | 5 +- website/docs/d/compute_cluster.html.markdown | 17 +-- .../docs/d/content_library_item.html.markdown | 6 +- website/docs/d/datacenter.html.markdown | 6 +- website/docs/d/datastore.html.markdown | 21 ++-- .../docs/d/datastore_cluster.html.markdown | 4 +- website/docs/d/datastore_stats.html .markdown | 38 +++--- .../distributed_virtual_switch.html.markdown | 19 +-- website/docs/d/dynamic.html.markdown | 13 +- website/docs/d/host.html.markdown | 22 ++-- website/docs/d/host_base_images.html.markdown | 11 +- website/docs/d/host_pci_device.html.markdown | 12 +- website/docs/d/host_thumbprint.html.markdown | 15 ++- website/docs/d/license.html.markdown | 7 +- website/docs/d/network.html.markdown | 29 ++--- website/docs/d/resource_pool.html.markdown | 34 +++--- website/docs/d/tag.html.markdown | 8 +- website/docs/d/tag_category.html.markdown | 4 +- website/docs/d/vapp_container.html.markdown | 13 +- website/docs/d/virtual_machine.html.markdown | 114 ++++++++++-------- website/docs/d/vsphere_role.html.markdown | 5 +- website/docs/index.html.markdown | 4 +- website/docs/r/compute_cluster.html.markdown | 4 +- ...luster_vm_anti_affinity_rule.html.markdown | 2 +- .../docs/r/content_library_item.html.markdown | 2 + website/docs/r/custom_attribute.html.markdown | 1 + website/docs/r/datacenter.html.markdown | 10 +- website/docs/r/license.html.markdown | 1 - .../r/virtual_machine_class.html.markdown | 3 +- .../docs/r/vm_storage_policy.html.markdown | 12 +- website/docs/r/vmfs_datastore.html.markdown | 34 +++--- .../vsphere_entity_permissions.html.markdown | 56 +++++---- website/docs/r/vsphere_role.html.markdown | 10 +- 42 files changed, 569 insertions(+), 396 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f6089fb67..661ac6d4a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,6 +3,7 @@ ### Acceptance tests + - [ ] Have you added an acceptance test for the functionality being added? - [ ] Have you run the acceptance tests on this branch? @@ -13,6 +14,7 @@ Replace TestAccXXX with a pattern that matches the tests affected by this PR. For more information on the `-run` flag, see the `go test` documentation at https://tip.golang.org/cmd/go/#hdr-Testing_flags. --> + ``` $ make testacc TESTARGS='-run=TestAccXXX' @@ -20,7 +22,9 @@ $ make testacc TESTARGS='-run=TestAccXXX' ``` ### Release Note + Release note for [CHANGELOG](https://github.com/hashicorp/terraform-provider-vsphere/blob/main/CHANGELOG.md): + @@ -28,6 +32,7 @@ If change is not user facing, just write "NONE" in the release-note block below. ```release-note ... ``` + ### References Note that the resource pool referenced by [`resource_pool_id`](#resource_pool_id) - is dependent on the ESXi host's state. If it is a standalone ESXi host, the - resource pool will belong to the host only; however, if it is a member of a - cluster, the resource pool will be the root for the cluster. +-> Note that the resource pool referenced by +[`resource_pool_id`](#resource_pool_id) is dependent on the ESXi host's state. +If it is a standalone ESXi host, the resource pool will belong to the host only; +however, if it is a member of a cluster, the resource pool will be the root for +the cluster. [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider diff --git a/website/docs/d/host_base_images.html.markdown b/website/docs/d/host_base_images.html.markdown index 3b4105ac8..abda66f3b 100644 --- a/website/docs/d/host_base_images.html.markdown +++ b/website/docs/d/host_base_images.html.markdown @@ -4,19 +4,20 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_host_base_images" sidebar_current: "docs-vsphere-data-source-host-base-images" description: |- - Provides a VMware vSphere ESXi base images data source. This can be used to get the - list of ESXi base images available for cluster software management. + Provides a VMware vSphere ESXi base images data source. + This can be used to get the list of ESXi base images available for cluster + software management. --- # host\_base\_images -The `vsphere_host_base_images` data source can be used to get the list of ESXi base images available -for cluster software management. +The `vsphere_host_base_images` data source can be used to get the list of ESXi +base images available for cluster software management. ## Example Usage ```hcl -data "vsphere_host_base_images" "baseimages" {} +data "vsphere_host_base_images" "base_images" {} ``` ## Attribute Reference diff --git a/website/docs/d/host_pci_device.html.markdown b/website/docs/d/host_pci_device.html.markdown index 367798923..586d0fa11 100644 --- a/website/docs/d/host_pci_device.html.markdown +++ b/website/docs/d/host_pci_device.html.markdown @@ -32,18 +32,19 @@ data "vsphere_host_pci_device" "dev" { vendor_id = 456 } ``` + ## Example Usage with Name Regular Expression - + ```hcl data "vsphere_datacenter" "datacenter" { name = "dc-01" } - + data "vsphere_host" "host" { name = "esxi-01.example.com" datacenter_id = data.vsphere_datacenter.datacenter.id } - + data "vsphere_host_pci_device" "dev" { host_id = data.vsphere_host.host.id name_regex = "MMC" @@ -54,9 +55,10 @@ data "vsphere_host_pci_device" "dev" { 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 PCI device name. + host PCI device name. * `vendor_id` - (Optional) The hexadecimal PCI device vendor ID. * `class_id` - (Optional) The hexadecimal PCI device class ID diff --git a/website/docs/d/host_thumbprint.html.markdown b/website/docs/d/host_thumbprint.html.markdown index 9cd8fac21..638a399e8 100644 --- a/website/docs/d/host_thumbprint.html.markdown +++ b/website/docs/d/host_thumbprint.html.markdown @@ -9,10 +9,10 @@ description: |- # vsphere\_host\_thumbprint -The `vsphere_thumbprint` data source can be used to discover the host -thumbprint of an ESXi host. This can be used when adding the `vsphere_host` -resource. If the ESXi host is using a certificate chain, the first one returned -will be used to generate the thumbprint. +The `vsphere_thumbprint` data source can be used to discover the host thumbprint +of an ESXi host. This can be used when adding the `vsphere_host` resource. If +the ESXi host is using a certificate chain, the first one returned will be used +to generate the thumbprint. ## Example Usage @@ -26,13 +26,12 @@ data "vsphere_host_thumbprint" "thumbprint" { The following arguments are supported: -* `address` - (Required) The address of the ESXi host to retrieve the - thumbprint from. +* `address` - (Required) The address of the ESXi host to retrieve the thumbprint + from. * `port` - (Optional) The port to use connecting to the ESXi host. Default: 443 * `insecure` - (Optional) Disables SSL certificate verification. Default: `false` ## Attribute Reference -The only exported attribute is `id`, which is the thumbprint of the ESXi -host. +The only exported attribute is `id`, which is the thumbprint of the ESXi host. diff --git a/website/docs/d/license.html.markdown b/website/docs/d/license.html.markdown index c293c2cba..360009b49 100644 --- a/website/docs/d/license.html.markdown +++ b/website/docs/d/license.html.markdown @@ -4,8 +4,8 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_license" sidebar_current: "docs-vsphere-data-source-admin-license" description: |- - Provides a VMware vSphere license data source. This can be used to get the - general attributes of license keys. + Provides a VMware vSphere license data source. + This can be used to get the general attributes of license keys. --- # vsphere\_license @@ -31,7 +31,8 @@ The following arguments are supported: The following attributes are exported: -* `labels` - A map of key/value pairs attached as labels (tags) to the license key. +* `labels` - A map of key/value pairs attached as labels (tags) to the license + key. * `edition_key` - The product edition of the license key. * `total` - Total number of units (example: CPUs) contained in the license. * `used` - The number of units (example: CPUs) assigned to this license. diff --git a/website/docs/d/network.html.markdown b/website/docs/d/network.html.markdown index 8330b2f8a..1b51a93c7 100644 --- a/website/docs/d/network.html.markdown +++ b/website/docs/d/network.html.markdown @@ -4,17 +4,17 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_network" sidebar_current: "docs-vsphere-data-source-network" description: |- - Provides a vSphere network data source. This can be used to get the general - attributes of a vSphere network. + Provides a vSphere network data source. + This can be used to get the general attributes of a vSphere network. --- # vsphere\_network -The `vsphere_network` data source can be used to discover the ID of a network -in vSphere. This can be any network that can be used as the backing for a -network interface for `vsphere_virtual_machine` or any other vSphere resource -that requires a network. This includes standard (host-based) port groups, -distributed port groups, or opaque networks such as those managed by NSX. +The `vsphere_network` data source can be used to discover the ID of a network in +vSphere. This can be any network that can be used as the backing for a network +interface for `vsphere_virtual_machine` or any other vSphere resource that +requires a network. This includes standard (host-based) port groups, distributed +port groups, or opaque networks such as those managed by NSX. ## Example Usage @@ -34,14 +34,15 @@ data "vsphere_network" "network" { The following arguments are supported: * `name` - (Required) The name of the network. This can be a name or path. -* `datacenter_id` - (Optional) The [managed object reference ID][docs-about-morefs] - of the datacenter the network 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. +* `datacenter_id` - (Optional) The + [managed object reference ID][docs-about-morefs] of the datacenter the network + 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. * `distributed_virtual_switch_uuid` - (Optional) For distributed port group type - network objects, the ID of the distributed virtual switch for which the port - group belongs. It is useful to differentiate port groups with same name - using the distributed virtual switch ID. + network objects, the ID of the distributed virtual switch for which the port + group belongs. It is useful to differentiate port groups with same name using + the distributed virtual switch ID. [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider diff --git a/website/docs/d/resource_pool.html.markdown b/website/docs/d/resource_pool.html.markdown index 038dbc7fb..88b0bbdc7 100644 --- a/website/docs/d/resource_pool.html.markdown +++ b/website/docs/d/resource_pool.html.markdown @@ -4,8 +4,8 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_resource_pool" sidebar_current: "docs-vsphere-data-source-resource-pool" description: |- - Provides a vSphere resource pool data source. This can be used to get the - general attributes of a vSphere resource pool. + Provides a vSphere resource pool data source. + This can be used to get the general attributes of a vSphere resource pool. --- # vsphere\_resource\_pool @@ -32,15 +32,15 @@ data "vsphere_resource_pool" "pool" { ### Specifying the Root Resource Pool for a Standalone ESXi Host --> **NOTE:** Returning the root resource pool for a cluster can be done -directly via the [`vsphere_compute_cluster`][docs-compute-cluster-data-source] -data source. +-> **NOTE:** Returning the root resource pool for a cluster can be done directly +via the [`vsphere_compute_cluster`][docs-compute-cluster-data-source] data +source. [docs-compute-cluster-data-source]: /docs/providers/vsphere/d/compute_cluster.html All compute resources in vSphere have a resource pool, even if one has not been -explicitly created. This resource pool is referred to as the -_root resource pool_ and can be looked up by specifying the path. +explicitly created. This resource pool is referred to as the _root resource +pool_ and can be looked up by specifying the path. ``` data "vsphere_resource_pool" "pool" { @@ -49,7 +49,9 @@ data "vsphere_resource_pool" "pool" { } ``` -For more information on the root resource pool, see [Managing Resource Pools][vmware-docs-resource-pools] in the vSphere documentation. +For more information on the root resource pool, see +[Managing Resource Pools][vmware-docs-resource-pools] in the vSphere +documentation. [vmware-docs-resource-pools]: https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-resource-management/GUID-60077B40-66FF-4625-934A-641703ED7601.html @@ -59,17 +61,17 @@ The following arguments are supported: * `name` - (Optional) The name of the resource pool. This can be a name or path. This is required when using vCenter. -* `datacenter_id` - (Optional) The [managed object reference ID][docs-about-morefs] - of the datacenter in which the resource pool is located. 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. +* `datacenter_id` - (Optional) The + [managed object reference ID][docs-about-morefs] of the datacenter in which + the resource pool is located. 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. [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider -~> **Note:** When using ESXi without a vCenter Server instance, you do not -need to specify either attribute to use this data source. An empty declaration -will load the ESXi host's root resource pool. +~> **Note:** When using ESXi without a vCenter Server instance, you do not need +to specify either attribute to use this data source. An empty declaration will +load the ESXi host's root resource pool. ## Attribute Reference diff --git a/website/docs/d/tag.html.markdown b/website/docs/d/tag.html.markdown index a5bf58564..a2525526c 100644 --- a/website/docs/d/tag.html.markdown +++ b/website/docs/d/tag.html.markdown @@ -4,14 +4,14 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_tag" sidebar_current: "docs-vsphere-data-source-tag-data-source" description: |- - Provides a vSphere tag data source. This can be used to reference tags not - managed in Terraform. + Provides a vSphere tag data source. + This can be used to reference tags not managed in Terraform. --- # vsphere\_tag -The `vsphere_tag` data source can be used to reference tags that are not -managed by Terraform. Its attributes are exactly the same as the +The `vsphere_tag` data source can be used to reference tags that are not managed +by Terraform. Its attributes are exactly the same as the [`vsphere_tag` resource][resource-tag], and, like importing, the data source uses a name and category as search criteria. The `id` and other attributes are populated with the data found by the search. diff --git a/website/docs/d/tag_category.html.markdown b/website/docs/d/tag_category.html.markdown index 31528b2a0..cb5682ac6 100644 --- a/website/docs/d/tag_category.html.markdown +++ b/website/docs/d/tag_category.html.markdown @@ -4,8 +4,8 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_tag_category" sidebar_current: "docs-vsphere-data-source-tag-category" description: |- - Provides a vSphere tag category data source. This can be used to reference - tag categories not managed in Terraform. + Provides a vSphere tag category data source. + This can be used to reference tag categories not managed in Terraform. --- # vsphere\_tag\_category diff --git a/website/docs/d/vapp_container.html.markdown b/website/docs/d/vapp_container.html.markdown index 0935c5ccd..a9c2ddcd7 100644 --- a/website/docs/d/vapp_container.html.markdown +++ b/website/docs/d/vapp_container.html.markdown @@ -4,8 +4,8 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_vapp_container" sidebar_current: "docs-vsphere-data-source-resource-pool" description: |- - Provides a vSphere vApp container data source. This can be used to return the - general attributes of a vSphere vApp container. + Provides a vSphere vApp container data source. + This can be used to return the general attributes of a vSphere vApp container. --- # vsphere\_resource\_pool @@ -36,12 +36,13 @@ The following arguments are supported: * `name` - (Required) The name of the vApp container. This can be a name or path. -* `datacenter_id` - (Required) The [managed object reference ID][docs-about-morefs] - of the datacenter in which the vApp container is located. +* `datacenter_id` - (Required) The + [managed object reference ID][docs-about-morefs] of the datacenter in which + the vApp container is located. [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider ## Attribute Reference -The only exported attribute for this data source is `id`, which -represents the ID of the vApp container that was looked up. +The only exported attribute for this data source is `id`, which represents the +ID of the vApp container that was looked up. diff --git a/website/docs/d/virtual_machine.html.markdown b/website/docs/d/virtual_machine.html.markdown index 26196fce6..a7faf9fa1 100644 --- a/website/docs/d/virtual_machine.html.markdown +++ b/website/docs/d/virtual_machine.html.markdown @@ -4,14 +4,15 @@ layout: "vsphere" page_title: "VMware vSphere: vsphere_virtual_machine" sidebar_current: "docs-vsphere-data-source-virtual-machine" description: |- - Provides a VMware vSphere virtual machine data source. This can be used to return data from a virtual machine or template. + Provides a VMware vSphere virtual machine data source. + This can be used to return data from a virtual machine or template. --- # vsphere\_virtual\_machine The `vsphere_virtual_machine` data source can be used to find the UUID of an -existing virtual machine or template. The most common purpose is for finding -the UUID of a template to be used as the source for cloning to a new +existing virtual machine or template. The most common purpose is for finding the +UUID of a template to be used as the source for cloning to a new [`vsphere_virtual_machine`][docs-virtual-machine-resource] resource. It also reads the guest ID so that can be supplied as well. @@ -19,8 +20,8 @@ reads the guest ID so that can be supplied as well. ## Example Usage -In the following example, a virtual machine template is returned by its -unique name within the `vsphere_datacenter`. +In the following example, a virtual machine template is returned by its unique +name within the `vsphere_datacenter`. ```hcl data "vsphere_datacenter" "datacenter" { @@ -32,6 +33,7 @@ data "vsphere_virtual_machine" "template" { datacenter_id = data.vsphere_datacenter.datacenter.id } ``` + In the following example, each virtual machine template is returned by its unique full path within the `vsphere_datacenter`. @@ -55,27 +57,31 @@ data "vsphere_virtual_machine" "development_template" { The following arguments are supported: -* `name` - (Optional) The name of the virtual machine. This can be a name or - the full path relative to the datacenter. This is required if a UUID lookup - is not performed. -* `uuid` - (Optional) Specify this field for a UUID lookup, `name` and `datacenter_id` - are not required if this is specified. -* `folder` - (Optional) The name of the virtual machine folder where the virtual machine is located. The `name` argument is limited to 80 characters. If the `name` argument includes the full path to the virtual machine and exceeds the 80 characters limit, the `folder` folder argument can be used. +* `name` - (Optional) The name of the virtual machine. This can be a name or the + full path relative to the datacenter. This is required if a UUID lookup is not + performed. +* `uuid` - (Optional) Specify this field for a UUID lookup, `name` and + `datacenter_id` are not required if this is specified. +* `folder` - (Optional) The name of the virtual machine folder where the virtual + machine is located. The `name` argument is limited to 80 characters. If the + `name` argument includes the full path to the virtual machine and exceeds the + 80 characters limit, the `folder` folder argument can be used. * `datacenter_id` - (Optional) The [managed object reference ID][docs-about-morefs] of the datacenter the virtual machine 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. + 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. * `scsi_controller_scan_count` - (Optional) The number of SCSI controllers to scan for disk attributes and controller types on. Default: `1`. [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider ~> **NOTE:** For best results, ensure that all the disks on any templates you -use with this data source reside on the primary controller, and leave this -value at the default. See the [`vsphere_virtual_machine`][docs-virtual-machine-resource] -resource documentation for the significance of this setting, specifically the -[additional requirements and notes for cloning][docs-virtual-machine-resource-cloning] +use with this data source reside on the primary controller, and leave this value +at the default. See the +[`vsphere_virtual_machine`][docs-virtual-machine-resource] resource +documentation for the significance of this setting, specifically the +[additional requirements and notes for cloning][docs-virtual-machine-resource-cloning] section. [docs-virtual-machine-resource-cloning]: /docs/providers/vsphere/r/virtual_machine.html#additional-requirements-and-notes-for-cloning @@ -87,14 +93,16 @@ The following attributes are exported: * `id` - The UUID of the virtual machine or template. * `guest_id` - The guest ID of the virtual machine or template. * `alternate_guest_name` - The alternate guest name of the virtual machine when -`guest_id` is a non-specific operating system, like `otherGuest` or `otherGuest64`. + `guest_id` is a non-specific operating system, like `otherGuest` or + `otherGuest64`. * `annotation` - The user-provided description of this virtual machine. * `memory` - The size of the virtual machine's memory, in MB. * `num_cpus` - The total number of virtual processor cores assigned to this virtual machine. -* `num_cores_per_socket` - The number of cores per socket for this virtual machine. -* `firmware` - The firmware interface that is used by this virtual machine. Can be - either `bios` or `efi`. +* `num_cores_per_socket` - The number of cores per socket for this virtual + machine. +* `firmware` - The firmware interface that is used by this virtual machine. Can + be either `bios` or `efi`. * `hardware_version` - The hardware version number on this virtual machine. * `scsi_type` - The common type of all SCSI controllers on this virtual machine. Will be one of `lsilogic` (LSI Logic Parallel), `lsilogic-sas` (LSI Logic @@ -108,10 +116,10 @@ The following attributes are exported: template. These are sorted by bus and unit number so that they can be applied to a `vsphere_virtual_machine` resource in the order the resource expects while cloning. This is useful for discovering certain disk settings while - performing a linked clone, as all settings that are output by this data - source must be the same on the destination virtual machine as the source. - Only the first number of controllers defined by `scsi_controller_scan_count` - are scanned for disks. The sub-attributes are: + performing a linked clone, as all settings that are output by this data source + must be the same on the destination virtual machine as the source. Only the + first number of controllers defined by `scsi_controller_scan_count` are + scanned for disks. The sub-attributes are: * `label` - The label for the disk. * `size` - The size of the disk, in GIB. * `eagerly_scrub` - Set to `true` if the disk has been eager zeroed. @@ -119,34 +127,36 @@ The following attributes are exported: * `unit_number` - The disk number on the storage bus. * `network_interface_types` - The network interface types for each network interface found on the virtual machine, in device bus order. Will be one of - `e1000`, `e1000e`, `pcnet32`, `sriov`, `vmxnet2`, `vmxnet3vrdma`, or `vmxnet3`. -* `network_interfaces` - Information about each of the network interfaces on this - virtual machine or template. These are sorted by device bus order so that they - can be applied to a `vsphere_virtual_machine` resource in the order the resource - expects while cloning. This is useful for discovering certain network interface - settings while performing a linked clone, as all settings that are output by this - data source must be the same on the destination virtual machine as the source. - The sub-attributes are: - * `adapter_type` - The network interface types for each network interface found - on the virtual machine, in device bus order. Will be one of `e1000`, `e1000e`, - `vmxnet3vrdma`, or `vmxnet3`. - * `bandwidth_limit` - The upper bandwidth limit of this network interface, - in Mbits/sec. - * `bandwidth_reservation` - The bandwidth reservation of this network interface, + `e1000`, `e1000e`, `pcnet32`, `sriov`, `vmxnet2`, `vmxnet3vrdma`, or + `vmxnet3`. +* `network_interfaces` - Information about each of the network interfaces on + this virtual machine or template. These are sorted by device bus order so that + they can be applied to a `vsphere_virtual_machine` resource in the order the + resource expects while cloning. This is useful for discovering certain network + interface settings while performing a linked clone, as all settings that are + output by this data source must be the same on the destination virtual machine + as the source. The sub-attributes are: + * `adapter_type` - The network interface types for each network interface found + on the virtual machine, in device bus order. Will be one of `e1000`, + `e1000e`, `vmxnet3vrdma`, or `vmxnet3`. + * `bandwidth_limit` - The upper bandwidth limit of this network interface, in Mbits/sec. - * `bandwidth_share_level` - The bandwidth share allocation level for this interface. - Can be one of `low`, `normal`, `high`, or `custom`. - * `bandwidth_share_count` - The share count for this network interface when the - share level is custom. + * `bandwidth_reservation` - The bandwidth reservation of this network + interface, in Mbits/sec. + * `bandwidth_share_level` - The bandwidth share allocation level for this + interface. Can be one of `low`, `normal`, `high`, or `custom`. + * `bandwidth_share_count` - The share count for this network interface when the + share level is custom. * `mac_address` - The MAC address of this network interface. - * `network_id` - The managed object reference ID of the network this interface is - connected to. -* `firmware` - The firmware type for this virtual machine. Can be `bios` or `efi`. -* `default_ip_address` - Whenever possible, this is the first IPv4 address that is reachable through - the default gateway configured on the machine, then the first reachable IPv6 - address, and then the first general discovered address if neither exist. If - VMware Tools is not running on the virtual machine, or if the VM is powered - off, this value will be blank. + * `network_id` - The managed object reference ID of the network this interface + is connected to. +* `firmware` - The firmware type for this virtual machine. Can be `bios` or + `efi`. +* `default_ip_address` - Whenever possible, this is the first IPv4 address that + is reachable through the default gateway configured on the machine, then the + first reachable IPv6 address, and then the first general discovered address if + neither exist. If VMware Tools is not running on the virtual machine, or if + the VM is powered off, this value will be blank. * `guest_ip_addresses` - A list of IP addresses as reported by VMware Tools. * `instance_uuid` - The instance UUID of the virtual machine or template. diff --git a/website/docs/d/vsphere_role.html.markdown b/website/docs/d/vsphere_role.html.markdown index b0b3697a5..1a8656085 100644 --- a/website/docs/d/vsphere_role.html.markdown +++ b/website/docs/d/vsphere_role.html.markdown @@ -9,9 +9,8 @@ description: |- # vsphere\_role -The `vsphere_role` data source can be used to discover the `id` and privileges associated -with a role given its name or display label. - +The `vsphere_role` data source can be used to discover the `id` and privileges +associated with a role given its name or display label. ## Example Usage diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 3b522b889..93bfefca8 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -246,7 +246,7 @@ To get all the necessary data in a single output, use `govc ls -l -i PATH`. Sample output is below: -``` +```shell $ govc ls -l -i /dc-01/vm VirtualMachine:vm-123 /dc-01/vm/foobar Folder:group-v234 /dc-01/vm/subfolder @@ -254,7 +254,7 @@ Folder:group-v234 /dc-01/vm/subfolder To do a reverse search, supply the `-L` switch: -``` +```shell $ govc ls -i -l -L VirtualMachine:vm-123 VirtualMachine:vm-123 /dc-01/vm/foo ``` diff --git a/website/docs/r/compute_cluster.html.markdown b/website/docs/r/compute_cluster.html.markdown index a3b0f43c2..f91e4b171 100644 --- a/website/docs/r/compute_cluster.html.markdown +++ b/website/docs/r/compute_cluster.html.markdown @@ -406,7 +406,7 @@ The following settings control specific settings for Admission Control when #### vSphere HA Datastore Settings -vSphere HA uses datastore heartbeating to determine the health of a particular +vSphere HA uses datastore heartbeats to determine the health of a particular host. Depending on how your datastores are configured, the settings below may need to be altered to ensure that specific datastores are used over others. @@ -420,7 +420,7 @@ If you require a user-defined list of datastores, ensure you select either `allFeasibleDsWithUserPreference`. Default: `allFeasibleDsWithUserPreference`. * `ha_heartbeat_datastore_ids` - (Optional) The list of managed object IDs for - preferred datastores to use for HA heartbeating. This setting is only useful + preferred datastores to use for HA heartbeats. This setting is only useful when [`ha_heartbeat_datastore_policy`](#ha_heartbeat_datastore_policy) is set to either `userSelectedDs` or `allFeasibleDsWithUserPreference`. diff --git a/website/docs/r/compute_cluster_vm_anti_affinity_rule.html.markdown b/website/docs/r/compute_cluster_vm_anti_affinity_rule.html.markdown index 26107440f..fd3d2f25d 100644 --- a/website/docs/r/compute_cluster_vm_anti_affinity_rule.html.markdown +++ b/website/docs/r/compute_cluster_vm_anti_affinity_rule.html.markdown @@ -24,7 +24,7 @@ to ensure that the virtual machines run on different hosts, or prevent any operation that would keep that from happening, depending on the value of the [`mandatory`](#mandatory) flag. --> An anti-affinity rule can only be used to place virtual machines on seperate +-> An anti-affinity rule can only be used to place virtual machines on separate _non-specific_ hosts. Specific hosts cannot be specified with this rule. To enable this capability, use VM-Host Groups, see the [`vsphere_compute_cluster_vm_host_rule`][tf-vsphere-cluster-vm-host-rule-resource] diff --git a/website/docs/r/content_library_item.html.markdown b/website/docs/r/content_library_item.html.markdown index 89b9af8e7..4eee84d6d 100644 --- a/website/docs/r/content_library_item.html.markdown +++ b/website/docs/r/content_library_item.html.markdown @@ -100,6 +100,8 @@ The only attribute this resource exports is the `id` of the resource, which is a combination of the [managed object reference ID][docs-about-morefs] of the cluster, and the name of the virtual machine group. +[docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider + ## Importing An existing content library item can be [imported][docs-import] into this resource by diff --git a/website/docs/r/custom_attribute.html.markdown b/website/docs/r/custom_attribute.html.markdown index 24366573f..31accdba2 100644 --- a/website/docs/r/custom_attribute.html.markdown +++ b/website/docs/r/custom_attribute.html.markdown @@ -62,6 +62,7 @@ resource "vsphere_virtual_machine" "vm" { # ... other configuration ... } ``` + The following example creates a [`vsphere_virtual_machine`][docs-virtual-machine-resource] resource and an existing custom attribute is then applied with an assigned value to the virtual machine. [docs-virtual-machine-resource]: /docs/providers/vsphere/r/virtual_machine.html diff --git a/website/docs/r/datacenter.html.markdown b/website/docs/r/datacenter.html.markdown index d6d407411..bd2a69195 100644 --- a/website/docs/r/datacenter.html.markdown +++ b/website/docs/r/datacenter.html.markdown @@ -44,14 +44,14 @@ The following arguments are supported: [docs-applying-tags]: /docs/providers/vsphere/r/tag.html#using-tags-in-a-supported-resource -* `custom_attributes` - (Optional) Map of custom attribute ids to value - strings to set for datacenter resource. See - [here][docs-setting-custom-attributes] for a reference on how to set values +* `custom_attributes` - (Optional) Map of custom attribute ids to value + strings to set for datacenter resource. See + [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes. [docs-setting-custom-attributes]: /docs/providers/vsphere/r/custom_attribute.html#using-custom-attributes-in-a-supported-resource -~> **NOTE:** Custom attributes are unsupported on direct ESXi connections +~> **NOTE:** Custom attributes are unsupported on direct ESXi connections and require vCenter. ## Attribute Reference @@ -62,7 +62,7 @@ and require vCenter. [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider -## Importing +## Importing An existing datacenter can be [imported][docs-import] into this resource via supplying the full path to the datacenter. An example is below: diff --git a/website/docs/r/license.html.markdown b/website/docs/r/license.html.markdown index bc4b4360e..f837bd446 100644 --- a/website/docs/r/license.html.markdown +++ b/website/docs/r/license.html.markdown @@ -32,7 +32,6 @@ The following arguments are supported: * `license_key` - (Required) The license key to add. * `labels` - (Optional) A map of key/value pairs to be attached as labels (tags) to the license key. - ## Attributes Reference The following attributes are exported: diff --git a/website/docs/r/virtual_machine_class.html.markdown b/website/docs/r/virtual_machine_class.html.markdown index 7eb3f66f8..188b58a94 100644 --- a/website/docs/r/virtual_machine_class.html.markdown +++ b/website/docs/r/virtual_machine_class.html.markdown @@ -24,6 +24,7 @@ resource "vsphere_virtual_machine_class" "basic_class" { ``` **Create a class with a vGPU** + ```hcl resource "vsphere_virtual_machine_class" "vgp_class" { name = "vgpu-class" @@ -40,4 +41,4 @@ resource "vsphere_virtual_machine_class" "vgp_class" { * `cpus` - The number of CPUs. * `memory` - The amount of memory in MB. * `memory_reservation` - The percentage of memory reservation. -* `vgpu_devices` - The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100. \ No newline at end of file +* `vgpu_devices` - The identifiers of the vGPU devices for the class. If this is set memory reservation needs to be 100. diff --git a/website/docs/r/vm_storage_policy.html.markdown b/website/docs/r/vm_storage_policy.html.markdown index e7b479cce..7d117582b 100644 --- a/website/docs/r/vm_storage_policy.html.markdown +++ b/website/docs/r/vm_storage_policy.html.markdown @@ -4,13 +4,13 @@ layout: "vsphere" page_title: "VMware vSphere: vm_storage_policy" sidebar_current: "docs-vsphere-resource-vm-storage-policy" description: |- - Storage policies can select the most appropriate datastore for the virtual machine and enforce the required level of service. + Storage policies can select the most appropriate datastore for the virtual machine and enforce the required level of service. --- # vsphere\_vm\_storage\_policy -The `vsphere_vm_storage_policy` resource can be used to create and manage storage -policies. Using this resource, tag based placement rules can be created to +The `vsphere_vm_storage_policy` resource can be used to create and manage storage +policies. Using this resource, tag based placement rules can be created to place virtual machines on a datastore with matching tags. If storage requirements for the applications on the virtual machine change, you can modify the storage policy that was originally applied to the virtual machine. ## Example Usage @@ -139,7 +139,7 @@ resource "vsphere_vm_storage_policy" "dev_silver_nonreplicated" { } ``` -Lasttly, when creating a virtual machine resource, a storage policy can be specificed to direct virtual machine placement to a datastore which matches the policy's `tags_rules`. +Lastly, when creating a virtual machine resource, a storage policy can be specified to direct virtual machine placement to a datastore which matches the policy's `tags_rules`. ```hcl data "vsphere_storage_policy" "prod_platinum_replicated" { @@ -168,8 +168,8 @@ resource "vsphere_virtual_machine" "dev_vm" { The following arguments are supported: * `name` - (Required) The name of the storage policy. -* `description` - (Optional) Description of the storage policy. +* `description` - (Optional) Description of the storage policy. * `tag_rules` - (Required) List of tag rules. The tag category and tags to be associated to this storage policy. * `tag_category` - (Required) Name of the tag category. * `tags` - (Required) List of Name of tags to select from the given category. - * `include_datastores_with_tags` - (Optional) Include datastores with the given tags or exclude. Default `true`. \ No newline at end of file + * `include_datastores_with_tags` - (Optional) Include datastores with the given tags or exclude. Default `true`. diff --git a/website/docs/r/vmfs_datastore.html.markdown b/website/docs/r/vmfs_datastore.html.markdown index 5691fc06d..9d54d885c 100644 --- a/website/docs/r/vmfs_datastore.html.markdown +++ b/website/docs/r/vmfs_datastore.html.markdown @@ -16,11 +16,11 @@ disks presented to a host or multiple hosts over Fibre Channel or iSCSI. Devices can be specified manually, or discovered using the [`vsphere_vmfs_disks`][data-source-vmfs-disks] data source. -[data-source-vmfs-disks]: /docs/providers/vsphere/d/vmfs_disks.html +[data-source-vmfs-disks]: /docs/providers/vsphere/d/vmfs_disks.html ## Auto-Mounting of Datastores Within vCenter -Note that the current behaviour of this resource will auto-mount any created +Note that the current behavior of this resource will auto-mount any created datastores to any other host within vCenter that has access to the same disk. Example: You want to create a datastore with a iSCSI LUN that is visible on 3 @@ -30,7 +30,7 @@ create the datastore on `esxi1`, the datastore will be automatically mounted on those two hosts. Future versions of this resource may allow you to control the hosts that a -datastore is mounted to, but currently, this automatic behaviour cannot be +datastore is mounted to, but currently, this automatic behavior cannot be changed, so keep this in mind when writing your configurations and deploying your disks. @@ -58,20 +58,20 @@ datastore with local disks to a single ESXi server. ~> **NOTE:** There are some situations where datastore creation will not work when working through vCenter (usually when trying to create a datastore on a single host with local disks). If you experience trouble creating the datastore -you need through vCenter, break the datstore off into a different configuration +you need through vCenter, break the datastore off into a different configuration and deploy it using the ESXi server as the provider endpoint, using a similar configuration to what is below. ```hcl data "vsphere_datacenter" "datacenter" {} -data "vsphere_host" "esxi_host" { - datacenter_id = "${data.vsphere_datacenter.datacenter.id}" +data "vsphere_host" "host" { + datacenter_id = data.vsphere_datacenter.datacenter.id } resource "vsphere_vmfs_datastore" "datastore" { name = "terraform-test" - host_system_id = "${data.vsphere_host.esxi_host.id}" + host_system_id = data.vsphere_host.host.id disks = [ "mpx.vmhba1:C0:T1:L0", @@ -94,23 +94,23 @@ into `vsphere_vmfs_datastore`. The datastore is also placed in the ```hcl data "vsphere_datacenter" "datacenter" { - name = "dc1" + name = "dc-01" } -data "vsphere_host" "esxi_host" { - name = "esxi1" - datacenter_id = "${data.vsphere_datacenter.datacenter.id}" +data "vsphere_host" "host" { + name = "esxi-01.example.com" + datacenter_id = data.vsphere_datacenter.datacenter.id } data "vsphere_vmfs_disks" "available" { - host_system_id = "${data.vsphere_host.esxi_host.id}" + host_system_id = data.vsphere_host.host.id rescan = true filter = "naa.60a98000" } resource "vsphere_vmfs_datastore" "datastore" { name = "terraform-test" - host_system_id = "${data.vsphere_host.esxi_host.id}" + host_system_id = data.vsphere_host.host.id folder = "datastore-folder" disks = ["${data.vsphere_vmfs_disks.available.disks}"] @@ -145,14 +145,14 @@ The following arguments are supported: [docs-applying-tags]: /docs/providers/vsphere/r/tag.html#using-tags-in-a-supported-resource [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider -* `custom_attributes` (Optional) Map of custom attribute ids to attribute - value string to set on datastore resource. See - [here][docs-setting-custom-attributes] for a reference on how to set values +* `custom_attributes` (Optional) Map of custom attribute ids to attribute + value string to set on datastore resource. See + [here][docs-setting-custom-attributes] for a reference on how to set values for custom attributes. [docs-setting-custom-attributes]: /docs/providers/vsphere/r/custom_attribute.html#using-custom-attributes-in-a-supported-resource -~> **NOTE:** Custom attributes are unsupported on direct ESXi connections +~> **NOTE:** Custom attributes are unsupported on direct ESXi connections and require vCenter. ## Attribute Reference diff --git a/website/docs/r/vsphere_entity_permissions.html.markdown b/website/docs/r/vsphere_entity_permissions.html.markdown index b598cd163..d59a2879d 100644 --- a/website/docs/r/vsphere_entity_permissions.html.markdown +++ b/website/docs/r/vsphere_entity_permissions.html.markdown @@ -4,33 +4,37 @@ layout: "vsphere" page_title: "VMware vSphere: Entity Permissions" sidebar_current: "docs-vsphere-entity-permissions" description: |- - Provides CRUD operations on a vsphere entity permissions. Permissions can be created on an entity for a given user or - group with the specified roles. + Provides CRUD operations on a vsphere entity permissions. + Permissions can be created on an entity for a given user or group with the + specified roles. --- # vsphere\_entity\_permissions -The `vsphere_entity_permissions` resource can be used to create and manage entity permissions. -Permissions can be created on an entity for a given user or group with the specified role. +The `vsphere_entity_permissions` resource can be used to create and manage +entity permissions. Permissions can be created on an entity for a given user or +group with the specified role. ## Example Usage -This example creates entity permissions on the virtual machine VM1 for the user group DCClients with role Datastore -consumer and for user group ExternalIDPUsers with role my_terraform_role. The `entity_id` can be the managed object id -(or uuid for some resources). The `entity_type` is one of the managed object types which can be found from the -managed object types section [here](https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/). Keep the permissions sorted -alphabetically, ignoring case on `user_or_group` for a better user experience. +This example creates entity permissions on the virtual machine VM1 for the user +group DCClients with role Datastore consumer and for user group ExternalIDPUsers +with role my_terraform_role. The `entity_id` can be the managed object id (or +uuid for some resources). The `entity_type` is one of the managed object types +which can be found from the managed object types section +[here](https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/). +Keep the permissions sorted alphabetically, ignoring case on `user_or_group` for +a better user experience. ```hcl - -data "vsphere_datacenter" "dc" { +data "vsphere_datacenter" "datacenter" { name = "Sample_DC_2" } -data "vsphere_virtual_machine" vm1 { +data "vsphere_virtual_machine" "vm" { name = "VM1" - datacenter_id = data.vsphere_datacenter.dc.id + datacenter_id = data.vsphere_datacenter.datacenter.id } data "vsphere_role" "role1" { @@ -43,7 +47,7 @@ resource vsphere_role "role2" { } resource "vsphere_entity_permissions" p1 { - entity_id = data.vsphere_virtual_machine.vm1.id + entity_id = data.vsphere_virtual_machine.vm.id entity_type = "VirtualMachine" permissions { user_or_group = "vsphere.local\\DCClients" @@ -58,21 +62,25 @@ resource "vsphere_entity_permissions" p1 { role_id = vsphere_role.role2.id } } - ``` ## Argument Reference The following arguments are supported: -* `entity_id` - (Required) The managed object id (uuid for some entities) on which permissions are to be created. -* `entity_type` - (Required) The managed object type, types can be found in the managed object type section - [here](https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/). - -* `permissions` - (Required) The permissions to be given on this entity. Keep the permissions sorted - alphabetically on `user_or_group` for a better user experience. +* `entity_id` - (Required) The managed object id (uuid for some entities) on + which permissions are to be created. +* `entity_type` - (Required) The managed object type, types can be found in the + managed object type section + [here](https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/). +* `permissions` - (Required) The permissions to be given on this entity. Keep + the permissions sorted alphabetically on `user_or_group` for a better user + experience. * `user_or_group` - (Required) The user/group getting the permission. - * `is_group` - (Required) Whether user_or_group field refers to a user or a group. True for a group and false for a user. - * `role_id` - (Required) The role id of the role to be given to the user on the specified entity. - * `propagate` - (Required) Whether or not this permission propagates down the hierarchy to sub-entities. + * `is_group` - (Required) Whether `user_or_group` field refers to a user or a + group. True for a group and false for a user. + * `role_id` - (Required) The role id of the role to be given to the user on + the specified entity. + * `propagate` - (Required) Whether or not this permission propagates down the + hierarchy to sub-entities. diff --git a/website/docs/r/vsphere_role.html.markdown b/website/docs/r/vsphere_role.html.markdown index d0eb4b29b..bc2947bea 100644 --- a/website/docs/r/vsphere_role.html.markdown +++ b/website/docs/r/vsphere_role.html.markdown @@ -9,22 +9,21 @@ description: |- # vsphere\_role -The `vsphere_role` resource can be used to create and manage roles. Using this resource, privileges can be +The `vsphere_role` resource can be used to create and manage roles. Using this resource, privileges can be associated with the roles. The role can be used while granting permissions to an entity. ## Example Usage -This example creates a role with name my_terraform_role and privileges create, acknowledge for Alarm and +This example creates a role with name my_terraform_role and privileges create, acknowledge for Alarm and create, move for Datacenter. While providing `role_privileges`, the id of the privilege has to be provided. The format of the privilege id is privilege name preceded by its categories joined by a `.`. -For example a privilege with path `category->subcategory->privilege` should be provided as +For example a privilege with path `category->subcategory->privilege` should be provided as `category.subcategory.privilege`. Keep the `role_privileges` sorted alphabetically for a better user experience. ~> **NOTE:** While providing `role_privileges`, the id of the privilege and its categories are to be provided joined by a `.` . ```hcl - resource vsphere_role "role1" { name = "my_terraform_role" role_privileges = ["Alarm.Acknowledge", "Alarm.Create", "Datacenter.Create", "Datacenter.Move"] @@ -42,9 +41,10 @@ The following arguments are supported: An existing role can be imported into this resource by supplying the role id. An example is below: -```hcl +``` terraform import vsphere_role.role1 -709298051 ``` + ~> **NOTE:** System roles can't be imported because they can't be modified or deleted. Use [`vsphere_role` data source][ref-vsphere-role-data-source] to read information about system roles.