Show / Hide Table of Contents

Class GetVirtualMachine

Inheritance
System.Object
GetVirtualMachine
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public static class GetVirtualMachine

Methods

View Source

InvokeAsync(GetVirtualMachineArgs, InvokeOptions)

The vsphere..VirtualMachine data source can be used to find the UUID of an existing virtual machine or template. Its most relevant purpose is for finding the UUID of a template to be used as the source for cloning into a new vsphere..VirtualMachine resource. It also reads the guest ID so that can be supplied as well.

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using VSphere = Pulumi.VSphere;

class MyStack : Stack
{
public MyStack()
{
    var datacenter = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
    {
        Name = "dc1",
    }));
    var template = datacenter.Apply(datacenter => Output.Create(VSphere.GetVirtualMachine.InvokeAsync(new VSphere.GetVirtualMachineArgs
    {
        DatacenterId = datacenter.Id,
        Name = "test-vm-template",
    })));
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetVirtualMachineResult> InvokeAsync(GetVirtualMachineArgs args, InvokeOptions options = null)
Parameters
Type Name Description
GetVirtualMachineArgs args
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetVirtualMachineResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.