Class StorageDrsVmOverride
The vsphere..StorageDrsVmOverride resource can be used to add a Storage DRS
override to a datastore cluster for a specific virtual machine. With this
resource, one can enable or disable Storage DRS, and control the automation
level and disk affinity for a single virtual machine without affecting the rest
of the datastore cluster.
For more information on vSphere datastore clusters and Storage DRS, see this page.
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 datastoreCluster = dc.Apply(dc => Output.Create(VSphere.GetDatastoreCluster.InvokeAsync(new VSphere.GetDatastoreClusterArgs
{
DatacenterId = dc.Id,
Name = "datastore-cluster1",
})));
var memberDatastore = dc.Apply(dc => Output.Create(VSphere.GetDatastore.InvokeAsync(new VSphere.GetDatastoreArgs
{
DatacenterId = dc.Id,
Name = "datastore-cluster1-member1",
})));
var pool = dc.Apply(dc => Output.Create(VSphere.GetResourcePool.InvokeAsync(new VSphere.GetResourcePoolArgs
{
DatacenterId = dc.Id,
Name = "cluster1/Resources",
})));
var network = dc.Apply(dc => Output.Create(VSphere.GetNetwork.InvokeAsync(new VSphere.GetNetworkArgs
{
DatacenterId = dc.Id,
Name = "public",
})));
var vm = new VSphere.VirtualMachine("vm", new VSphere.VirtualMachineArgs
{
DatastoreId = memberDatastore.Apply(memberDatastore => memberDatastore.Id),
Disks =
{
new VSphere.Inputs.VirtualMachineDiskArgs
{
Label = "disk0",
Size = 20,
},
},
GuestId = "other3xLinux64Guest",
Memory = 1024,
NetworkInterfaces =
{
new VSphere.Inputs.VirtualMachineNetworkInterfaceArgs
{
NetworkId = network.Apply(network => network.Id),
},
},
NumCpus = 2,
ResourcePoolId = pool.Apply(pool => pool.Id),
});
var drsVmOverride = new VSphere.StorageDrsVmOverride("drsVmOverride", new VSphere.StorageDrsVmOverrideArgs
{
DatastoreClusterId = datastoreCluster.Apply(datastoreCluster => datastoreCluster.Id),
SdrsEnabled = false,
VirtualMachineId = vm.Id,
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class StorageDrsVmOverride : CustomResource
Constructors
View SourceStorageDrsVmOverride(String, StorageDrsVmOverrideArgs, CustomResourceOptions)
Create a StorageDrsVmOverride resource with the given unique name, arguments, and options.
Declaration
public StorageDrsVmOverride(string name, StorageDrsVmOverrideArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| StorageDrsVmOverrideArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDatastoreClusterId
The managed object reference ID of the datastore cluster to put the override in. Forces a new resource if changed.
Declaration
public Output<string> DatastoreClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SdrsAutomationLevel
Overrides any Storage DRS automation
levels for this virtual machine. Can be one of automated or manual. When
not specified, the datastore cluster's settings are used according to the
specific SDRS subsystem.
Declaration
public Output<string> SdrsAutomationLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SdrsEnabled
Overrides the default Storage DRS setting for this virtual machine. When not specified, the datastore cluster setting is used.
Declaration
public Output<string> SdrsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SdrsIntraVmAffinity
Overrides the intra-VM affinity setting
for this virtual machine. When true, all disks for this virtual machine
will be kept on the same datastore. When false, Storage DRS may locate
individual disks on different datastores if it helps satisfy cluster
requirements. When not specified, the datastore cluster's settings are used.
Declaration
public Output<string> SdrsIntraVmAffinity { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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 SourceGet(String, Input<String>, StorageDrsVmOverrideState, CustomResourceOptions)
Get an existing StorageDrsVmOverride resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static StorageDrsVmOverride Get(string name, Input<string> id, StorageDrsVmOverrideState 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. |
| StorageDrsVmOverrideState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| StorageDrsVmOverride |