Class ComputeClusterVmGroup
The vsphere..ComputeClusterVmGroup resource can be used to manage groups of
virtual machines in a cluster, either created by the
vsphere..ComputeCluster resource or looked up
by the vsphere..ComputeCluster data source.
This resource mainly serves as an input to the
vsphere..ComputeClusterVmDependencyRule
and
vsphere..ComputeClusterVmHostRule
resources. See the individual resource documentation pages for more information.
NOTE: This resource requires vCenter and is not available on direct ESXi connections.
NOTE: vSphere DRS requires a vSphere Enterprise Plus license.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var dc = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
{
Name = "dc1",
}));
var datastore = dc.Apply(dc => Output.Create(VSphere.GetDatastore.InvokeAsync(new VSphere.GetDatastoreArgs
{
DatacenterId = dc.Id,
Name = "datastore1",
})));
var cluster = dc.Apply(dc => Output.Create(VSphere.GetComputeCluster.InvokeAsync(new VSphere.GetComputeClusterArgs
{
DatacenterId = dc.Id,
Name = "cluster1",
})));
var network = dc.Apply(dc => Output.Create(VSphere.GetNetwork.InvokeAsync(new VSphere.GetNetworkArgs
{
DatacenterId = dc.Id,
Name = "network1",
})));
var vm = new List<VSphere.VirtualMachine>();
for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
{
var range = new { Value = rangeIndex };
vm.Add(new VSphere.VirtualMachine($"vm-{range.Value}", new VSphere.VirtualMachineArgs
{
DatastoreId = datastore.Apply(datastore => datastore.Id),
Disks =
{
new VSphere.Inputs.VirtualMachineDiskArgs
{
Label = "disk0",
Size = 20,
},
},
GuestId = "other3xLinux64Guest",
Memory = 2048,
NetworkInterfaces =
{
new VSphere.Inputs.VirtualMachineNetworkInterfaceArgs
{
NetworkId = network.Apply(network => network.Id),
},
},
NumCpus = 2,
ResourcePoolId = cluster.Apply(cluster => cluster.ResourcePoolId),
}));
}
var clusterVmGroup = new VSphere.ComputeClusterVmGroup("clusterVmGroup", new VSphere.ComputeClusterVmGroupArgs
{
ComputeClusterId = cluster.Apply(cluster => cluster.Id),
VirtualMachineIds = vm.Select(__item => __item.Id).ToList(),
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class ComputeClusterVmGroup : CustomResource
Constructors
View SourceComputeClusterVmGroup(String, ComputeClusterVmGroupArgs, CustomResourceOptions)
Create a ComputeClusterVmGroup resource with the given unique name, arguments, and options.
Declaration
public ComputeClusterVmGroup(string name, ComputeClusterVmGroupArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ComputeClusterVmGroupArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceComputeClusterId
The managed object reference ID of the cluster to put the group in. Forces a new resource if changed.
Declaration
public Output<string> ComputeClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the VM group. This must be unique in the cluster. Forces a new resource if changed.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VirtualMachineIds
The UUIDs of the virtual machines in this group.
Declaration
public Output<ImmutableArray<string>> VirtualMachineIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, ComputeClusterVmGroupState, CustomResourceOptions)
Get an existing ComputeClusterVmGroup resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ComputeClusterVmGroup Get(string name, Input<string> id, ComputeClusterVmGroupState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ComputeClusterVmGroupState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ComputeClusterVmGroup |