UNPKG

@pulumi/vsphere

Version:

A Pulumi package for creating vsphere resources

248 lines (247 loc) • 11.3 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = vsphere.getDatastore({ * 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: datastore.then(datastore => datastore.name), * }); * ``` * * ## 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: * * [docs-import]: https://developer.hashicorp.com/terraform/cli/import * * ```sh * $ 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`. */ export declare class VirtualDisk extends pulumi.CustomResource { /** * Get an existing VirtualDisk resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualDiskState, opts?: pulumi.CustomResourceOptions): VirtualDisk; /** * Returns true if the given object is an instance of VirtualDisk. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is VirtualDisk; /** * The adapter type for this virtual disk. Can be * one of `ide`, `lsiLogic`, or `busLogic`. Default: `lsiLogic`. * * > **NOTE:** `adapterType` is **deprecated**: it does not dictate the type of * controller that the virtual disk will be attached to on the virtual machine. * Please see the `scsiType` parameter * in the `vsphere.VirtualMachine` resource for information on how to control * disk controller types. This parameter will be removed in future versions of the * vSphere provider. * * @deprecated this attribute has no effect on controller types - please use scsiType in vsphere.VirtualMachine instead */ readonly adapterType: pulumi.Output<string | undefined>; /** * Tells the resource to create any * directories that are a part of the `vmdkPath` parameter if they are missing. * Default: `false`. * * > **NOTE:** Any directory created as part of the operation when * `createDirectories` is enabled will not be deleted when the resource is * destroyed. */ readonly createDirectories: pulumi.Output<boolean | undefined>; /** * 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. */ readonly datacenter: pulumi.Output<string | undefined>; /** * The name of the datastore in which to create the * disk. */ readonly datastore: pulumi.Output<string>; /** * 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. */ readonly size: pulumi.Output<number>; /** * 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]. * * [docs-vmware-vm-disk-provisioning]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-single-host-management-vmware-host-client-8-0/virtual-machine-management-with-the-vsphere-host-client-vSphereSingleHostManagementVMwareHostClient/configuring-virtual-machines-in-the-vsphere-host-client-vSphereSingleHostManagementVMwareHostClient/virtual-disk-configuration-vSphereSingleHostManagementVMwareHostClient/about-virtual-disk-provisioning-policies-vSphereSingleHostManagementVMwareHostClient.html */ readonly type: pulumi.Output<string | undefined>; /** * The path, including filename, of the virtual disk to * be created. This needs to end in `.vmdk`. */ readonly vmdkPath: pulumi.Output<string>; /** * Create a VirtualDisk resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: VirtualDiskArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VirtualDisk resources. */ export interface VirtualDiskState { /** * The adapter type for this virtual disk. Can be * one of `ide`, `lsiLogic`, or `busLogic`. Default: `lsiLogic`. * * > **NOTE:** `adapterType` is **deprecated**: it does not dictate the type of * controller that the virtual disk will be attached to on the virtual machine. * Please see the `scsiType` parameter * in the `vsphere.VirtualMachine` resource for information on how to control * disk controller types. This parameter will be removed in future versions of the * vSphere provider. * * @deprecated this attribute has no effect on controller types - please use scsiType in vsphere.VirtualMachine instead */ adapterType?: pulumi.Input<string>; /** * Tells the resource to create any * directories that are a part of the `vmdkPath` parameter if they are missing. * Default: `false`. * * > **NOTE:** Any directory created as part of the operation when * `createDirectories` is enabled will not be deleted when the resource is * destroyed. */ createDirectories?: pulumi.Input<boolean>; /** * 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. */ datacenter?: pulumi.Input<string>; /** * The name of the datastore in which to create the * disk. */ datastore?: pulumi.Input<string>; /** * 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. */ size?: pulumi.Input<number>; /** * 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]. * * [docs-vmware-vm-disk-provisioning]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-single-host-management-vmware-host-client-8-0/virtual-machine-management-with-the-vsphere-host-client-vSphereSingleHostManagementVMwareHostClient/configuring-virtual-machines-in-the-vsphere-host-client-vSphereSingleHostManagementVMwareHostClient/virtual-disk-configuration-vSphereSingleHostManagementVMwareHostClient/about-virtual-disk-provisioning-policies-vSphereSingleHostManagementVMwareHostClient.html */ type?: pulumi.Input<string>; /** * The path, including filename, of the virtual disk to * be created. This needs to end in `.vmdk`. */ vmdkPath?: pulumi.Input<string>; } /** * The set of arguments for constructing a VirtualDisk resource. */ export interface VirtualDiskArgs { /** * The adapter type for this virtual disk. Can be * one of `ide`, `lsiLogic`, or `busLogic`. Default: `lsiLogic`. * * > **NOTE:** `adapterType` is **deprecated**: it does not dictate the type of * controller that the virtual disk will be attached to on the virtual machine. * Please see the `scsiType` parameter * in the `vsphere.VirtualMachine` resource for information on how to control * disk controller types. This parameter will be removed in future versions of the * vSphere provider. * * @deprecated this attribute has no effect on controller types - please use scsiType in vsphere.VirtualMachine instead */ adapterType?: pulumi.Input<string>; /** * Tells the resource to create any * directories that are a part of the `vmdkPath` parameter if they are missing. * Default: `false`. * * > **NOTE:** Any directory created as part of the operation when * `createDirectories` is enabled will not be deleted when the resource is * destroyed. */ createDirectories?: pulumi.Input<boolean>; /** * 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. */ datacenter?: pulumi.Input<string>; /** * The name of the datastore in which to create the * disk. */ datastore: pulumi.Input<string>; /** * 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. */ size: pulumi.Input<number>; /** * 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]. * * [docs-vmware-vm-disk-provisioning]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-single-host-management-vmware-host-client-8-0/virtual-machine-management-with-the-vsphere-host-client-vSphereSingleHostManagementVMwareHostClient/configuring-virtual-machines-in-the-vsphere-host-client-vSphereSingleHostManagementVMwareHostClient/virtual-disk-configuration-vSphereSingleHostManagementVMwareHostClient/about-virtual-disk-provisioning-policies-vSphereSingleHostManagementVMwareHostClient.html */ type?: pulumi.Input<string>; /** * The path, including filename, of the virtual disk to * be created. This needs to end in `.vmdk`. */ vmdkPath: pulumi.Input<string>; }