Show / Hide Table of Contents

Class DrsVmOverride

The vsphere..DrsVmOverride resource can be used to add a DRS override to a cluster for a specific virtual machine. With this resource, one can enable or disable DRS and control the automation level for a single virtual machine without affecting the rest of the cluster.

For more information on vSphere clusters and DRS, see this page.

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 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 host = dc.Apply(dc => Output.Create(VSphere.GetHost.InvokeAsync(new VSphere.GetHostArgs
    {
        DatacenterId = dc.Id,
        Name = "esxi1",
    })));
    var network = dc.Apply(dc => Output.Create(VSphere.GetNetwork.InvokeAsync(new VSphere.GetNetworkArgs
    {
        DatacenterId = dc.Id,
        Name = "network1",
    })));
    var vm = new VSphere.VirtualMachine("vm", new VSphere.VirtualMachineArgs
    {
        DatastoreId = datastore.Apply(datastore => datastore.Id),
        Disks = 
        {
            new VSphere.Inputs.VirtualMachineDiskArgs
            {
                Label = "disk0",
                Size = 20,
            },
        },
        GuestId = "other3xLinux64Guest",
        HostSystemId = host.Apply(host => host.Id),
        Memory = 2048,
        NetworkInterfaces = 
        {
            new VSphere.Inputs.VirtualMachineNetworkInterfaceArgs
            {
                NetworkId = network.Apply(network => network.Id),
            },
        },
        NumCpus = 2,
        ResourcePoolId = cluster.Apply(cluster => cluster.ResourcePoolId),
    });
    var drsVmOverride = new VSphere.DrsVmOverride("drsVmOverride", new VSphere.DrsVmOverrideArgs
    {
        ComputeClusterId = cluster.Apply(cluster => cluster.Id),
        DrsEnabled = false,
        VirtualMachineId = vm.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
DrsVmOverride
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
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 class DrsVmOverride : CustomResource

Constructors

View Source

DrsVmOverride(String, DrsVmOverrideArgs, CustomResourceOptions)

Create a DrsVmOverride resource with the given unique name, arguments, and options.

Declaration
public DrsVmOverride(string name, DrsVmOverrideArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

DrsVmOverrideArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ComputeClusterId

The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.

Declaration
public Output<string> ComputeClusterId { get; }
Property Value
Type Description
Output<System.String>
View Source

DrsAutomationLevel

Overrides the automation level for this virtual machine in the cluster. Can be one of manual, partiallyAutomated, or fullyAutomated. Default: manual.

Declaration
public Output<string> DrsAutomationLevel { get; }
Property Value
Type Description
Output<System.String>
View Source

DrsEnabled

Overrides the default DRS setting for this virtual machine. Can be either true or false. Default: false.

Declaration
public Output<bool?> DrsEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

VirtualMachineId

The UUID of the virtual machine to create the override for. Forces a new resource if changed.

Declaration
public Output<string> VirtualMachineId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, DrsVmOverrideState, CustomResourceOptions)

Get an existing DrsVmOverride resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static DrsVmOverride Get(string name, Input<string> id, DrsVmOverrideState 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.

DrsVmOverrideState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
DrsVmOverride
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.