vsphere.VirtualDisk
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc-01",
});
const datastore = vsphere.getDatacenter({
name: "datastore-01",
});
const virtualDisk = new vsphere.VirtualDisk("virtual_disk", {
size: 40,
type: "thin",
vmdkPath: "/foo/foo.vmdk",
createDirectories: true,
datacenter: datacenter.then(datacenter => datacenter.name),
datastore: datastoreVsphereDatastore.name,
});
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
datastore = vsphere.get_datacenter(name="datastore-01")
virtual_disk = vsphere.VirtualDisk("virtual_disk",
size=40,
type="thin",
vmdk_path="/foo/foo.vmdk",
create_directories=True,
datacenter=datacenter.name,
datastore=datastore_vsphere_datastore["name"])
package main
import (
"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
_, err = vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("datastore-01"),
}, nil)
if err != nil {
return err
}
_, err = vsphere.NewVirtualDisk(ctx, "virtual_disk", &vsphere.VirtualDiskArgs{
Size: pulumi.Int(40),
Type: pulumi.String("thin"),
VmdkPath: pulumi.String("/foo/foo.vmdk"),
CreateDirectories: pulumi.Bool(true),
Datacenter: pulumi.String(datacenter.Name),
Datastore: pulumi.Any(datastoreVsphereDatastore.Name),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
return await Deployment.RunAsync(() =>
{
var datacenter = VSphere.GetDatacenter.Invoke(new()
{
Name = "dc-01",
});
var datastore = VSphere.GetDatacenter.Invoke(new()
{
Name = "datastore-01",
});
var virtualDisk = new VSphere.VirtualDisk("virtual_disk", new()
{
Size = 40,
Type = "thin",
VmdkPath = "/foo/foo.vmdk",
CreateDirectories = true,
Datacenter = datacenter.Apply(getDatacenterResult => getDatacenterResult.Name),
Datastore = datastoreVsphereDatastore.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.VirtualDisk;
import com.pulumi.vsphere.VirtualDiskArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("dc-01")
.build());
final var datastore = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("datastore-01")
.build());
var virtualDisk = new VirtualDisk("virtualDisk", VirtualDiskArgs.builder()
.size(40)
.type("thin")
.vmdkPath("/foo/foo.vmdk")
.createDirectories(true)
.datacenter(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.name()))
.datastore(datastoreVsphereDatastore.name())
.build());
}
}
resources:
virtualDisk:
type: vsphere:VirtualDisk
name: virtual_disk
properties:
size: 40
type: thin
vmdkPath: /foo/foo.vmdk
createDirectories: true
datacenter: ${datacenter.name}
datastore: ${datastoreVsphereDatastore.name}
variables:
datacenter:
fn::invoke:
Function: vsphere:getDatacenter
Arguments:
name: dc-01
datastore:
fn::invoke:
Function: vsphere:getDatacenter
Arguments:
name: datastore-01
Create VirtualDisk Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualDisk(name: string, args: VirtualDiskArgs, opts?: CustomResourceOptions);
@overload
def VirtualDisk(resource_name: str,
args: VirtualDiskArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualDisk(resource_name: str,
opts: Optional[ResourceOptions] = None,
datastore: Optional[str] = None,
size: Optional[int] = None,
vmdk_path: Optional[str] = None,
adapter_type: Optional[str] = None,
create_directories: Optional[bool] = None,
datacenter: Optional[str] = None,
type: Optional[str] = None)
func NewVirtualDisk(ctx *Context, name string, args VirtualDiskArgs, opts ...ResourceOption) (*VirtualDisk, error)
public VirtualDisk(string name, VirtualDiskArgs args, CustomResourceOptions? opts = null)
public VirtualDisk(String name, VirtualDiskArgs args)
public VirtualDisk(String name, VirtualDiskArgs args, CustomResourceOptions options)
type: vsphere:VirtualDisk
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VirtualDiskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VirtualDiskArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VirtualDiskArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualDiskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualDiskArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var virtualDiskResource = new VSphere.VirtualDisk("virtualDiskResource", new()
{
Datastore = "string",
Size = 0,
VmdkPath = "string",
CreateDirectories = false,
Datacenter = "string",
Type = "string",
});
example, err := vsphere.NewVirtualDisk(ctx, "virtualDiskResource", &vsphere.VirtualDiskArgs{
Datastore: pulumi.String("string"),
Size: pulumi.Int(0),
VmdkPath: pulumi.String("string"),
CreateDirectories: pulumi.Bool(false),
Datacenter: pulumi.String("string"),
Type: pulumi.String("string"),
})
var virtualDiskResource = new VirtualDisk("virtualDiskResource", VirtualDiskArgs.builder()
.datastore("string")
.size(0)
.vmdkPath("string")
.createDirectories(false)
.datacenter("string")
.type("string")
.build());
virtual_disk_resource = vsphere.VirtualDisk("virtualDiskResource",
datastore="string",
size=0,
vmdk_path="string",
create_directories=False,
datacenter="string",
type="string")
const virtualDiskResource = new vsphere.VirtualDisk("virtualDiskResource", {
datastore: "string",
size: 0,
vmdkPath: "string",
createDirectories: false,
datacenter: "string",
type: "string",
});
type: vsphere:VirtualDisk
properties:
createDirectories: false
datacenter: string
datastore: string
size: 0
type: string
vmdkPath: string
VirtualDisk Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VirtualDisk resource accepts the following input properties:
- Datastore string
- The name of the datastore in which to create the disk.
- Size int
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- Vmdk
Path string - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
. - Adapter
Type string The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- Create
Directories bool Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- Datacenter string
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- Type string
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here.
- Datastore string
- The name of the datastore in which to create the disk.
- Size int
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- Vmdk
Path string - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
. - Adapter
Type string The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- Create
Directories bool Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- Datacenter string
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- Type string
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here.
- datastore String
- The name of the datastore in which to create the disk.
- size Integer
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- vmdk
Path String - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
. - adapter
Type String The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create
Directories Boolean Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter String
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- type String
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here.
- datastore string
- The name of the datastore in which to create the disk.
- size number
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- vmdk
Path string - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
. - adapter
Type string The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create
Directories boolean Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter string
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- type string
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here.
- datastore str
- The name of the datastore in which to create the disk.
- size int
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- vmdk_
path str - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
. - adapter_
type str The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create_
directories bool Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter str
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- type str
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here.
- datastore String
- The name of the datastore in which to create the disk.
- size Number
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- vmdk
Path String - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
. - adapter
Type String The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create
Directories Boolean Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter String
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- type String
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualDisk resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing VirtualDisk Resource
Get an existing VirtualDisk 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?: VirtualDiskState, opts?: CustomResourceOptions): VirtualDisk
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
adapter_type: Optional[str] = None,
create_directories: Optional[bool] = None,
datacenter: Optional[str] = None,
datastore: Optional[str] = None,
size: Optional[int] = None,
type: Optional[str] = None,
vmdk_path: Optional[str] = None) -> VirtualDisk
func GetVirtualDisk(ctx *Context, name string, id IDInput, state *VirtualDiskState, opts ...ResourceOption) (*VirtualDisk, error)
public static VirtualDisk Get(string name, Input<string> id, VirtualDiskState? state, CustomResourceOptions? opts = null)
public static VirtualDisk get(String name, Output<String> id, VirtualDiskState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Adapter
Type string The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- Create
Directories bool Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- Datacenter string
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- Datastore string
- The name of the datastore in which to create the disk.
- Size int
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- Type string
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here. - Vmdk
Path string - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
.
- Adapter
Type string The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- Create
Directories bool Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- Datacenter string
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- Datastore string
- The name of the datastore in which to create the disk.
- Size int
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- Type string
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here. - Vmdk
Path string - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
.
- adapter
Type String The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create
Directories Boolean Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter String
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- datastore String
- The name of the datastore in which to create the disk.
- size Integer
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- type String
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here. - vmdk
Path String - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
.
- adapter
Type string The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create
Directories boolean Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter string
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- datastore string
- The name of the datastore in which to create the disk.
- size number
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- type string
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here. - vmdk
Path string - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
.
- adapter_
type str The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create_
directories bool Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter str
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- datastore str
- The name of the datastore in which to create the disk.
- size int
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- type str
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here. - vmdk_
path str - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
.
- adapter
Type String The adapter type for this virtual disk. Can be one of
ide
,lsiLogic
, orbusLogic
. Default:lsiLogic
.NOTE:
adapter_type
is deprecated: it does not dictate the type of controller that the virtual disk will be attached to on the virtual machine. Please see thescsi_type
parameter in thevsphere.VirtualMachine
resource for information on how to control disk controller types. This parameter will be removed in future versions of the vSphere provider.- create
Directories Boolean Tells the resource to create any directories that are a part of the
vmdk_path
parameter if they are missing. Default:false
.NOTE: Any directory created as part of the operation when
create_directories
is enabled will not be deleted when the resource is destroyed.- datacenter String
- The name of the datacenter in which to create the disk. Can be omitted when ESXi or if there is only one datacenter in your infrastructure.
- datastore String
- The name of the datastore in which to create the disk.
- size Number
- Size of the disk (in GB). Decreasing the size of a disk is not possible. If a disk of a smaller size is required then the original has to be destroyed along with its data and a new one has to be created.
- type String
- The type of disk to create. Can be one of
eagerZeroedThick
,lazy
, orthin
. Default:eagerZeroedThick
. For information on what each kind of disk provisioning policy means, click here. - vmdk
Path String - The path, including filename, of the virtual disk to
be created. This needs to end in
.vmdk
.
Import
An existing virtual disk can be imported into this resource
via supplying the full datastore path to the virtual disk. An example is below:
$ pulumi import vsphere:index/virtualDisk:VirtualDisk virtual_disk \
‘{“virtual_disk_path”: “/dc-01/[datastore-01]foo/bar.vmdk”, \ “create_directories”: “true”}’
The above would import the virtual disk located at foo/bar.vmdk
in the datastore-01
datastore of the dc-01
datacenter with create_directories
set as true
.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphere
Terraform Provider.