11---
2- # WARNING: this file was fetched from https://raw.githubusercontent.com/pulumi/pulumi-vsphere/v4.16.5 /docs/_index.md
2+ # WARNING: this file was fetched from https://raw.githubusercontent.com/pulumi/pulumi-vsphere/v4.17.0 /docs/_index.md
33# Do not edit by hand unless you're certain you know what you are doing!
4- edit_url : https://github.com/pulumi/pulumi-vsphere/blob/v4.16.5 /docs/_index.md
4+ edit_url : https://github.com/pulumi/pulumi-vsphere/blob/v4.17.0 /docs/_index.md
55# *** WARNING: This file was auto-generated. Do not edit by hand unless you're certain you know what you are doing! ***
66title : Vsphere Provider
77meta_desc : Provides an overview on how to configure the Pulumi Vsphere provider.
@@ -50,7 +50,7 @@ The datacenter, datastore, resource pool, and network are discovered using the
5050[ ` vsphere.ResourcePool ` ] ( https://www.terraform.io/docs/providers/vsphere/d/resource_pool.html ) , and
5151[ ` vsphere.getNetwork ` ] ( https://www.terraform.io/docs/providers/vsphere/d/network.html ) functions respectively.
5252
53- {{< chooser language "typescript,python,go,csharp,java,yaml" >}}
53+ {{< chooser language "typescript,python,go,csharp,java,yaml,hcl " >}}
5454{{% choosable language typescript %}}
5555``` yaml
5656# Pulumi.yaml provider configuration file
@@ -263,7 +263,7 @@ import (
263263
264264func main () {
265265 pulumi.Run (func (ctx *pulumi.Context ) error {
266- datacenter , err := vsphere.LookupDatacenter (ctx, &vsphere.LookupDatacenterArgs {
266+ datacenter , err := vsphere.GetDatacenter (ctx, &vsphere.LookupDatacenterArgs {
267267 Name: pulumi.StringRef (" dc-01" ),
268268 }, nil )
269269 if err != nil {
@@ -276,7 +276,7 @@ func main() {
276276 if err != nil {
277277 return err
278278 }
279- cluster , err := vsphere.LookupComputeCluster (ctx, &vsphere.LookupComputeClusterArgs {
279+ cluster , err := vsphere.GetComputeCluster (ctx, &vsphere.LookupComputeClusterArgs {
280280 Name: " cluster-01" ,
281281 DatacenterId: pulumi.StringRef (datacenter.Id ),
282282 }, nil )
@@ -414,8 +414,8 @@ import com.pulumi.vsphere.VirtualMachine;
414414import com.pulumi.vsphere.VirtualMachineArgs ;
415415import com.pulumi.vsphere.inputs.VirtualMachineNetworkInterfaceArgs ;
416416import com.pulumi.vsphere.inputs.VirtualMachineDiskArgs ;
417- import java.util.List ;
418417import java.util.ArrayList ;
418+ import java.util.Arrays ;
419419import java.util.Map ;
420420import java.io.File ;
421421import java.nio.file.Files ;
@@ -466,6 +466,50 @@ public class App {
466466}
467467```
468468
469+ {{% /choosable %}}
470+ {{% choosable language hcl %}}
471+ ``` hcl
472+ pulumi {
473+ required_providers {
474+ vsphere = {
475+ source = "pulumi/vsphere"
476+ }
477+ }
478+ }
479+
480+ data "vsphere_getdatacenter" "datacenter" {
481+ name = "dc-01"
482+ }
483+ data "vsphere_getdatastore" "datastore" {
484+ name = "datastore-01"
485+ datacenter_id = data.vsphere_getdatacenter.datacenter.id
486+ }
487+ data "vsphere_getcomputecluster" "cluster" {
488+ name = "cluster-01"
489+ datacenter_id = data.vsphere_getdatacenter.datacenter.id
490+ }
491+ data "vsphere_getnetwork" "network" {
492+ name = "VM Network"
493+ datacenter_id = data.vsphere_getdatacenter.datacenter.id
494+ }
495+
496+ resource "vsphere_virtualmachine" "vm" {
497+ name = "foo"
498+ resource_pool_id = data.vsphere_getcomputecluster.cluster.resource_pool_id
499+ datastore_id = data.vsphere_getdatastore.datastore.id
500+ num_cpus = 1
501+ memory = 1024
502+ guest_id = "otherLinux64Guest"
503+ network_interfaces {
504+ network_id = data.vsphere_getnetwork.network.id
505+ }
506+ disks {
507+ label = "disk0"
508+ size = 20
509+ }
510+ }
511+ ```
512+
469513{{% /choosable %}}
470514{{< /chooser >}}
471515
@@ -525,6 +569,13 @@ The session format used to save VIM SOAP sessions is the same used
525569with [ ` vmware/govc ` ] ( https://github.com/vmware/govmomi/tree/main/govc ) . If you use ` govc ` as part of your provisioning
526570process, Pulumi will use the saved session if present and if
527571` persistSession ` is enabled.
572+ #### Concurrent Session Limits
573+
574+ The provider does not close any sessions when its process is terminated.
575+ If session persistence is not configured you may reach the limits for concurrent sessions in vCenter.
576+ This will cause the provider to crash due to its inability to communicate with vCenter.
577+
578+ > ** NOTE:** Consult the product documentation for your version of vCenter for the applicable limits on concurrent sessions.
528579## Notes on Required Privileges
529580
530581When using a non-administrator account to perform provider operations, consider
0 commit comments