1. Packages
  2. Vcd Provider
  3. API Docs
  4. getVmGroup
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getVmGroup

Explore with Pulumi AI

Provides a VMware Cloud Director VM Group data source. This can be used to fetch vSphere VM Groups and create VM Placement Policies with them.

Supported in provider v3.8+

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";

const my_vdc = vcd.getProviderVdc({
    name: "my-pvdc",
});
const vm_group = my_vdc.then(my_vdc => vcd.getVmGroup({
    name: "vmware-license-group",
    providerVdcId: my_vdc.id,
}));
Copy
import pulumi
import pulumi_vcd as vcd

my_vdc = vcd.get_provider_vdc(name="my-pvdc")
vm_group = vcd.get_vm_group(name="vmware-license-group",
    provider_vdc_id=my_vdc.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		my_vdc, err := vcd.LookupProviderVdc(ctx, &vcd.LookupProviderVdcArgs{
			Name: "my-pvdc",
		}, nil)
		if err != nil {
			return err
		}
		_, err = vcd.GetVmGroup(ctx, &vcd.GetVmGroupArgs{
			Name:          "vmware-license-group",
			ProviderVdcId: my_vdc.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;

return await Deployment.RunAsync(() => 
{
    var my_vdc = Vcd.GetProviderVdc.Invoke(new()
    {
        Name = "my-pvdc",
    });

    var vm_group = Vcd.GetVmGroup.Invoke(new()
    {
        Name = "vmware-license-group",
        ProviderVdcId = my_vdc.Apply(getProviderVdcResult => getProviderVdcResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetProviderVdcArgs;
import com.pulumi.vcd.inputs.GetVmGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var my-vdc = VcdFunctions.getProviderVdc(GetProviderVdcArgs.builder()
            .name("my-pvdc")
            .build());

        final var vm-group = VcdFunctions.getVmGroup(GetVmGroupArgs.builder()
            .name("vmware-license-group")
            .providerVdcId(my_vdc.id())
            .build());

    }
}
Copy
variables:
  my-vdc:
    fn::invoke:
      function: vcd:getProviderVdc
      arguments:
        name: my-pvdc
  vm-group:
    fn::invoke:
      function: vcd:getVmGroup
      arguments:
        name: vmware-license-group
        providerVdcId: ${["my-vdc"].id}
Copy

Attributes reference

  • cluster_name - Name of the vSphere cluster associated to this VM Group.
  • named_vm_group_id - ID of the named VM Group. Used to create Logical VM Groups.
  • vcenter_id - ID of the vCenter server.
  • cluster_moref - Managed object reference of the vSphere cluster associated to this VM Group.

Using getVmGroup

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getVmGroup(args: GetVmGroupArgs, opts?: InvokeOptions): Promise<GetVmGroupResult>
function getVmGroupOutput(args: GetVmGroupOutputArgs, opts?: InvokeOptions): Output<GetVmGroupResult>
Copy
def get_vm_group(id: Optional[str] = None,
                 name: Optional[str] = None,
                 provider_vdc_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetVmGroupResult
def get_vm_group_output(id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 provider_vdc_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetVmGroupResult]
Copy
func GetVmGroup(ctx *Context, args *GetVmGroupArgs, opts ...InvokeOption) (*GetVmGroupResult, error)
func GetVmGroupOutput(ctx *Context, args *GetVmGroupOutputArgs, opts ...InvokeOption) GetVmGroupResultOutput
Copy

> Note: This function is named GetVmGroup in the Go SDK.

public static class GetVmGroup 
{
    public static Task<GetVmGroupResult> InvokeAsync(GetVmGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetVmGroupResult> Invoke(GetVmGroupInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVmGroupResult> getVmGroup(GetVmGroupArgs args, InvokeOptions options)
public static Output<GetVmGroupResult> getVmGroup(GetVmGroupArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vcd:index/getVmGroup:getVmGroup
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of VM Group to fetch from vSphere.
ProviderVdcId This property is required. string
The ID of Provider VDC to which the VM Group belongs.
Id string
Name This property is required. string
The name of VM Group to fetch from vSphere.
ProviderVdcId This property is required. string
The ID of Provider VDC to which the VM Group belongs.
Id string
name This property is required. String
The name of VM Group to fetch from vSphere.
providerVdcId This property is required. String
The ID of Provider VDC to which the VM Group belongs.
id String
name This property is required. string
The name of VM Group to fetch from vSphere.
providerVdcId This property is required. string
The ID of Provider VDC to which the VM Group belongs.
id string
name This property is required. str
The name of VM Group to fetch from vSphere.
provider_vdc_id This property is required. str
The ID of Provider VDC to which the VM Group belongs.
id str
name This property is required. String
The name of VM Group to fetch from vSphere.
providerVdcId This property is required. String
The ID of Provider VDC to which the VM Group belongs.
id String

getVmGroup Result

The following output properties are available:

ClusterMoref string
ClusterName string
Id string
Name string
NamedVmGroupId string
ProviderVdcId string
VcenterId string
ClusterMoref string
ClusterName string
Id string
Name string
NamedVmGroupId string
ProviderVdcId string
VcenterId string
clusterMoref String
clusterName String
id String
name String
namedVmGroupId String
providerVdcId String
vcenterId String
clusterMoref string
clusterName string
id string
name string
namedVmGroupId string
providerVdcId string
vcenterId string
clusterMoref String
clusterName String
id String
name String
namedVmGroupId String
providerVdcId String
vcenterId String

Package Details

Repository
vcd vmware/terraform-provider-vcd
License
Notes
This Pulumi package is based on the vcd Terraform Provider.