Class VirtualDisk
The vsphere..VirtualDisk resource can be used to create virtual disks outside
of any given vsphere..VirtualMachine
resource. These disks can be attached to a virtual machine by creating a disk
block with the attach parameter.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var myDisk = new VSphere.VirtualDisk("myDisk", new VSphere.VirtualDiskArgs
{
Datacenter = "Datacenter",
Datastore = "local",
Size = 2,
Type = "thin",
VmdkPath = "myDisk.vmdk",
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class VirtualDisk : CustomResource
Constructors
View SourceVirtualDisk(String, VirtualDiskArgs, CustomResourceOptions)
Create a VirtualDisk resource with the given unique name, arguments, and options.
Declaration
public VirtualDisk(string name, VirtualDiskArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| VirtualDiskArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAdapterType
The adapter type for this virtual disk. Can be
one of ide, lsiLogic, or busLogic. Default: lsiLogic.
Declaration
public Output<string> AdapterType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreateDirectories
Tells the resource to create any
directories that are a part of the vmdk_path parameter if they are missing.
Default: false.
Declaration
public Output<bool?> CreateDirectories { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Datacenter
The name of the datacenter in which to create the disk. Can be omitted when when ESXi or if there is only one datacenter in your infrastructure.
Declaration
public Output<string> Datacenter { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Datastore
The name of the datastore in which to create the disk.
Declaration
public Output<string> Datastore { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Size
Size of the disk (in GB).
Declaration
public Output<int> Size { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Type
The type of disk to create. Can be one of
eagerZeroedThick, lazy, or thin. Default: eagerZeroedThick. For
information on what each kind of disk provisioning policy means, click
[here][docs-vmware-vm-disk-provisioning].
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VmdkPath
The path, including filename, of the virtual disk to
be created. This needs to end in .vmdk.
Declaration
public Output<string> VmdkPath { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, VirtualDiskState, CustomResourceOptions)
Get an existing VirtualDisk resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static VirtualDisk Get(string name, Input<string> id, VirtualDiskState 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. |
| VirtualDiskState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| VirtualDisk |