Show / Hide Table of Contents

Class VirtualMachine

Inheritance
System.Object
Resource
CustomResource
VirtualMachine
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class VirtualMachine : CustomResource

Constructors

View Source

VirtualMachine(String, VirtualMachineArgs, CustomResourceOptions)

Create a VirtualMachine resource with the given unique name, arguments, and options.

Declaration
public VirtualMachine(string name, VirtualMachineArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

VirtualMachineArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AlternateGuestName

The guest name for the operating system when guest_id is other or other-64.

Declaration
public Output<string> AlternateGuestName { get; }
Property Value
Type Description
Output<System.String>
View Source

Annotation

A user-provided description of the virtual machine. The default is no annotation.

Declaration
public Output<string> Annotation { get; }
Property Value
Type Description
Output<System.String>
View Source

BootDelay

The number of milliseconds to wait before starting the boot sequence. The default is no delay.

Declaration
public Output<int?> BootDelay { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

BootRetryDelay

The number of milliseconds to wait before retrying the boot sequence. This only valid if boot_retry_enabled is true. Default: 10000 (10 seconds).

Declaration
public Output<int?> BootRetryDelay { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

BootRetryEnabled

If set to true, a virtual machine that fails to boot will try again after the delay defined in boot_retry_delay. Default: false.

Declaration
public Output<bool?> BootRetryEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Cdrom

A specification for a CDROM device on this virtual machine. See CDROM options below.

Declaration
public Output<VirtualMachineCdrom> Cdrom { get; }
Property Value
Type Description
Output<VirtualMachineCdrom>
View Source

ChangeVersion

A unique identifier for a given version of the last configuration applied, such the timestamp of the last update to the configuration.

Declaration
public Output<string> ChangeVersion { get; }
Property Value
Type Description
Output<System.String>
View Source

Clone

When specified, the VM will be created as a clone of a specified template. Optional customization options can be submitted as well. See creating a virtual machine from a template for more details.

Declaration
public Output<VirtualMachineClone> Clone { get; }
Property Value
Type Description
Output<VirtualMachineClone>
View Source

CpuHotAddEnabled

Allow CPUs to be added to this virtual machine while it is running.

Declaration
public Output<bool?> CpuHotAddEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

CpuHotRemoveEnabled

Allow CPUs to be removed to this virtual machine while it is running.

Declaration
public Output<bool?> CpuHotRemoveEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

CpuLimit

The maximum amount of CPU (in MHz) that this virtual machine can consume, regardless of available resources. The default is no limit.

Declaration
public Output<int?> CpuLimit { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

CpuPerformanceCountersEnabled

Enable CPU performance counters on this virtual machine. Default: false.

Declaration
public Output<bool?> CpuPerformanceCountersEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

CpuReservation

The amount of CPU (in MHz) that this virtual machine is guaranteed. The default is no reservation.

Declaration
public Output<int?> CpuReservation { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

CpuShareCount

The number of CPU shares allocated to the virtual machine when the cpu_share_level is custom.

Declaration
public Output<int> CpuShareCount { get; }
Property Value
Type Description
Output<System.Int32>
View Source

CpuShareLevel

The allocation level for CPU resources. Can be one of high, low, normal, or custom. Default: custom.

Declaration
public Output<string> CpuShareLevel { get; }
Property Value
Type Description
Output<System.String>
View Source

CustomAttributes

Map of custom attribute ids to attribute value strings to set for virtual machine.

Declaration
public Output<ImmutableDictionary<string, string>> CustomAttributes { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

DatacenterId

The datacenter id. Required only when deploying an ovf template.

Declaration
public Output<string> DatacenterId { get; }
Property Value
Type Description
Output<System.String>
View Source

DatastoreClusterId

The managed object reference ID of the datastore cluster ID to use. This setting applies to entire virtual machine and implies that you wish to use Storage DRS with this virtual machine. See the section on virtual machine migration for details on changing this value.

Declaration
public Output<string> DatastoreClusterId { get; }
Property Value
Type Description
Output<System.String>
View Source

DatastoreId

The datastore ID that the ISO is located in. Requried for using a datastore ISO. Conflicts with client_device.

Declaration
public Output<string> DatastoreId { get; }
Property Value
Type Description
Output<System.String>
View Source

DefaultIpAddress

The IP address selected by the provider to be used with any provisioners configured on this resource. Whenever 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 exist. If VMware tools is not running on the virtual machine, or if the VM is powered off, this value will be blank.

Declaration
public Output<string> DefaultIpAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

Disks

A specification for a virtual disk device on this virtual machine. See disk options below.

Declaration
public Output<ImmutableArray<VirtualMachineDisk>> Disks { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<VirtualMachineDisk>>
View Source

EfiSecureBootEnabled

When the firmware type is set to is efi, this enables EFI secure boot. Default: false.

Declaration
public Output<bool?> EfiSecureBootEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

EnableDiskUuid

Expose the UUIDs of attached virtual disks to the virtual machine, allowing access to them in the guest. Default: false.

Declaration
public Output<bool?> EnableDiskUuid { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

EnableLogging

Enable logging of virtual machine events to a log file stored in the virtual machine directory. Default: false.

Declaration
public Output<bool?> EnableLogging { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

EptRviMode

The EPT/RVI (hardware memory virtualization) setting for this virtual machine. Can be one of automatic, on, or off. Default: automatic.

Declaration
public Output<string> EptRviMode { get; }
Property Value
Type Description
Output<System.String>
View Source

ExtraConfig

Extra configuration data for this virtual machine. Can be used to supply advanced parameters not normally in configuration, such as instance metadata.

Declaration
public Output<ImmutableDictionary<string, string>> ExtraConfig { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

Firmware

The firmware interface to use on the virtual machine. Can be one of bios or EFI. Default: bios.

Declaration
public Output<string> Firmware { get; }
Property Value
Type Description
Output<System.String>
View Source

Folder

The path to the folder to put this virtual machine in, relative to the datacenter that the resource pool is in.

Declaration
public Output<string> Folder { get; }
Property Value
Type Description
Output<System.String>
View Source

ForcePowerOff

If a guest shutdown failed or timed out while updating or destroying (see shutdown_wait_timeout), force the power-off of the virtual machine. Default: true.

Declaration
public Output<bool?> ForcePowerOff { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

GuestId

The guest ID for the operating system type. For a full list of possible values, see [here][vmware-docs-guest-ids]. Default: other-64.

Declaration
public Output<string> GuestId { get; }
Property Value
Type Description
Output<System.String>
View Source

GuestIpAddresses

The current list of IP addresses on this machine, including the value of default_ip_address. If VMware tools is not running on the virtual machine, or if the VM is powered off, this list will be empty.

  • moid: The managed object reference ID of the created virtual machine.
Declaration
public Output<ImmutableArray<string>> GuestIpAddresses { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

HardwareVersion

The hardware version number. Valid range is from 4 to 15. The hardware version cannot be downgraded. See [virtual machine hardware compatibility][virtual-machine-hardware-compatibility] for more details.

Declaration
public Output<int> HardwareVersion { get; }
Property Value
Type Description
Output<System.Int32>
View Source

HostSystemId

An optional managed object reference ID of a host to put this virtual machine on. See the section on virtual machine migration for details on changing this value. If a host_system_id is not supplied, vSphere will select a host in the resource pool to place the virtual machine, according to any defaults or DRS policies in place.

Declaration
public Output<string> HostSystemId { get; }
Property Value
Type Description
Output<System.String>
View Source

HvMode

The (non-nested) hardware virtualization setting for this virtual machine. Can be one of hvAuto, hvOn, or hvOff. Default: hvAuto.

Declaration
public Output<string> HvMode { get; }
Property Value
Type Description
Output<System.String>
View Source

IgnoredGuestIps

List of IP addresses and CIDR networks to ignore while waiting for an available IP address using either of the waiters. Any IP addresses in this list will be ignored if they show up so that the waiter will continue to wait for a real IP address. Default: [].

Declaration
public Output<ImmutableArray<string>> IgnoredGuestIps { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Imported

This is flagged if the virtual machine has been imported, or 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.

Declaration
public Output<bool> Imported { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

LatencySensitivity

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.

Declaration
public Output<string> LatencySensitivity { get; }
Property Value
Type Description
Output<System.String>
View Source

Memory

The size of the virtual machine's memory, in MB. Default: 1024 (1 GB).

Declaration
public Output<int?> Memory { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MemoryHotAddEnabled

Allow memory to be added to this virtual machine while it is running.

Declaration
public Output<bool?> MemoryHotAddEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

MemoryLimit

The maximum amount of memory (in MB) that this virtual machine can consume, regardless of available resources. The default is no limit.

Declaration
public Output<int?> MemoryLimit { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MemoryReservation

The amount of memory (in MB) that this virtual machine is guaranteed. The default is no reservation.

Declaration
public Output<int?> MemoryReservation { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MemoryShareCount

The number of memory shares allocated to the virtual machine when the memory_share_level is custom.

Declaration
public Output<int> MemoryShareCount { get; }
Property Value
Type Description
Output<System.Int32>
View Source

MemoryShareLevel

The allocation level for memory resources. Can be one of high, low, normal, or custom. Default: custom.

Declaration
public Output<string> MemoryShareLevel { get; }
Property Value
Type Description
Output<System.String>
View Source

MigrateWaitTimeout

The amount of time, in minutes, to wait for a virtual machine migration to complete before failing. Default: 10 minutes. Also see the section on virtual machine migration.

Declaration
public Output<int?> MigrateWaitTimeout { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Moid

The machine object ID from VMWare

Declaration
public Output<string> Moid { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

An alias for both label and path, the latter when using attach. Required if not using label.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

NestedHvEnabled

Enable nested hardware virtualization on this virtual machine, facilitating nested virtualization in the guest. Default: false.

Declaration
public Output<bool?> NestedHvEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

NetworkInterfaces

A specification for a virtual NIC on this virtual machine. See network interface options below.

Declaration
public Output<ImmutableArray<VirtualMachineNetworkInterface>> NetworkInterfaces { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<VirtualMachineNetworkInterface>>
View Source

NumCoresPerSocket

The number of cores per socket in this virtual machine. The number of vCPUs on the virtual machine will be num_cpus divided by num_cores_per_socket. If specified, the value supplied to num_cpus must be evenly divisible by this value. Default: 1.

Declaration
public Output<int?> NumCoresPerSocket { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

NumCpus

The total number of virtual processor cores to assign to this virtual machine. Default: 1.

Declaration
public Output<int?> NumCpus { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

OvfDeploy

When specified, the VM will be deployed from the provided ovf template. See creating a virtual machine from a ovf template for more details.

Declaration
public Output<VirtualMachineOvfDeploy> OvfDeploy { get; }
Property Value
Type Description
Output<VirtualMachineOvfDeploy>
View Source

PoweronTimeout

The amount of time, in seconds, that we will be trying to power on a VM

Declaration
public Output<int?> PoweronTimeout { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

RebootRequired

Value internal to the provider used to determine if a configuration set change requires a reboot. This value is only useful during an update process and gets reset on refresh.

Declaration
public Output<bool> RebootRequired { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

ResourcePoolId

The managed object reference ID of the resource pool to put this virtual machine in. See the section on virtual machine migration for details on changing this value.

Declaration
public Output<string> ResourcePoolId { get; }
Property Value
Type Description
Output<System.String>
View Source

RunToolsScriptsAfterPowerOn

Enable the execution of post-power-on scripts when VMware tools is installed. Default: true.

Declaration
public Output<bool?> RunToolsScriptsAfterPowerOn { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

RunToolsScriptsAfterResume

Enable the execution of post-resume scripts when VMware tools is installed. Default: true.

Declaration
public Output<bool?> RunToolsScriptsAfterResume { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

RunToolsScriptsBeforeGuestReboot

Enable the execution of pre-reboot scripts when VMware tools is installed. Default: false.

Declaration
public Output<bool?> RunToolsScriptsBeforeGuestReboot { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

RunToolsScriptsBeforeGuestShutdown

Enable the execution of pre-shutdown scripts when VMware tools is installed. Default: true.

Declaration
public Output<bool?> RunToolsScriptsBeforeGuestShutdown { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

RunToolsScriptsBeforeGuestStandby

Enable the execution of pre-standby scripts when VMware tools is installed. Default: true.

Declaration
public Output<bool?> RunToolsScriptsBeforeGuestStandby { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

ScsiBusSharing

Mode for sharing the SCSI bus. The modes are physicalSharing, virtualSharing, and noSharing. Default: noSharing.

Declaration
public Output<string> ScsiBusSharing { get; }
Property Value
Type Description
Output<System.String>
View Source

ScsiControllerCount

The number of SCSI controllers that this provider 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. Default: 1.

Declaration
public Output<int?> ScsiControllerCount { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

ScsiType

The type of SCSI bus this virtual machine will have. Can be one of lsilogic (LSI Logic Parallel), lsilogic-sas (LSI Logic SAS) or pvscsi (VMware Paravirtual). Defualt: pvscsi.

Declaration
public Output<string> ScsiType { get; }
Property Value
Type Description
Output<System.String>
View Source

ShutdownWaitTimeout

The amount of time, in minutes, to wait for a graceful guest shutdown when making necessary updates to the virtual machine. If force_power_off is set to true, the VM will be force powered-off after this timeout, otherwise an error is returned. Default: 3 minutes.

Declaration
public Output<int?> ShutdownWaitTimeout { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

StoragePolicyId

The UUID of the storage policy to assign to this disk.

Declaration
public Output<string> StoragePolicyId { get; }
Property Value
Type Description
Output<System.String>
View Source

SwapPlacementPolicy

The swap file placement policy for this virtual machine. Can be one of inherit, hostLocal, or vmDirectory. Default: inherit.

Declaration
public Output<string> SwapPlacementPolicy { get; }
Property Value
Type Description
Output<System.String>
View Source

SyncTimeWithHost

Enable guest clock synchronization with the host. Requires VMware tools to be installed. Default: false.

Declaration
public Output<bool?> SyncTimeWithHost { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Tags

The IDs of any tags to attach to this resource.

Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Uuid

The UUID of the virtual disk's VMDK file. This is used to track the virtual disk on the virtual machine.

Declaration
public Output<string> Uuid { get; }
Property Value
Type Description
Output<System.String>
View Source

Vapp

Optional vApp configuration. The only sub-key available is properties, which is a key/value map of properties for virtual machines imported from OVF or OVA files. See Using vApp properties to supply OVF/OVA configuration for more details.

Declaration
public Output<VirtualMachineVapp> Vapp { get; }
Property Value
Type Description
Output<VirtualMachineVapp>
View Source

VappTransports

Computed value which is only valid for cloned virtual machines. A list of vApp transport methods supported by the source virtual machine or template.

Declaration
public Output<ImmutableArray<string>> VappTransports { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

VmwareToolsStatus

The state of VMware tools in the guest. This will determine the proper course of action for some device operations.

Declaration
public Output<string> VmwareToolsStatus { get; }
Property Value
Type Description
Output<System.String>
View Source

VmxPath

The path of the virtual machine's configuration file in the VM's datastore.

Declaration
public Output<string> VmxPath { get; }
Property Value
Type Description
Output<System.String>
View Source

WaitForGuestIpTimeout

The amount of time, in minutes, to wait for an available guest IP address on this virtual machine. This should only be used if your version of VMware Tools does not allow the wait_for_guest_net_timeout waiter to be used. A value less than 1 disables the waiter. Default: 0.

Declaration
public Output<int?> WaitForGuestIpTimeout { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

WaitForGuestNetRoutable

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. This property is ignored if the wait_for_guest_ip_timeout waiter is used. Default: true.

Declaration
public Output<bool?> WaitForGuestNetRoutable { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

WaitForGuestNetTimeout

The amount of time, in minutes, to wait for an available IP address on this virtual machine's NICs. Older versions of VMware Tools do not populate this property. In those cases, this waiter can be disabled and the wait_for_guest_ip_timeout waiter can be used instead. A value less than 1 disables the waiter. Default: 5 minutes.

Declaration
public Output<int?> WaitForGuestNetTimeout { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>

Methods

View Source

Get(String, Input<String>, VirtualMachineState, CustomResourceOptions)

Get an existing VirtualMachine resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static VirtualMachine Get(string name, Input<string> id, VirtualMachineState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

VirtualMachineState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
VirtualMachine
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.