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,
});
}
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
dc = vsphere.get_datacenter(name="dc1")
datastore = vsphere.get_datastore(datacenter_id=dc.id,
name="datastore1")
cluster = vsphere.get_compute_cluster(datacenter_id=dc.id,
name="cluster1")
host = vsphere.get_host(datacenter_id=dc.id,
name="esxi1")
network = vsphere.get_network(datacenter_id=dc.id,
name="network1")
vm = vsphere.VirtualMachine("vm",
datastore_id=datastore.id,
disks=[{
"label": "disk0",
"size": 20,
}],
guest_id="other3xLinux64Guest",
host_system_id=host.id,
memory=2048,
network_interfaces=[{
"networkId": network.id,
}],
num_cpus=2,
resource_pool_id=cluster.resource_pool_id)
drs_vm_override = vsphere.DrsVmOverride("drsVmOverride",
compute_cluster_id=cluster.id,
drs_enabled=False,
virtual_machine_id=vm.id)import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const dc = pulumi.output(vsphere.getDatacenter({
name: "dc1",
}, { async: true }));
const datastore = dc.apply(dc => vsphere.getDatastore({
datacenterId: dc.id,
name: "datastore1",
}, { async: true }));
const cluster = dc.apply(dc => vsphere.getComputeCluster({
datacenterId: dc.id,
name: "cluster1",
}, { async: true }));
const host = dc.apply(dc => vsphere.getHost({
datacenterId: dc.id,
name: "esxi1",
}, { async: true }));
const network = dc.apply(dc => vsphere.getNetwork({
datacenterId: dc.id,
name: "network1",
}, { async: true }));
const vm = new vsphere.VirtualMachine("vm", {
datastoreId: datastore.id,
disks: [{
label: "disk0",
size: 20,
}],
guestId: "other3xLinux64Guest",
hostSystemId: host.id,
memory: 2048,
networkInterfaces: [{
networkId: network.id,
}],
numCpus: 2,
resourcePoolId: cluster.resourcePoolId,
});
const drsVmOverride = new vsphere.DrsVmOverride("drs_vm_override", {
computeClusterId: cluster.id,
drsEnabled: false,
virtualMachineId: vm.id,
});Create a DrsVmOverride Resource
new DrsVmOverride(name: string, args: DrsVmOverrideArgs, opts?: CustomResourceOptions);def DrsVmOverride(resource_name, opts=None, compute_cluster_id=None, drs_automation_level=None, drs_enabled=None, virtual_machine_id=None, __props__=None);func NewDrsVmOverride(ctx *Context, name string, args DrsVmOverrideArgs, opts ...ResourceOption) (*DrsVmOverride, error)public DrsVmOverride(string name, DrsVmOverrideArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DrsVmOverrideArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DrsVmOverrideArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DrsVmOverrideArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DrsVmOverride Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DrsVmOverride resource accepts the following input properties:
- Compute
Cluster stringId The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- Virtual
Machine stringId The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- Drs
Automation stringLevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- Drs
Enabled bool Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.
- Compute
Cluster stringId The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- Virtual
Machine stringId The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- Drs
Automation stringLevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- Drs
Enabled bool Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.
- compute
Cluster stringId The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- virtual
Machine stringId The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- drs
Automation stringLevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- drs
Enabled boolean Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.
- compute_
cluster_ strid The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- virtual_
machine_ strid The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- drs_
automation_ strlevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- drs_
enabled bool Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.
Outputs
All input properties are implicitly available as output properties. Additionally, the DrsVmOverride resource produces the following output properties:
Look up an Existing DrsVmOverride Resource
Get an existing DrsVmOverride resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DrsVmOverrideState, opts?: CustomResourceOptions): DrsVmOverridestatic get(resource_name, id, opts=None, compute_cluster_id=None, drs_automation_level=None, drs_enabled=None, virtual_machine_id=None, __props__=None);func GetDrsVmOverride(ctx *Context, name string, id IDInput, state *DrsVmOverrideState, opts ...ResourceOption) (*DrsVmOverride, error)public static DrsVmOverride Get(string name, Input<string> id, DrsVmOverrideState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Compute
Cluster stringId The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- Drs
Automation stringLevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- Drs
Enabled bool Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.- Virtual
Machine stringId The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- Compute
Cluster stringId The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- Drs
Automation stringLevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- Drs
Enabled bool Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.- Virtual
Machine stringId The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- compute
Cluster stringId The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- drs
Automation stringLevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- drs
Enabled boolean Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.- virtual
Machine stringId The UUID of the virtual machine to create the override for. Forces a new resource if changed.
- compute_
cluster_ strid The managed object reference ID of the cluster to put the override in. Forces a new resource if changed.
- drs_
automation_ strlevel Overrides the automation level for this virtual machine in the cluster. Can be one of
manual,partiallyAutomated, orfullyAutomated. Default:manual.- drs_
enabled bool Overrides the default DRS setting for this virtual machine. Can be either
trueorfalse. Default:false.- virtual_
machine_ strid The UUID of the virtual machine to create the override for. Forces a new resource if changed.
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphereTerraform Provider.