import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * The `vsphere.VirtualMachine` resource is used to manage the lifecycle of a virtual machine. * * For details on working with virtual machines in VMware vSphere, please refer to the [product documentation][vmware-docs-vm-management]. * * [vmware-docs-vm-management]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-virtual-machine-administration-guide-8-0.html * * ## About Working with Virtual Machines in Terraform * * A high degree of control and flexibility is available to a vSphere administrator to configure, deploy, and manage virtual machines. The Terraform provider enables you to manage the desired state of virtual machine resources. * * This section provides information on configurations you should consider when setting up virtual machines, creating templates for cloning, and more. * * ### Disks * * The `vsphere.VirtualMachine` resource supports standard VMDK-backed virtual disks. It **does not** support raw device mappings (RDMs) to proxy use of raw physical storage device * * Disks are managed by a label supplied to the `label` attribute in a `disk` block. This is separate from the automatic naming that vSphere assigns when a virtual machine is created. Control of the name for a virtual disk is not supported unless you are attaching an external disk with the `attach` attribute. * * Virtual disks can be SCSI, SATA, NVMe or IDE. The storage controllers managed by the Terraform provider can vary, depending on the value supplied to `scsiControllerCount`, `sataControllerCount`, `nvmeControllerCount`, or `ideControllerCount`. This also dictates the controllers that are checked when looking for disks during a cloning process. SCSI controllers are all configured with the controller type defined by the `scsiType` setting. If you are cloning from a template, devices will be added or re-configured as necessary. * * When cloning from a template, you must specify disks of either the same or greater size than the disks in the source template or the same size when cloning from a snapshot (also known as a linked clone). * * See the section on Creating a Virtual Machine from a Template for more information. * * ### Customization and Network Waiters * * Terraform waits during various parts of a virtual machine deployment to ensure that the virtual machine is in an expected state before proceeding. These events occur when a virtual machine is created or updated, depending on the waiter. * * The waiters include the following: * * * **Customization Waiter**: * * This waiter watches events in vSphere to monitor when customization on a virtual machine completes during creation. Depending on your vSphere or virtual machine configuration, it may be necessary to change the timeout or turn off the waiter. This can be controlled by using the `timeout` setting in the customization settings block. * * * **Network Waiter**: * * This waiter waits for interfaces to appear on a virtual machine guest operating system and occurs close to the end of both virtual machine creation and update. This waiter ensures that the IP information gets reported to the guest operating system, mainly to facilitate the availability of a valid, reachable default IP address for any provisioners. * * The behavior of the waiter can be controlled with the `waitForGuestNetTimeout`, `waitForGuestNetRoutable`, `waitForGuestIpTimeout`, and `ignoredGuestIps` settings. * * ## Example Usage * * ### Creating a Virtual Machine * * The following block contains the option necessary to create a virtual machine, with a single disk and network interface. * * In this example, the resource makes use of the following data sources: * * * [`vsphere.Datacenter`][tf-vsphere-datacenter] to locate the datacenter, * * * [`vsphere.getDatastore`][tf-vsphere-datastore] to locate the default datastore to place the virtual machine files, * * * [`vsphere_compute-cluster`][tf-vsphere-compute-cluster] to locate a resource pool located in a cluster or standalone host, and * * * [`vsphere.getNetwork`][tf-vsphere-network] to locate the network. * * [tf-vsphere-datacenter]: /docs/providers/vsphere/d/datacenter.html * [tf-vsphere-datastore]: /docs/providers/vsphere/d/datastore.html * [tf-vsphere-compute-cluster]: /docs/providers/vsphere/d/compute-cluster.html * [tf-vsphere-network]: /docs/providers/vsphere/d/network.html * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "VM Network", * datacenterId: datacenter.id, * })); * const vm = new vsphere.VirtualMachine("vm", { * name: "foo", * resourcePoolId: cluster.then(cluster => cluster.resourcePoolId), * datastoreId: datastore.then(datastore => datastore.id), * numCpus: 1, * memory: 1024, * guestId: "otherLinux64Guest", * networkInterfaces: [{ * networkId: network.then(network => network.id), * }], * disks: [{ * label: "Hard Disk 1", * size: 20, * }], * }); * ``` * * ### Cloning and Customization * * Building on the above example, the below configuration creates a virtual machine by cloning it from a template, fetched using the [`vsphere.VirtualMachine`][tf-vsphere-virtual-machine-ds] data source. This option allows you to locate the UUID of the template to clone, along with settings for network interface type, SCSI bus type, and disk attributes. * * [tf-vsphere-virtual-machine-ds]: /docs/providers/vsphere/d/virtual_machine.html * * > **NOTE:** Cloning requires vCenter Server and is not supported on direct ESXi host connections. * * **Examples**: * * This example clones a Linux template and customizes with the provided settings: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "VM Network", * datacenterId: datacenter.id, * })); * const template = datacenter.then(datacenter => vsphere.getVirtualMachine({ * name: "linux-template", * datacenterId: datacenter.id, * })); * const vm = new vsphere.VirtualMachine("vm", { * name: "foo", * resourcePoolId: cluster.then(cluster => cluster.resourcePoolId), * datastoreId: datastore.then(datastore => datastore.id), * numCpus: 1, * memory: 1024, * guestId: template.then(template => template.guestId), * scsiType: template.then(template => template.scsiType), * networkInterfaces: [{ * networkId: network.then(network => network.id), * adapterType: template.then(template => template.networkInterfaceTypes?.[0]), * }], * disks: [{ * label: "Hard Disk 1", * size: template.then(template => template.disks?.[0]?.size), * thinProvisioned: template.then(template => template.disks?.[0]?.thinProvisioned), * }], * clone: { * templateUuid: template.then(template => template.id), * customize: { * linuxOptions: { * hostName: "foo", * domain: "example.com", * }, * }, * }, * }); * ``` * * This example uses the same structure as the previous example, but customizes with an existing guest customization specification: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * // ... other configuration ... * const linux = vsphere.getGuestOsCustomization({ * name: "linux", * }); * const vm = new vsphere.VirtualMachine("vm", { * templateUuid: template.id, * customizationSpec: [{ * id: linux.then(linux => linux.id), * }], * }); * ``` * * ### Deploying Virtual Machines from OVF/OVA * * Virtual machines can be deployed from OVF/OVA using either the local path and remote URL and the `ovfDeploy` property. When deploying from a local path, the path to the OVF/OVA must be provided. While deploying OVF, all other necessary files (_e.g._ `.vmdk`, `.mf`, etc) must be present in the same directory as the `.ovf` file. * * > **NOTE:** The vApp properties which are pre-defined in an OVF template can be overwritten. New vApp properties can not be created for an existing OVF template. * * > **NOTE:** An OVF/OVA deployment requires vCenter Server and is not supported on direct ESXi host connections. * * The following example demonstrates a scenario deploying a simple OVF/OVA, using both the local path and remote URL options. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const _default = Promise.all([cluster, datacenter]).then(([cluster, datacenter]) => vsphere.getResourcePool({ * name: std.index.format({ * input: "%s%s", * args: [ * cluster.name, * "/Resources", * ], * }).result, * datacenterId: datacenter.id, * })); * const host = datacenter.then(datacenter => vsphere.getHost({ * name: "esxi-01.example.com", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "172.16.11.0", * datacenterId: datacenter.id, * })); * //# Deployment of VM from Remote OVF * const vmFromRemoteOvf = new vsphere.VirtualMachine("vmFromRemoteOvf", { * name: "remote-foo", * datacenterId: datacenter.then(datacenter => datacenter.id), * datastoreId: datastore.then(datastore => datastore.i), * resourcePoolId: _default.then(_default => _default.id), * waitForGuestNetTimeout: 0, * waitForGuestIpTimeout: 0, * ovfDeploy: { * allowUnverifiedSslCert: false, * remoteOvfUrl: "https://example.com/foo.ova", * diskProvisioning: "thin", * ipProtocol: "IPV4", * ipAllocationPolicy: "STATIC_MANUAL", * ovfNetworkMap: { * "Network 1": network.then(network => network.id), * "Network 2": network.then(network => network.id), * }, * }, * vapp: { * properties: { * "guestinfo.hostname": "remote-foo.example.com", * "guestinfo.ipaddress": "172.16.11.101", * "guestinfo.netmask": "255.255.255.0", * "guestinfo.gateway": "172.16.11.1", * "guestinfo.dns": "172.16.11.4", * "guestinfo.domain": "example.com", * "guestinfo.ntp": "ntp.example.com", * "guestinfo.password": "VMware1!", * "guestinfo.ssh": "True", * }, * }, * }); * //# Deployment of VM from Local OVF * const vmFromLocalOvf = new vsphere.VirtualMachine("vmFromLocalOvf", { * name: "local-foo", * datacenterId: datacenter.then(datacenter => datacenter.id), * datastoreId: datastore.then(datastore => datastore.id), * resourcePoolId: _default.then(_default => _default.id), * waitForGuestNetTimeout: 0, * waitForGuestIpTimeout: 0, * ovfDeploy: { * allowUnverifiedSslCert: false, * localOvfPath: "/Volume/Storage/OVAs/foo.ova", * diskProvisioning: "thin", * ipProtocol: "IPV4", * ipAllocationPolicy: "STATIC_MANUAL", * ovfNetworkMap: { * "Network 1": network.then(network => network.id), * "Network 2": network.then(network => network.id), * }, * }, * vapp: { * properties: { * "guestinfo.hostname": "local-foo.example.com", * "guestinfo.ipaddress": "172.16.11.101", * "guestinfo.netmask": "255.255.255.0", * "guestinfo.gateway": "172.16.11.1", * "guestinfo.dns": "172.16.11.4", * "guestinfo.domain": "example.com", * "guestinfo.ntp": "ntp.example.com", * "guestinfo.password": "VMware1!", * "guestinfo.ssh": "True", * }, * }, * }); * ``` * * In some scenarios, the Terraform provider may attempt to apply only the default settings. A virtual machine deployed directly from an OVF/OVA may not match the OVF specification. For example, if the `scsiType` option is not included in a `vsphere.VirtualMachine` resource, the provider will apply a default value of `pvscsi` and the virtual machine may not boot. In this scenario, use the `vsphere.getOvfVmTemplate` data source to parse the OVF properties and use the property value as parameters for the `vsphere.VirtualMachine` resource. * * The following example demonstrates a scenario deploying a nested ESXi host from an OVF/OVA, using the remote URL and local path options. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const _default = Promise.all([cluster, datacenter]).then(([cluster, datacenter]) => vsphere.getResourcePool({ * name: std.index.format({ * input: "%s%s", * args: [ * cluster.name, * "/Resources", * ], * }).result, * datacenterId: datacenter.id, * })); * const host = datacenter.then(datacenter => vsphere.getHost({ * name: "esxi-01.example.com", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "172.16.11.0", * datacenterId: datacenter.id, * })); * //# Remote OVF/OVA Source * const ovfRemote = Promise.all([_default, datastore, network]).then(([_default, datastore, network]) => vsphere.getOvfVmTemplate({ * name: "ubuntu-xx.xx-server-cloudimg-amd64.ova", * diskProvisioning: "thin", * resourcePoolId: _default.id, * datastoreId: datastore.id, * remoteOvfUrl: "https://cloud-images.ubuntu.com/releases/xx.xx/release/ubuntu-xx.xx-server-cloudimg-amd64.ova", * ovfNetworkMap: { * "VM Network": network.id, * }, * })); * //# Local OVF/OVA Source * const ovfLocal = Promise.all([_default, datastore, network]).then(([_default, datastore, network]) => vsphere.getOvfVmTemplate({ * name: "ubuntu-xx.xx-server-cloudimg-amd64.ova", * diskProvisioning: "thin", * resourcePoolId: _default.id, * datastoreId: datastore.id, * localOvfPath: "/Volume/Storage/OVA/ubuntu-xx-xx-server-cloudimg-amd64.ova", * ovfNetworkMap: { * "VM Network": network.id, * }, * })); * //# Deployment of VM from Remote OVF * const vmFromRemoteOvf = new vsphere.VirtualMachine("vmFromRemoteOvf", { * networkInterfaces: .map(entry => ({ * networkId: entry.value, * })), * name: "ubuntu-server-cloud-image-01", * datacenterId: datacenter.then(datacenter => datacenter.id), * datastoreId: datastore.then(datastore => datastore.id), * resourcePoolId: _default.then(_default => _default.id), * numCpus: ovfRemote.then(ovfRemote => ovfRemote.numCpus), * numCoresPerSocket: ovfRemote.then(ovfRemote => ovfRemote.numCoresPerSocket), * memory: ovfRemote.then(ovfRemote => ovfRemote.memory), * guestId: ovfRemote.then(ovfRemote => ovfRemote.guestId), * firmware: ovfRemote.then(ovfRemote => ovfRemote.firmware), * scsiType: ovfRemote.then(ovfRemote => ovfRemote.scsiType), * waitForGuestNetTimeout: 0, * waitForGuestIpTimeout: 0, * ovfDeploy: { * remoteOvfUrl: "https://cloud-images.ubuntu.com/releases/xx.xx/release/ubuntu-xx.xx-server-cloudimg-amd64.ova", * ovfNetworkMap: ovfRemote.then(ovfRemote => ovfRemote.ovfNetworkMap), * }, * cdroms: [{ * clientDevice: true, * }], * vapp: { * properties: { * hostname: remoteOvfName, * "instance-id": remoteOvfUuid, * "public-keys": remoteOvfPublicKeys, * password: remoteOvfPassword, * "user-data": std.index.base64encode({ * input: remoteOvfUserData, * }).result, * }, * }, * }); * //# Deployment of VM from Local OVF * const vmFromLocalOvf = new vsphere.VirtualMachine("vmFromLocalOvf", { * networkInterfaces: .map(entry => ({ * networkId: entry.value, * })), * name: "ubuntu-server-cloud-image-02", * datacenterId: datacenter.then(datacenter => datacenter.id), * datastoreId: datastore.then(datastore => datastore.id), * resourcePoolId: _default.then(_default => _default.id), * numCpus: ovfLocal.then(ovfLocal => ovfLocal.numCpus), * numCoresPerSocket: ovfLocal.then(ovfLocal => ovfLocal.numCoresPerSocket), * memory: ovfLocal.then(ovfLocal => ovfLocal.memory), * guestId: ovfLocal.then(ovfLocal => ovfLocal.guestId), * firmware: ovfLocal.then(ovfLocal => ovfLocal.firmware), * scsiType: ovfLocal.then(ovfLocal => ovfLocal.scsiType), * waitForGuestNetTimeout: 0, * waitForGuestIpTimeout: 0, * ovfDeploy: { * allowUnverifiedSslCert: false, * localOvfPath: ovfLocal.then(ovfLocal => ovfLocal.localOvfPath), * diskProvisioning: ovfLocal.then(ovfLocal => ovfLocal.diskProvisioning), * ovfNetworkMap: ovfLocal.then(ovfLocal => ovfLocal.ovfNetworkMap), * }, * cdroms: [{ * clientDevice: true, * }], * vapp: { * properties: { * hostname: localOvfName, * "instance-id": localOvfUuid, * "public-keys": localOvfPublicKeys, * password: localOvfPassword, * "user-data": std.index.base64encode({ * input: localOvfUserData, * }).result, * }, * }, * }); * ``` * * ### Cloning from an OVF/OVA with vApp Properties * * This alternate example illustrates how to clone a virtual machine from a template that originated from an OVF/OVA. This leverages the resource's vApp properties capabilities to set appropriate keys that control various configuration settings on the virtual machine or virtual appliance. In this scenario, using `customize` is not recommended as the functionality tends to overlap. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastore = datacenter.then(datacenter => vsphere.getDatastore({ * name: "datastore-01", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const _default = Promise.all([cluster, datacenter]).then(([cluster, datacenter]) => vsphere.getResourcePool({ * name: std.index.format({ * input: "%s%s", * args: [ * cluster.name, * "/Resources", * ], * }).result, * datacenterId: datacenter.id, * })); * const host = datacenter.then(datacenter => vsphere.getHost({ * name: "esxi-01.example.com", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "172.16.11.0", * datacenterId: datacenter.id, * })); * const templateFromOvf = datacenter.then(datacenter => vsphere.getVirtualMachine({ * name: "ubuntu-server-template-from-ova", * datacenterId: datacenter.id, * })); * const vm = new vsphere.VirtualMachine("vm", { * name: "foo", * resourcePoolId: cluster.then(cluster => cluster.resourcePoolId), * datastoreId: datastore.then(datastore => datastore.id), * numCpus: 2, * memory: 1024, * guestId: template.guestId, * scsiType: template.scsiType, * networkInterfaces: [{ * networkId: network.then(network => network.id), * adapterType: template.networkInterfaceTypes[0], * }], * disks: [{ * name: "Hard Disk 1", * size: templateFromOvf.then(templateFromOvf => templateFromOvf.disks?.[0]?.size), * thinProvisioned: templateFromOvf.then(templateFromOvf => templateFromOvf.disks?.[0]?.thinProvisioned), * }], * clone: { * templateUuid: templateFromOvf.then(templateFromOvf => templateFromOvf.id), * }, * vapp: { * properties: { * "guestinfo.hostname": "foo.example.com", * "guestinfo.ipaddress": "172.16.11.101", * "guestinfo.netmask": "255.255.255.0", * "guestinfo.gateway": "172.16.11.1", * "guestinfo.dns": "172.16.11.4", * "guestinfo.domain": "example.com", * "guestinfo.ntp": "ntp.example.com", * "guestinfo.password": "VMware1!", * "guestinfo.ssh": "True", * }, * }, * }); * ``` * * ### Using vSphere Storage DRS * * The `vsphere.VirtualMachine` resource also supports vSphere Storage DRS, allowing the assignment of virtual machines to datastore clusters. When assigned to a datastore cluster, changes to a virtual machine's underlying datastores are ignored unless disks drift outside of the datastore cluster. Note that the [`vsphere.DatastoreCluster`][tf-vsphere-datastore-cluster-resource] resource also exists to allow for management of datastore clusters using the Terraform provider. * * The following example demonstrates the use of the [`vsphere.DatastoreCluster`] data source[tf-vsphere-datastore-cluster-data-source], and the `datastoreClusterId` configuration setting. * * [tf-vsphere-datastore-cluster-resource]: /docs/providers/vsphere/r/datastore_cluster.html * [tf-vsphere-datastore-cluster-data-source]: /docs/providers/vsphere/d/datastore_cluster.html * * > **NOTE:** When managing datastore clusters, member datastores, and virtual machines within the same Terraform configuration, race conditions can apply. This is because datastore clusters must be created before datastores can be assigned to them, and the respective `vsphere.VirtualMachine` resources will no longer have an implicit dependency on the specific datastore resources. Use [`dependsOn`][tf-docs-depends-on] to create an explicit dependency on the datastores in the cluster, or manage datastore clusters and datastores in a separate configuration. * * [tf-docs-depends-on]: /docs/configuration/resources.html#depends_on * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const datacenter = vsphere.getDatacenter({ * name: "dc-01", * }); * const datastoreCluster = datacenter.then(datacenter => vsphere.getDatastoreCluster({ * name: "datastore-cluster-01", * datacenterId: datacenter.id, * })); * const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({ * name: "cluster-01", * datacenterId: datacenter.id, * })); * const network = datacenter.then(datacenter => vsphere.getNetwork({ * name: "VM Network", * datacenterId: datacenter.id, * })); * const vm = new vsphere.VirtualMachine("vm", { * name: "foo", * resourcePoolId: cluster.then(cluster => cluster.resourcePoolId), * datastoreClusterId: datastoreCluster.then(datastoreCluster => datastoreCluster.id), * numCpus: 1, * memory: 1024, * guestId: "otherLinux64Guest", * networkInterfaces: [{ * networkId: network.then(network => network.id), * }], * disks: [{ * label: "Hard Disk 1", * size: 20, * }], * }); * ``` * * ## Creating a Virtual Machine from a Template * * The `clone` block can be used to create a new virtual machine from an existing virtual machine or template. The resource supports both making a complete copy of a virtual machine, or cloning from a snapshot (also known as a linked clone). * * See the section on cloning and customization for more information. * * > **NOTE:** Changing any option in `clone` after creation forces a new resource. * * > **NOTE:** Cloning requires vCenter Server and is not supported on direct ESXi host connections. * * The options available in the `clone` block are: * * * `templateUuid` - (Required) The UUID of the source virtual machine or template. * * * `linkedClone` - (Optional) Clone the virtual machine from a snapshot or a template. Default: `false`. * * * `timeout` - (Optional) The timeout, in minutes, to wait for the cloning process to complete. Default: 30 minutes. * * * `customize` - (Optional) The customization spec for this clone. This allows the user to configure the virtual machine post-clone. For more details, see virtual machine customizations. * * ### Virtual Machine Customizations * * As part of the `clone` operation, a virtual machine can be [customized][vmware-docs-customize] to configure host, network, or licensing settings. * * [vmware-docs-customize]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-virtual-machine-administration-guide-8-0/managing-virtual-machinesvsphere-vm-admin/customizing-guest-operating-systemsvsphere-vm-admin.html * * To perform virtual machine customization as a part of the clone process, * specify the `customize` block with the respective customization options, nested within the `clone` block. Windows guests are customized using Sysprep, which will result in the machine SID being reset. Before using customization, check is that your source virtual machine meets the [requirements](https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-virtual-machine-administration-guide-8-0/managing-virtual-machinesvsphere-vm-admin/customizing-guest-operating-systemsvsphere-vm-admin.html) for guest OS customization on vSphere. See the section on cloning and customization for a usage synopsis. * * The settings for `customize` are as follows: * * #### Customization Timeout Settings * * * `timeout` - (Optional) The time, in minutes, that the provider waits for customization to complete before failing. The default is `10` minutes. Setting the value to `0` or a negative value disables the waiter. * * #### Network Interface Settings * * These settings, which should be specified in nested `networkInterface` blocks within `customize` block, configure network interfaces on a per-interface basis and are matched up to `networkInterface` devices in the order declared. * * Static IP Address Example: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", { * networkInterfaces: [ * { * networkId: _public.id, * }, * { * networkId: _private.id, * }, * ], * clone: { * customize: { * networkInterfaces: [ * { * ipv4Address: "10.0.0.10", * ipv4Netmask: 24, * }, * { * ipv4Address: "172.16.0.10", * ipv4Netmask: 24, * }, * ], * ipv4Gateway: "10.0.0.1", * }, * }, * }); * ``` * * The first `networkInterface` would be assigned to the `public` interface, and the second to the `private` interface. * * To use DHCP, declare an empty `networkInterface` block for each interface. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", { * networkInterfaces: [ * { * networkId: _public.id, * }, * { * networkId: _private.id, * }, * ], * clone: { * customize: { * networkInterfaces: [ * {}, * {}, * ], * }, * }, * }); * ``` * * The options are: * * * `dnsServerList` - (Optional) DNS servers for the network interface. Used by Windows guest operating systems, but ignored by Linux distribution guest operating systems. For Linux, please refer to the section on the global DNS settings. * * * `dnsDomain` - (Optional) DNS search domain for the network interface. Used by Windows guest operating systems, but ignored by Linux distribution guest operating systems. For Linux, please refer to the section on the global DNS settings. * * * `ipv4Address` - (Optional) The IPv4 address assigned to the network adapter. If blank or not included, DHCP is used. * * * `ipv4Netmask` The IPv4 subnet mask, in bits (_e.g._ `24` for 255.255.255.0). * * * `ipv6Address` - (Optional) The IPv6 address assigned to the network adapter. If blank or not included, auto-configuration is used. * * * `ipv6Netmask` - (Optional) The IPv6 subnet mask, in bits (_e.g._ `32`). * * > **NOTE:** The minimum setting for IPv4 in a customization specification is DHCP. If you are setting up an IPv6-exclusive network without DHCP, you may need to set `waitForGuestNetTimeout` to a high enough value to cover the DHCP timeout of your virtual machine, or disable by supplying a zero or negative value. Disabling `waitForGuestNetTimeout` may result in IP addresses not being reported to any provisioners you may have configured on the resource. * * #### Global Routing Settings * * Virtual machine customization for the `vsphere.VirtualMachine` resource does not take a per-interface gateway setting. Default routes are configured on a global basis. See the section on network interface settings for more information. * * The settings must match the IP address and netmask of at least one `networkInterface` supplied to customization. * * The options are: * * * `ipv4Gateway` - (Optional) The IPv4 default gateway when using `networkInterface` customization on the virtual machine. * * * `ipv6Gateway` - (Optional) The IPv6 default gateway when using `networkInterface` customization on the virtual machine. * * #### Global DNS Settings * * The following settings configure DNS globally, generally for Linux distribution guest operating systems. For Windows guest operating systems, this is performer per-interface. See the section on network interface settings for more information. * * * `dnsServerList` - The list of DNS servers to configure on the virtual machine. * * * `dnsSuffixList` - A list of DNS search domains to add to the DNS configuration on the virtual machine. * * #### Linux Customization Options * * The settings in the `linuxOptions` block pertain to Linux distribution guest operating system customization. If you are customizing a Linux guest operating system, this section must be included. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", {clone: { * customize: { * linuxOptions: { * hostName: "foo", * domain: "example.com", * }, * }, * }}); * ``` * * The options are: * * * `hostName` - (Required) The host name for this machine. This, along with `domain`, make up the FQDN of the virtual machine. * * * `domain` - (Required) The domain name for this machine. This, along with `hostName`, make up the FQDN of the virtual machine. * * * `hwClockUtc` - (Optional) Tells the operating system that the hardware clock is set to UTC. Default: `true`. * * * `scriptText` - (Optional) The customization script for the virtual machine that will be applied before and / or after guest customization. For more information on enabling and using a customization script, please refer to [VMware KB 74880][kb-74880]. The [Heredoc style][tf-heredoc-strings] of string literal is recommended. * * [kb-74880]: https://knowledge.broadcom.com/external/article?articleNumber=313048 * [tf-heredoc-strings]: https://www.terraform.io/language/expressions/strings#heredoc-strings * * * `timeZone` - (Optional) Sets the time zone. For a list of possible combinations, please refer to [VMware KB 2145518][kb-2145518]. The default is UTC. * * [kb-2145518]: https://knowledge.broadcom.com/external/article?articleNumber=320212 * * #### Windows Customization Options * * The settings in the `windowsOptions` block pertain to Windows guest OS customization. If you are customizing a Windows operating system, this section must be included. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", {clone: { * customize: { * windowsOptions: { * computerName: "foo", * workgroup: "BAR", * adminPassword: "VMware1!", * }, * }, * }}); * ``` * * The options are: * * * `computerName` - (Required) The computer name of the virtual machine. * * * `adminPassword` - (Optional) The administrator password for the virtual machine. * * > **NOTE:** `adminPassword` is a sensitive field and will not be output on-screen, but is stored in state and sent to the virtual machine in plain text. * * * `workgroup` - (Optional) The workgroup name for the virtual machine. One of this or `joinDomain` must be included. * * * `joinDomain` - (Optional) The domain name in which to join the virtual machine. One of this or `workgroup` must be included. * * * `domainOu` - (Optional) The `MachineObjectOU` which specifies the full LDAP path name of the OU to which the virtual machine belongs (_e.g._, OU=bar,OU=foo,DC=example,DC=com"). * * > **NOTE:** `domainOu` is only available on vSphere 8.0 Update 2 and later. * * > **NOTE:** `domainOu` must **not** contain a spaces in the `MachineObjectOU` path (_e.g._, OU=foo bar,DC=example,DC=com"). * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", {clone: { * customize: { * windowsOptions: { * domainOu: "OU=bar,OU=foo,DC=example,DC=com", * }, * }, * }}); * ``` * * * `domainAdminUser` - (Optional) The user account with administrative privileges to use to join the guest operating system to the domain. Required if setting `joinDomain`. * * * `domainAdminPassword` - (Optional) The password user account with administrative privileges used to join the virtual machine to the domain. Required if setting `joinDomain`. * * > **NOTE:** `domainAdminPassword` is a sensitive field and will not be output on-screen, but is stored in state and sent to the virtual machine in plain text * * * `fullName` - (Optional) The full name of the organization owner of the virtual machine. This populates the "user" field in the general Windows system information. Default: `Administrator`. * * * `organizationName` - (Optional) The name of the organization for the virtual machine. This option populates the "organization" field in the general Windows system information. Default: `Managed by Terraform`. * * * `productKey` - (Optional) The product key for the virtual machine Windows guest operating system. The default is no key. * * * `runOnceCommandList` - (Optional) A list of commands to run at first user logon, after guest customization. Each run once command is limited by the API to 260 characters. * * * `autoLogon` - (Optional) Specifies whether or not the virtual machine automatically logs on as Administrator. Default: `false`. * * * `autoLogonCount` - (Optional) Specifies how many times the virtual machine should auto-logon the Administrator account when `autoLogon` is `true`. This option should be set accordingly to ensure that all of your commands that run in `runOnceCommandList` can log in to run. Default: `1`. * * * `timeZone` - (Optional) The time zone for the virtual machine. For a list of supported codes, please refer to the [MIcrosoft documentation][ms-docs-valid-sysprep-tzs]. The default is `85` (GMT/UTC). * * [ms-docs-valid-sysprep-tzs]: https://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx * * ### Using vApp Properties for OVF/OVA Configuration * * You can use the `properties` section of the `vapp` block to supply configuration parameters to a virtual machine cloned from a template that originated from an imported OVF/OVA file. Both GuestInfo and ISO transport methods are supported. * * For templates that use ISO transport, a CD-ROM backed by a client device must be included. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", { * clone: { * templateUuid: templateFromOvf.id, * }, * cdroms: [{ * clientDevice: true, * }], * vapp: { * properties: { * [terraform.id]: "foo", * }, * }, * }); * ``` * * See the section on CD-ROM options for more information. * * > **NOTE:** The only supported usage path for vApp properties is for existing user-configurable keys. These generally come from an existing template created by importing an OVF or OVA file. You cannot set values for vApp properties on virtual machines created from scratch, virtual machines lacking a vApp configuration, or on property keys that do not exist. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", { * clone: { * templateUuid: templateFromOvf.id, * }, * vapp: { * properties: { * [terraform.id]: "foo", * }, * }, * }); * ``` * * The vApp Properties for some OVF/OVA may require boolean values. * * In Terraform a boolean is defined as `bool` with a value of either `true` or `false`. * * **Example**: A boolean variable type for the Terraform provider configuration. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * * const config = new pulumi.Config(); * // Allow insecure connections. Set to `true` for self-signed certificates. * const vsphereInsecure = config.getBoolean("vsphereInsecure") || false; * ``` * * However, for OVF properties, even though the type is boolean, the vApp Options in vSphere only accepts the values of `"True"` or `"False"`. * * In these instances, it is recommended to define the variable as a string and pass the value in title case. * * **Example**: A string variable for to pass to an OVF/OVA boolean OVF property. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const config = new pulumi.Config(); * // Enable SSH on the virtual appliance. One of `True` or `False`. * const sshEnabled = config.get("sshEnabled") || "False"; * const vm = new vsphere.VirtualMachine("vm", {vapp: { * properties: { * ssh_enabled: sshEnabled, * }, * }}); * ``` * * ### Additional Requirements for Cloning * * When cloning from a template, there are additional requirements in both the resource configuration and source template: * * * The virtual machine must not be powered on at the time of cloning. * * All disks on the virtual machine must be SCSI disks. * * You must specify at least the same number of `disk` devices as there are disks that exist in the template. These devices are ordered and lined up by the `unitNumber` attribute. Additional disks can be added past this. * * The `size` of a virtual disk must be at least the same size as its counterpart disk in the source template. * * When using `linkedClone`, the `size`, `thinProvisioned`, and `eagerlyScrub` settings for each disk must be an exact match to the individual disk's counterpart in the source template. * * The storage controller count settings should be configured as necessary to cover all of the disks on the template. For best results, only configure this setting for the number of controllers you will need to cover your disk quantity and bandwidth needs, and configure your template accordingly. For most workloads, this setting should be kept at the default of `1` SCSI controller, and all disks in the template should reside on the single, primary controller. * * Some operating systems do not respond well to a change in disk controller type. Ensure that `scsiType` is set to an exact match of the template's controller set. For maximum compatibility, make sure the SCSI controllers on the source template are all the same type. * * You can use the [`vsphere.VirtualMachine`][tf-vsphere-virtual-machine-ds] data source, which provides disk attributes, network interface types, SCSI bus types, and the guest ID of the source template, to return this information. See the section on cloning and customization for more information. * * ## Trusted Platform Module * * When creating a virtual machine or cloning one from a template, you have the option to add a virtual Trusted Platform Module device. Refer to the requirements in the VMware vSphere [product documentation](https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-virtual-machine-administration-guide-8-0/configuring-virtual-machine-hardwarevsphere-vm-admin/securing-virtual-machines-with-virtual-trusted-platform-modulevsphere-vm-admin/vtpm-overviewvsphere-vm-admin.html). * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", {vtpm: { * version: "2.0", * }}); * ``` * * > **NOTE:** Supported versions include 1.2 or 2.0. * * ## Virtual Machine Migration * * The `vsphere.VirtualMachine` resource supports live migration both on the host and storage level. You can migrate the virtual machine to another host, cluster, resource pool, or datastore. You can also migrate or pin a virtual disk to a specific datastore. * * ### Host, Cluster, and Resource Pool Migration * * To migrate the virtual machine to another host or resource pool, change the `hostSystemId` or `resourcePoolId` to the managed object IDs of the new host or resource pool. To change the virtual machine's cluster or standalone host, select a resource pool within the specific target. * * The same rules apply for migration as they do for virtual machine creation - any host specified must contribute the resource pool supplied. When moving a virtual machine to a resource pool in another cluster (or standalone host), ensure that all hosts in the cluster (or the single standalone host) have access to the datastore on which the virtual machine is placed. * * ### Storage Migration * * Storage migration can be done on two levels: * * * Global datastore migration can be handled by changing the global `datastoreId` attribute. This triggers a storage migration for all disks that do not have an explicit `datastoreId` specified. * * When using Storage DRS through the `datastoreClusterId` attribute, the entire virtual machine can be migrated from one datastore cluster to another by changing the value of this setting. In addition, when `datastoreClusterId` is in use, any disks that drift to datastores outside of the datastore cluster via such actions as manual modification will be migrated back to the datastore cluster on the next apply. * * An individual `disk` device can be migrated by manually specifying the `datastoreId` in its configuration block. This also pins it to the specific datastore that is specified - if at a later time the virtual machine and any unpinned disks migrate to another host, the disk will stay on the specified datastore. * * An example of datastore pinning is below. As long as the datastore in the `pinnedDatastore` data source does not change, any change to the standard `vmDatastore` data source will not affect the data disk - the disk will stay where it is. * * **Example**: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vsphere from "@pulumi/vsphere"; * * const vm = new vsphere.VirtualMachine("vm", { * datastoreId: vmDatastore.id, * disks: [ * { * label: "Hard Disk 1", * size: 10, * }, * { * datastoreId: pinnedDatastore.id, * label: "Hard Disk 2", * size: 100, * unitNumber: 1, * }, * ], * }); * ``` * * #### Storage Migration Restrictions * * You cannot migrate external disks added with the `attach` parameter. Typically, these disks are created and assigned to a datastore outside the scope of the `vsphere.VirtualMachine` resource. For example, using the [`vsphere.VirtualDisk`][tf-vsphere-virtual-disk] resource, management of the disks would render their configuration unstable. * * [tf-vsphere-virtual-disk]: /docs/providers/vsphere/r/virtual_disk.html * * ## Virtual Machine Reboot * * The virtual machine will be rebooted if any of the following parameters are changed: * * * `alternateGuestName` * * `cpuHotAddEnabled` * * `cpuHotRemoveEnabled` * * `cpuPerformanceCountersEnabled` * * `disk.controller_type` * * `disk.unit_number` * * `disk.disk_mode` * * `disk.write_through` * * `disk.disk_sharing` * * `efiSecureBootEnabled` * * `eptRviMode` * * `enableDiskUuid` * * `enableLogging` * * `extraConfig` * * `firmware` * * `guestId` * * `hardwareVersion` * * `hvMode` * * `memory` - When reducing the memory size, or when increasing the memory size and `memoryHotAddEnabled` is set to `false` * * `memoryHotAddEnabled` * * `nestedHvEnabled` * * `networkInterface` - When deleting a network interface and VMware Tools is not running. * * `network_interface.adapter_type` - When VMware Tools is not running. * * `numCoresPerSocket` * * `pciDeviceId` * * `runToolsScriptsAfterPowerOn` * * `runToolsScriptsAfterResume` * * `runToolsScriptsBeforeGuestStandby` * * `runToolsScriptsBeforeGuestShutdown` * * `runToolsScriptsBeforeGuestReboot` * * `swapPlacementPolicy` * * `toolsUpgradePolicy` * * `vbsEnabled` * * `vvtdEnabled` * * `vtpm` * * ## Migrating from a Previous Version of the Resource * * > **NOTE:** This section only applies this resource available in v0.4.2 or earlier of this provider. * * The path for migrating to the current version of this resource is very similar to the import path; however, with the exception that the `pulumi import` command does not need to be run. See that section for details on what is required before you run `pulumi preview` on a provider resource that must be migrated. * * A successful migration usually only results in a configuration-only diff - that is, Terraform reconciles the configuration settings that can not be set during the migration process with he Terraform state. In this event, no reconfiguration operations are sent to vSphere during the next `pulumi up`. For more information, see the importing section. * * ## Import * * An existing virtual machine can be imported into the Terraform state by providing the full path to the virtual machine. * * [docs-import]: /docs/import/index.html * * **Examples**: * * Import a virtual machine resource named `foo` located in the `dc-01` datacenter. * * ```sh * $ pulumi import vsphere:index/virtualMachine:VirtualMachine vm /dc-01/vm/foo * ``` * * > **NOTE:** The `vm` portion of the path is required by vSphere. If the virtual machine is located in a folder, the folder path needs to be included. This is because vSphere organizes virtual machines within a datacenter under the `vm` folder, and any additional folders created within the `vm` folder must be included in the path. * * If the virtual machine `foo` is in a folder named `bar`, the import command would be: * * ```sh * $ pulumi import vsphere:index/virtualMachine:VirtualMachine vm /dc-01/vm/bar/foo * ``` * * ### Additional Importing Requirements * * Many of the requirements for cloning apply to importing. Although importing writes directly to the Terraform state, some rules can not be enforced during import time, so every effort should be made to ensure the correctness of the configuration before the import. * * The following requirements apply to import: * * * The disks must have a `label` argument assigned in a convention matching `Hard Disk`, starting with disk number 0, based on each virtual disk order on the SCSI bus. As an example, a disk on SCSI controller `0` with a unit number of `0` would be labeled as `Hard Disk 0`, a disk on the same controller with a unit number of `1` would be `Hard Disk 1`, but the next disk, which is on SCSI controller `1` with a unit number of `0`, still becomes `Hard Disk 2`. * * > **NOTE:** Any custom `label` set at deployment of machine through Terraform, on import will not have the custom `label` and will default to `Hard Disk _x_`. * * * Disks are always imported with `keepOnRemove` enabled until the first `pulumi up` run which will remove the setting for known disks. This process safeguards against naming or accounting mistakes in the disk configuration. * * * The storage controller count for the resource is set to the number of contiguous storage controllers found, starting with the controller at SCSI bus number `0`. If no storage controllers are discovered, the virtual machine is not eligible for import. For maximum compatibility, ensure that the virtual machine has the exact number of storage controllers needed and set the storage controller count accordingly. * * After importing, you should run `pulumi preview`. Unless you have changed anything else in the configuration that would cause other attributes to change. The only difference should be configuration-only changes, which are typically comprised of: * * * The `imported` flag will transition from `true` to `false`. * * * The `keepOnRemove` of known disks will transition from `true` to `false`. * * * Configuration supplied in the `clone` block, if present, will be persisted to state. This initial persistence operation does not perform any cloning or customization actions, nor does it force a new resource. After the first apply operation, further changes to `clone` will force the creation of a new resource. * * > **NOTE:** Do not make any configuration changes to `clone` after importing or upgrading from a legacy version of the provider before doing an initial `pulumi up` as these changes will not correctly force a new resource and your changes will have persisted to state, preventing further plans from correctly triggering a diff. * * These changes only update Terraform state when applied. Hence, it is safe to run when the virtual machine is running. If more settings are modified, you may need to plan maintenance accordingly for any necessary virtual machine re-configurations. */ export declare class VirtualMachine extends pulumi.CustomResource { /** * Get an existing VirtualMachine 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, state?: VirtualMachineState, opts?: pulumi.CustomResourceOptions): VirtualMachine; /** * Returns true if the given object is an instance of VirtualMachine. 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 VirtualMachine; /** * The guest name for the operating system when guestId is otherGuest or otherGuest64. */ readonly alternateGuestName: pulumi.Output; /** * User-provided description of the virtual machine. */ readonly annotation: pulumi.Output; /** * The number of milliseconds to wait before starting the boot sequence. */ readonly bootDelay: pulumi.Output; /** * The number of milliseconds to wait before retrying the boot sequence. This only valid if bootRetryEnabled is true. */ readonly bootRetryDelay: pulumi.Output; /** * If set to true, a virtual machine that fails to boot will try again after the delay defined in boot_retry_delay. */ readonly bootRetryEnabled: pulumi.Output; /** * A specification for a CDROM device on this virtual machine. */ readonly cdroms: pulumi.Output; /** * A unique identifier for a given version of the last configuration was applied. */ readonly changeVersion: pulumi.Output; /** * A specification for cloning a virtual machine from template. */ readonly clone: pulumi.Output; /** * Allow CPUs to be added to this virtual machine while it is running. */ readonly cpuHotAddEnabled: pulumi.Output; /** * Allow CPUs to be added to this virtual machine while it is running. */ readonly cpuHotRemoveEnabled: pulumi.Output; /** * The maximum amount of memory (in MB) or CPU (in MHz) that this virtual machine can consume, regardless of available resources. */ readonly cpuLimit: pulumi.Output; /** * Enable CPU performance counters on this virtual machine. */ readonly cpuPerformanceCountersEnabled: pulumi.Output; /** * The amount of memory (in MB) or CPU (in MHz) that this virtual machine is guaranteed. */ readonly cpuReservation: pulumi.Output; /** * The amount of shares to allocate to cpu for a custom share level. */ readonly cpuShareCount: pulumi.Output; /** * The allocation level for cpu resources. Can be one of high, low, normal, or custom. */ readonly cpuShareLevel: pulumi.Output; /** * A list of custom attributes to set on this resource. */ readonly customAttributes: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The ID of the datacenter where the VM is to be created. */ readonly datacenterId: pulumi.Output; /** * The ID of a datastore cluster to put the virtual machine in. */ readonly datastoreClusterId: pulumi.Output; /** * The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores. */ readonly datastoreId: pulumi.Output; /** * The IP address selected by Terraform to be used with any provisioners configured on this resource. When possible, this is the first IPv4 address that is reachable through the default gateway configured on the machine, then the first reachable IPv6 address, and then the first general discovered address if neither exists. If VMware Tools is not running on the virtual machine, or if the virtual machine is powered off, this value will be blank. */ readonly defaultIpAddress: pulumi.Output; /** * A specification for a virtual disk device on this virtual machine. */ readonly disks: pulumi.Output; /** * When the boot type set in firmware is efi, this enables EFI secure boot. */ readonly efiSecureBootEnabled: pulumi.Output; /** * Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. */ readonly enableDiskUuid: pulumi.Output; /** * Enable logging on this virtual machine. */ readonly enableLogging: pulumi.Output; /** * The EPT/RVI (hardware memory virtualization) setting for this virtual machine. Can be one of automatic, on, or off. */ readonly eptRviMode: pulumi.Output; /** * Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata, or configuration data for OVF images. */ readonly extraConfig: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Allow the virtual machine to be rebooted when a change to `extraConfig` occurs. */ readonly extraConfigRebootRequired: pulumi.Output; /** * The firmware interface to use on the virtual machine. Can be one of bios or efi. */ readonly firmware: pulumi.Output; /** * The name of the folder to locate the virtual machine in. */ readonly folder: pulumi.Output; /** * Set to true to force power-off a virtual machine if a graceful guest shutdown failed for a necessary operation. */ readonly forcePowerOff: pulumi.Output; /** * The guest ID for the operating system. */ readonly guestId: pulumi.Output; /** * The current list of IP addresses on this machine, including the value of `defaultIpAddress`. If VMware Tools is not running on the virtual machine, or if the virtual machine is powered off, this list will be empty. */ readonly guestIpAddresses: pulumi.Output; /** * The hardware version for the virtual machine. Allows versions within ranges: 4, 7-11, 13-15, 17-22. */ readonly hardwareVersion: pulumi.Output; /** * The ID of an optional host system to pin the virtual machine to. */ readonly hostSystemId: pulumi.Output; /** * The (non-nested) hardware virtualization setting for this virtual machine. Can be one of hvAuto, hvOn, or hvOff. */ readonly hvMode: pulumi.Output; /** * The number of IDE controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ readonly ideControllerCount: pulumi.Output; /** * List of IP addresses and CIDR networks to ignore while waiting for an IP */ readonly ignoredGuestIps: pulumi.Output; /** * Indicates if the virtual machine resource has been imported, or if the state has been migrated from a previous version of the resource. It influences the behavior of the first post-import apply operation. See the section on importing below. */ readonly imported: pulumi.Output; /** * Controls the scheduling delay of the virtual machine. Use a higher sensitivity for applications that require lower latency, such as VOIP, media player applications, or applications that require frequent access to mouse or keyboard devices. Can be one of low, normal, medium, or high. */ readonly latencySensitivity: pulumi.Output; /** * The size of the virtual machine's memory, in MB. */ readonly memory: pulumi.Output; /** * Allow memory to be added to this virtual machine while it is running. */ readonly memoryHotAddEnabled: pulumi.Output; /** * The maximum amount of memory (in MB) or CPU (in MHz) that this virtual machine can consume, regardless of available resources. */ readonly memoryLimit: pulumi.Output; /** * The amount of memory (in MB) or CPU (in MHz) that this virtual machine is guaranteed. */ readonly memoryReservation: pulumi.Output; /** * If set true, memory resource reservation for this virtual machine will always be equal to the virtual machine's memory size;increases in memory size will be rejected when a corresponding reservation increase is not possible. This feature may only be enabled if it is currently possible to reserve all of the virtual machine's memory. */ readonly memoryReservationLockedToMax: pulumi.Output; /** * The amount of shares to allocate to memory for a custom share level. */ readonly memoryShareCount: pulumi.Output; /** * The allocation level for memory resources. Can be one of high, low, normal, or custom. */ readonly memoryShareLevel: pulumi.Output; /** * The amount of time, in minutes, to wait for a vMotion operation to complete before failing. */ readonly migrateWaitTimeout: pulumi.Output; /** * The [managed object reference ID][docs-about-morefs] of the created virtual machine. */ readonly moid: pulumi.Output; /** * The name of this virtual machine. */ readonly name: pulumi.Output; /** * Enable nested hardware virtualization on this virtual machine, facilitating nested virtualization in the guest. */ readonly nestedHvEnabled: pulumi.Output; /** * A specification for a virtual NIC on this virtual machine. */ readonly networkInterfaces: pulumi.Output; /** * The number of cores to distribute amongst the CPUs in this virtual machine. If specified, the value supplied to numCpus must be evenly divisible by this value. */ readonly numCoresPerSocket: pulumi.Output; /** * The number of virtual processors to assign to this virtual machine. */ readonly numCpus: pulumi.Output; /** * The number of NVMe controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ readonly nvmeControllerCount: pulumi.Output; /** * A specification for deploying a virtual machine from ovf/ova template. */ readonly ovfDeploy: pulumi.Output; /** * A list of PCI passthrough devices */ readonly pciDeviceIds: pulumi.Output; /** * A computed value for the current power state of the virtual machine. One of `on`, `off`, or `suspended`. */ readonly powerState: pulumi.Output; /** * The amount of time, in seconds, that we will be trying to power on a VM */ readonly poweronTimeout: pulumi.Output; /** * Value internal to Terraform used to determine if a configuration set change requires a reboot. This value is most useful during an update process and gets reset on refresh. */ readonly rebootRequired: pulumi.Output; /** * Triggers replacement of resource whenever it changes. */ readonly replaceTrigger: pulumi.Output; /** * The ID of a resource pool to put the virtual machine in. */ readonly resourcePoolId: pulumi.Output; /** * Enable the run of scripts after virtual machine power-on when VMware Tools is installed. */ readonly runToolsScriptsAfterPowerOn: pulumi.Output; /** * Enable the run of scripts after virtual machine resume when when VMware Tools is installed. */ readonly runToolsScriptsAfterResume: pulumi.Output; /** * Enable the run of scripts before guest operating system reboot when VMware Tools is installed. */ readonly runToolsScriptsBeforeGuestReboot: pulumi.Output; /** * Enable the run of scripts before guest operating system shutdown when VMware Tools is installed. */ readonly runToolsScriptsBeforeGuestShutdown: pulumi.Output; /** * Enable the run of scripts before guest operating system standby when VMware Tools is installed. */ readonly runToolsScriptsBeforeGuestStandby: pulumi.Output; /** * The number of SATA controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ readonly sataControllerCount: pulumi.Output; /** * Mode for sharing the SCSI bus. The modes are physicalSharing, virtualSharing, and noSharing. */ readonly scsiBusSharing: pulumi.Output; /** * The number of SCSI controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ readonly scsiControllerCount: pulumi.Output; /** * The type of SCSI bus this virtual machine will have. Can be one of lsilogic, lsilogic-sas or pvscsi. */ readonly scsiType: pulumi.Output; /** * The amount of time, in minutes, to wait for shutdown when making necessary updates to the virtual machine. */ readonly shutdownWaitTimeout: pulumi.Output; /** * The ID of the storage policy to assign to the virtual machine home directory. */ readonly storagePolicyId: pulumi.Output; /** * The swap file placement policy for this virtual machine. Can be one of inherit, hostLocal, or vmDirectory. */ readonly swapPlacementPolicy: pulumi.Output; /** * Enable guest clock synchronization with the host. On vSphere 7.0 U1 and above, with only this setting the clock is synchronized on startup and resume. Requires VMware Tools to be installed. */ readonly syncTimeWithHost: pulumi.Output; /** * Enable periodic clock synchronization with the host. Supported only on vSphere 7.0 U1 and above. On prior versions setting `syncTimeWithHost` is enough for periodic synchronization. Requires VMware Tools to be installed. */ readonly syncTimeWithHostPeriodically: pulumi.Output; /** * A list of tag IDs to apply to this object. */ readonly tags: pulumi.Output; /** * Set the upgrade policy for VMware Tools. Can be one of `manual` or `upgradeAtPowerCycle`. */ readonly toolsUpgradePolicy: pulumi.Output; /** * The UUID of the virtual machine. Also exposed as the `id` of the resource. */ readonly uuid: pulumi.Output; /** * vApp configuration data for this virtual machine. Can be used to provide configuration data for OVF images. */ readonly vapp: pulumi.Output; /** * Computed value which is only valid for cloned virtual machines. A list of vApp transport methods supported by the source virtual machine or template. */ readonly vappTransports: pulumi.Output; /** * Flag to specify if Virtualization-based security is enabled for this virtual machine. */ readonly vbsEnabled: pulumi.Output; /** * The state of VMware Tools in the guest. This will determine the proper course of action for some device operations. */ readonly vmwareToolsStatus: pulumi.Output; /** * The path of the virtual machine configuration file on the datastore in which the virtual machine is placed. */ readonly vmxPath: pulumi.Output; /** * A specification for a virtual Trusted Platform Module (TPM) device on the virtual machine. */ readonly vtpm: pulumi.Output; /** * Flag to specify if I/O MMU virtualization, also called Intel Virtualization Technology for Directed I/O (VT-d) and AMD I/O Virtualization (AMD-Vi or IOMMU), is enabled. */ readonly vvtdEnabled: pulumi.Output; /** * The amount of time, in minutes, to wait for an available IP address on this virtual machine. A value less than 1 disables the waiter. */ readonly waitForGuestIpTimeout: pulumi.Output; /** * Controls whether or not the guest network waiter waits for a routable address. When false, the waiter does not wait for a default gateway, nor are IP addresses checked against any discovered default gateways as part of its success criteria. */ readonly waitForGuestNetRoutable: pulumi.Output; /** * The amount of time, in minutes, to wait for an available IP address on this virtual machine. A value less than 1 disables the waiter. */ readonly waitForGuestNetTimeout: pulumi.Output; /** * Create a VirtualMachine 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: VirtualMachineArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VirtualMachine resources. */ export interface VirtualMachineState { /** * The guest name for the operating system when guestId is otherGuest or otherGuest64. */ alternateGuestName?: pulumi.Input; /** * User-provided description of the virtual machine. */ annotation?: pulumi.Input; /** * The number of milliseconds to wait before starting the boot sequence. */ bootDelay?: pulumi.Input; /** * The number of milliseconds to wait before retrying the boot sequence. This only valid if bootRetryEnabled is true. */ bootRetryDelay?: pulumi.Input; /** * If set to true, a virtual machine that fails to boot will try again after the delay defined in boot_retry_delay. */ bootRetryEnabled?: pulumi.Input; /** * A specification for a CDROM device on this virtual machine. */ cdroms?: pulumi.Input[]>; /** * A unique identifier for a given version of the last configuration was applied. */ changeVersion?: pulumi.Input; /** * A specification for cloning a virtual machine from template. */ clone?: pulumi.Input; /** * Allow CPUs to be added to this virtual machine while it is running. */ cpuHotAddEnabled?: pulumi.Input; /** * Allow CPUs to be added to this virtual machine while it is running. */ cpuHotRemoveEnabled?: pulumi.Input; /** * The maximum amount of memory (in MB) or CPU (in MHz) that this virtual machine can consume, regardless of available resources. */ cpuLimit?: pulumi.Input; /** * Enable CPU performance counters on this virtual machine. */ cpuPerformanceCountersEnabled?: pulumi.Input; /** * The amount of memory (in MB) or CPU (in MHz) that this virtual machine is guaranteed. */ cpuReservation?: pulumi.Input; /** * The amount of shares to allocate to cpu for a custom share level. */ cpuShareCount?: pulumi.Input; /** * The allocation level for cpu resources. Can be one of high, low, normal, or custom. */ cpuShareLevel?: pulumi.Input; /** * A list of custom attributes to set on this resource. */ customAttributes?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The ID of the datacenter where the VM is to be created. */ datacenterId?: pulumi.Input; /** * The ID of a datastore cluster to put the virtual machine in. */ datastoreClusterId?: pulumi.Input; /** * The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores. */ datastoreId?: pulumi.Input; /** * The IP address selected by Terraform to be used with any provisioners configured on this resource. When possible, this is the first IPv4 address that is reachable through the default gateway configured on the machine, then the first reachable IPv6 address, and then the first general discovered address if neither exists. If VMware Tools is not running on the virtual machine, or if the virtual machine is powered off, this value will be blank. */ defaultIpAddress?: pulumi.Input; /** * A specification for a virtual disk device on this virtual machine. */ disks?: pulumi.Input[]>; /** * When the boot type set in firmware is efi, this enables EFI secure boot. */ efiSecureBootEnabled?: pulumi.Input; /** * Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. */ enableDiskUuid?: pulumi.Input; /** * Enable logging on this virtual machine. */ enableLogging?: pulumi.Input; /** * The EPT/RVI (hardware memory virtualization) setting for this virtual machine. Can be one of automatic, on, or off. */ eptRviMode?: pulumi.Input; /** * Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata, or configuration data for OVF images. */ extraConfig?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Allow the virtual machine to be rebooted when a change to `extraConfig` occurs. */ extraConfigRebootRequired?: pulumi.Input; /** * The firmware interface to use on the virtual machine. Can be one of bios or efi. */ firmware?: pulumi.Input; /** * The name of the folder to locate the virtual machine in. */ folder?: pulumi.Input; /** * Set to true to force power-off a virtual machine if a graceful guest shutdown failed for a necessary operation. */ forcePowerOff?: pulumi.Input; /** * The guest ID for the operating system. */ guestId?: pulumi.Input; /** * The current list of IP addresses on this machine, including the value of `defaultIpAddress`. If VMware Tools is not running on the virtual machine, or if the virtual machine is powered off, this list will be empty. */ guestIpAddresses?: pulumi.Input[]>; /** * The hardware version for the virtual machine. Allows versions within ranges: 4, 7-11, 13-15, 17-22. */ hardwareVersion?: pulumi.Input; /** * The ID of an optional host system to pin the virtual machine to. */ hostSystemId?: pulumi.Input; /** * The (non-nested) hardware virtualization setting for this virtual machine. Can be one of hvAuto, hvOn, or hvOff. */ hvMode?: pulumi.Input; /** * The number of IDE controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ ideControllerCount?: pulumi.Input; /** * List of IP addresses and CIDR networks to ignore while waiting for an IP */ ignoredGuestIps?: pulumi.Input[]>; /** * Indicates if the virtual machine resource has been imported, or if the state has been migrated from a previous version of the resource. It influences the behavior of the first post-import apply operation. See the section on importing below. */ imported?: pulumi.Input; /** * Controls the scheduling delay of the virtual machine. Use a higher sensitivity for applications that require lower latency, such as VOIP, media player applications, or applications that require frequent access to mouse or keyboard devices. Can be one of low, normal, medium, or high. */ latencySensitivity?: pulumi.Input; /** * The size of the virtual machine's memory, in MB. */ memory?: pulumi.Input; /** * Allow memory to be added to this virtual machine while it is running. */ memoryHotAddEnabled?: pulumi.Input; /** * The maximum amount of memory (in MB) or CPU (in MHz) that this virtual machine can consume, regardless of available resources. */ memoryLimit?: pulumi.Input; /** * The amount of memory (in MB) or CPU (in MHz) that this virtual machine is guaranteed. */ memoryReservation?: pulumi.Input; /** * If set true, memory resource reservation for this virtual machine will always be equal to the virtual machine's memory size;increases in memory size will be rejected when a corresponding reservation increase is not possible. This feature may only be enabled if it is currently possible to reserve all of the virtual machine's memory. */ memoryReservationLockedToMax?: pulumi.Input; /** * The amount of shares to allocate to memory for a custom share level. */ memoryShareCount?: pulumi.Input; /** * The allocation level for memory resources. Can be one of high, low, normal, or custom. */ memoryShareLevel?: pulumi.Input; /** * The amount of time, in minutes, to wait for a vMotion operation to complete before failing. */ migrateWaitTimeout?: pulumi.Input; /** * The [managed object reference ID][docs-about-morefs] of the created virtual machine. */ moid?: pulumi.Input; /** * The name of this virtual machine. */ name?: pulumi.Input; /** * Enable nested hardware virtualization on this virtual machine, facilitating nested virtualization in the guest. */ nestedHvEnabled?: pulumi.Input; /** * A specification for a virtual NIC on this virtual machine. */ networkInterfaces?: pulumi.Input[]>; /** * The number of cores to distribute amongst the CPUs in this virtual machine. If specified, the value supplied to numCpus must be evenly divisible by this value. */ numCoresPerSocket?: pulumi.Input; /** * The number of virtual processors to assign to this virtual machine. */ numCpus?: pulumi.Input; /** * The number of NVMe controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ nvmeControllerCount?: pulumi.Input; /** * A specification for deploying a virtual machine from ovf/ova template. */ ovfDeploy?: pulumi.Input; /** * A list of PCI passthrough devices */ pciDeviceIds?: pulumi.Input[]>; /** * A computed value for the current power state of the virtual machine. One of `on`, `off`, or `suspended`. */ powerState?: pulumi.Input; /** * The amount of time, in seconds, that we will be trying to power on a VM */ poweronTimeout?: pulumi.Input; /** * Value internal to Terraform used to determine if a configuration set change requires a reboot. This value is most useful during an update process and gets reset on refresh. */ rebootRequired?: pulumi.Input; /** * Triggers replacement of resource whenever it changes. */ replaceTrigger?: pulumi.Input; /** * The ID of a resource pool to put the virtual machine in. */ resourcePoolId?: pulumi.Input; /** * Enable the run of scripts after virtual machine power-on when VMware Tools is installed. */ runToolsScriptsAfterPowerOn?: pulumi.Input; /** * Enable the run of scripts after virtual machine resume when when VMware Tools is installed. */ runToolsScriptsAfterResume?: pulumi.Input; /** * Enable the run of scripts before guest operating system reboot when VMware Tools is installed. */ runToolsScriptsBeforeGuestReboot?: pulumi.Input; /** * Enable the run of scripts before guest operating system shutdown when VMware Tools is installed. */ runToolsScriptsBeforeGuestShutdown?: pulumi.Input; /** * Enable the run of scripts before guest operating system standby when VMware Tools is installed. */ runToolsScriptsBeforeGuestStandby?: pulumi.Input; /** * The number of SATA controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ sataControllerCount?: pulumi.Input; /** * Mode for sharing the SCSI bus. The modes are physicalSharing, virtualSharing, and noSharing. */ scsiBusSharing?: pulumi.Input; /** * The number of SCSI controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ scsiControllerCount?: pulumi.Input; /** * The type of SCSI bus this virtual machine will have. Can be one of lsilogic, lsilogic-sas or pvscsi. */ scsiType?: pulumi.Input; /** * The amount of time, in minutes, to wait for shutdown when making necessary updates to the virtual machine. */ shutdownWaitTimeout?: pulumi.Input; /** * The ID of the storage policy to assign to the virtual machine home directory. */ storagePolicyId?: pulumi.Input; /** * The swap file placement policy for this virtual machine. Can be one of inherit, hostLocal, or vmDirectory. */ swapPlacementPolicy?: pulumi.Input; /** * Enable guest clock synchronization with the host. On vSphere 7.0 U1 and above, with only this setting the clock is synchronized on startup and resume. Requires VMware Tools to be installed. */ syncTimeWithHost?: pulumi.Input; /** * Enable periodic clock synchronization with the host. Supported only on vSphere 7.0 U1 and above. On prior versions setting `syncTimeWithHost` is enough for periodic synchronization. Requires VMware Tools to be installed. */ syncTimeWithHostPeriodically?: pulumi.Input; /** * A list of tag IDs to apply to this object. */ tags?: pulumi.Input[]>; /** * Set the upgrade policy for VMware Tools. Can be one of `manual` or `upgradeAtPowerCycle`. */ toolsUpgradePolicy?: pulumi.Input; /** * The UUID of the virtual machine. Also exposed as the `id` of the resource. */ uuid?: pulumi.Input; /** * vApp configuration data for this virtual machine. Can be used to provide configuration data for OVF images. */ vapp?: pulumi.Input; /** * Computed value which is only valid for cloned virtual machines. A list of vApp transport methods supported by the source virtual machine or template. */ vappTransports?: pulumi.Input[]>; /** * Flag to specify if Virtualization-based security is enabled for this virtual machine. */ vbsEnabled?: pulumi.Input; /** * The state of VMware Tools in the guest. This will determine the proper course of action for some device operations. */ vmwareToolsStatus?: pulumi.Input; /** * The path of the virtual machine configuration file on the datastore in which the virtual machine is placed. */ vmxPath?: pulumi.Input; /** * A specification for a virtual Trusted Platform Module (TPM) device on the virtual machine. */ vtpm?: pulumi.Input; /** * Flag to specify if I/O MMU virtualization, also called Intel Virtualization Technology for Directed I/O (VT-d) and AMD I/O Virtualization (AMD-Vi or IOMMU), is enabled. */ vvtdEnabled?: pulumi.Input; /** * The amount of time, in minutes, to wait for an available IP address on this virtual machine. A value less than 1 disables the waiter. */ waitForGuestIpTimeout?: pulumi.Input; /** * Controls whether or not the guest network waiter waits for a routable address. When false, the waiter does not wait for a default gateway, nor are IP addresses checked against any discovered default gateways as part of its success criteria. */ waitForGuestNetRoutable?: pulumi.Input; /** * The amount of time, in minutes, to wait for an available IP address on this virtual machine. A value less than 1 disables the waiter. */ waitForGuestNetTimeout?: pulumi.Input; } /** * The set of arguments for constructing a VirtualMachine resource. */ export interface VirtualMachineArgs { /** * The guest name for the operating system when guestId is otherGuest or otherGuest64. */ alternateGuestName?: pulumi.Input; /** * User-provided description of the virtual machine. */ annotation?: pulumi.Input; /** * The number of milliseconds to wait before starting the boot sequence. */ bootDelay?: pulumi.Input; /** * The number of milliseconds to wait before retrying the boot sequence. This only valid if bootRetryEnabled is true. */ bootRetryDelay?: pulumi.Input; /** * If set to true, a virtual machine that fails to boot will try again after the delay defined in boot_retry_delay. */ bootRetryEnabled?: pulumi.Input; /** * A specification for a CDROM device on this virtual machine. */ cdroms?: pulumi.Input[]>; /** * A specification for cloning a virtual machine from template. */ clone?: pulumi.Input; /** * Allow CPUs to be added to this virtual machine while it is running. */ cpuHotAddEnabled?: pulumi.Input; /** * Allow CPUs to be added to this virtual machine while it is running. */ cpuHotRemoveEnabled?: pulumi.Input; /** * The maximum amount of memory (in MB) or CPU (in MHz) that this virtual machine can consume, regardless of available resources. */ cpuLimit?: pulumi.Input; /** * Enable CPU performance counters on this virtual machine. */ cpuPerformanceCountersEnabled?: pulumi.Input; /** * The amount of memory (in MB) or CPU (in MHz) that this virtual machine is guaranteed. */ cpuReservation?: pulumi.Input; /** * The amount of shares to allocate to cpu for a custom share level. */ cpuShareCount?: pulumi.Input; /** * The allocation level for cpu resources. Can be one of high, low, normal, or custom. */ cpuShareLevel?: pulumi.Input; /** * A list of custom attributes to set on this resource. */ customAttributes?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The ID of the datacenter where the VM is to be created. */ datacenterId?: pulumi.Input; /** * The ID of a datastore cluster to put the virtual machine in. */ datastoreClusterId?: pulumi.Input; /** * The ID of the virtual machine's datastore. The virtual machine configuration is placed here, along with any virtual disks that are created without datastores. */ datastoreId?: pulumi.Input; /** * A specification for a virtual disk device on this virtual machine. */ disks?: pulumi.Input[]>; /** * When the boot type set in firmware is efi, this enables EFI secure boot. */ efiSecureBootEnabled?: pulumi.Input; /** * Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. */ enableDiskUuid?: pulumi.Input; /** * Enable logging on this virtual machine. */ enableLogging?: pulumi.Input; /** * The EPT/RVI (hardware memory virtualization) setting for this virtual machine. Can be one of automatic, on, or off. */ eptRviMode?: pulumi.Input; /** * Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata, or configuration data for OVF images. */ extraConfig?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Allow the virtual machine to be rebooted when a change to `extraConfig` occurs. */ extraConfigRebootRequired?: pulumi.Input; /** * The firmware interface to use on the virtual machine. Can be one of bios or efi. */ firmware?: pulumi.Input; /** * The name of the folder to locate the virtual machine in. */ folder?: pulumi.Input; /** * Set to true to force power-off a virtual machine if a graceful guest shutdown failed for a necessary operation. */ forcePowerOff?: pulumi.Input; /** * The guest ID for the operating system. */ guestId?: pulumi.Input; /** * The hardware version for the virtual machine. Allows versions within ranges: 4, 7-11, 13-15, 17-22. */ hardwareVersion?: pulumi.Input; /** * The ID of an optional host system to pin the virtual machine to. */ hostSystemId?: pulumi.Input; /** * The (non-nested) hardware virtualization setting for this virtual machine. Can be one of hvAuto, hvOn, or hvOff. */ hvMode?: pulumi.Input; /** * The number of IDE controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ ideControllerCount?: pulumi.Input; /** * List of IP addresses and CIDR networks to ignore while waiting for an IP */ ignoredGuestIps?: pulumi.Input[]>; /** * Controls the scheduling delay of the virtual machine. Use a higher sensitivity for applications that require lower latency, such as VOIP, media player applications, or applications that require frequent access to mouse or keyboard devices. Can be one of low, normal, medium, or high. */ latencySensitivity?: pulumi.Input; /** * The size of the virtual machine's memory, in MB. */ memory?: pulumi.Input; /** * Allow memory to be added to this virtual machine while it is running. */ memoryHotAddEnabled?: pulumi.Input; /** * The maximum amount of memory (in MB) or CPU (in MHz) that this virtual machine can consume, regardless of available resources. */ memoryLimit?: pulumi.Input; /** * The amount of memory (in MB) or CPU (in MHz) that this virtual machine is guaranteed. */ memoryReservation?: pulumi.Input; /** * If set true, memory resource reservation for this virtual machine will always be equal to the virtual machine's memory size;increases in memory size will be rejected when a corresponding reservation increase is not possible. This feature may only be enabled if it is currently possible to reserve all of the virtual machine's memory. */ memoryReservationLockedToMax?: pulumi.Input; /** * The amount of shares to allocate to memory for a custom share level. */ memoryShareCount?: pulumi.Input; /** * The allocation level for memory resources. Can be one of high, low, normal, or custom. */ memoryShareLevel?: pulumi.Input; /** * The amount of time, in minutes, to wait for a vMotion operation to complete before failing. */ migrateWaitTimeout?: pulumi.Input; /** * The name of this virtual machine. */ name?: pulumi.Input; /** * Enable nested hardware virtualization on this virtual machine, facilitating nested virtualization in the guest. */ nestedHvEnabled?: pulumi.Input; /** * A specification for a virtual NIC on this virtual machine. */ networkInterfaces?: pulumi.Input[]>; /** * The number of cores to distribute amongst the CPUs in this virtual machine. If specified, the value supplied to numCpus must be evenly divisible by this value. */ numCoresPerSocket?: pulumi.Input; /** * The number of virtual processors to assign to this virtual machine. */ numCpus?: pulumi.Input; /** * The number of NVMe controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ nvmeControllerCount?: pulumi.Input; /** * A specification for deploying a virtual machine from ovf/ova template. */ ovfDeploy?: pulumi.Input; /** * A list of PCI passthrough devices */ pciDeviceIds?: pulumi.Input[]>; /** * The amount of time, in seconds, that we will be trying to power on a VM */ poweronTimeout?: pulumi.Input; /** * Triggers replacement of resource whenever it changes. */ replaceTrigger?: pulumi.Input; /** * The ID of a resource pool to put the virtual machine in. */ resourcePoolId: pulumi.Input; /** * Enable the run of scripts after virtual machine power-on when VMware Tools is installed. */ runToolsScriptsAfterPowerOn?: pulumi.Input; /** * Enable the run of scripts after virtual machine resume when when VMware Tools is installed. */ runToolsScriptsAfterResume?: pulumi.Input; /** * Enable the run of scripts before guest operating system reboot when VMware Tools is installed. */ runToolsScriptsBeforeGuestReboot?: pulumi.Input; /** * Enable the run of scripts before guest operating system shutdown when VMware Tools is installed. */ runToolsScriptsBeforeGuestShutdown?: pulumi.Input; /** * Enable the run of scripts before guest operating system standby when VMware Tools is installed. */ runToolsScriptsBeforeGuestStandby?: pulumi.Input; /** * The number of SATA controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ sataControllerCount?: pulumi.Input; /** * Mode for sharing the SCSI bus. The modes are physicalSharing, virtualSharing, and noSharing. */ scsiBusSharing?: pulumi.Input; /** * The number of SCSI controllers that Terraform manages on this virtual machine. This directly affects the amount of disks you can add to the virtual machine and the maximum disk unit number. Note that lowering this value does not remove controllers. */ scsiControllerCount?: pulumi.Input; /** * The type of SCSI bus this virtual machine will have. Can be one of lsilogic, lsilogic-sas or pvscsi. */ scsiType?: pulumi.Input; /** * The amount of time, in minutes, to wait for shutdown when making necessary updates to the virtual machine. */ shutdownWaitTimeout?: pulumi.Input; /** * The ID of the storage policy to assign to the virtual machine home directory. */ storagePolicyId?: pulumi.Input; /** * The swap file placement policy for this virtual machine. Can be one of inherit, hostLocal, or vmDirectory. */ swapPlacementPolicy?: pulumi.Input; /** * Enable guest clock synchronization with the host. On vSphere 7.0 U1 and above, with only this setting the clock is synchronized on startup and resume. Requires VMware Tools to be installed. */ syncTimeWithHost?: pulumi.Input; /** * Enable periodic clock synchronization with the host. Supported only on vSphere 7.0 U1 and above. On prior versions setting `syncTimeWithHost` is enough for periodic synchronization. Requires VMware Tools to be installed. */ syncTimeWithHostPeriodically?: pulumi.Input; /** * A list of tag IDs to apply to this object. */ tags?: pulumi.Input[]>; /** * Set the upgrade policy for VMware Tools. Can be one of `manual` or `upgradeAtPowerCycle`. */ toolsUpgradePolicy?: pulumi.Input; /** * vApp configuration data for this virtual machine. Can be used to provide configuration data for OVF images. */ vapp?: pulumi.Input; /** * Flag to specify if Virtualization-based security is enabled for this virtual machine. */ vbsEnabled?: pulumi.Input; /** * A specification for a virtual Trusted Platform Module (TPM) device on the virtual machine. */ vtpm?: pulumi.Input; /** * Flag to specify if I/O MMU virtualization, also called Intel Virtualization Technology for Directed I/O (VT-d) and AMD I/O Virtualization (AMD-Vi or IOMMU), is enabled. */ vvtdEnabled?: pulumi.Input; /** * The amount of time, in minutes, to wait for an available IP address on this virtual machine. A value less than 1 disables the waiter. */ waitForGuestIpTimeout?: pulumi.Input; /** * Controls whether or not the guest network waiter waits for a routable address. When false, the waiter does not wait for a default gateway, nor are IP addresses checked against any discovered default gateways as part of its success criteria. */ waitForGuestNetRoutable?: pulumi.Input; /** * The amount of time, in minutes, to wait for an available IP address on this virtual machine. A value less than 1 disables the waiter. */ waitForGuestNetTimeout?: pulumi.Input; }