Class VirtualMachine
Manages a Virtual Machine.
Disclaimers
Note: The
azure.compute.VirtualMachineresource has been superseded by theazure.compute.LinuxVirtualMachineandazure.compute.WindowsVirtualMachineresources. The existingazure.compute.VirtualMachineresource will continue to be available throughout the 2.x releases however is in a feature-frozen state to maintain compatibility - new functionality will instead be added to theazure.compute.LinuxVirtualMachineandazure.compute.WindowsVirtualMachineresources.
Note: Data Disks can be attached either directly on the
azure.compute.VirtualMachineresource, or using theazure.compute.DataDiskAttachmentresource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur.
Inherited Members
Namespace: Pulumi.Azure.Compute
Assembly: Pulumi.Azure.dll
Syntax
public class VirtualMachine : CustomResource
Constructors
View SourceVirtualMachine(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 SourceAdditionalCapabilities
A additional_capabilities block.
Declaration
public Output<VirtualMachineAdditionalCapabilities> AdditionalCapabilities { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineAdditionalCapabilities> |
AvailabilitySetId
The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
Declaration
public Output<string> AvailabilitySetId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
BootDiagnostics
A boot_diagnostics block.
Declaration
public Output<VirtualMachineBootDiagnostics> BootDiagnostics { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineBootDiagnostics> |
DeleteDataDisksOnTermination
Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to false.
Declaration
public Output<bool?> DeleteDataDisksOnTermination { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
DeleteOsDiskOnTermination
Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to false.
Declaration
public Output<bool?> DeleteOsDiskOnTermination { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Identity
A identity block.
Declaration
public Output<VirtualMachineIdentity> Identity { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineIdentity> |
LicenseType
Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are Windows_Client and Windows_Server.
Declaration
public Output<string> LicenseType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Location
Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
Declaration
public Output<string> Location { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkInterfaceIds
A list of Network Interface ID's which should be associated with the Virtual Machine.
Declaration
public Output<ImmutableArray<string>> NetworkInterfaceIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
OsProfile
An os_profile block. Required when create_option in the storage_os_disk block is set to FromImage.
Declaration
public Output<VirtualMachineOsProfile> OsProfile { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineOsProfile> |
OsProfileLinuxConfig
A os_profile_linux_config block.
Declaration
public Output<VirtualMachineOsProfileLinuxConfig> OsProfileLinuxConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineOsProfileLinuxConfig> |
OsProfileSecrets
One or more os_profile_secrets blocks.
Declaration
public Output<ImmutableArray<VirtualMachineOsProfileSecret>> OsProfileSecrets { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<VirtualMachineOsProfileSecret>> |
OsProfileWindowsConfig
A os_profile_windows_config block.
Declaration
public Output<VirtualMachineOsProfileWindowsConfig> OsProfileWindowsConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineOsProfileWindowsConfig> |
Plan
A plan block.
Declaration
public Output<VirtualMachinePlan> Plan { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachinePlan> |
PrimaryNetworkInterfaceId
The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
Declaration
public Output<string> PrimaryNetworkInterfaceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ProximityPlacementGroupId
The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
Declaration
public Output<string> ProximityPlacementGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceGroupName
Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
Declaration
public Output<string> ResourceGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
StorageDataDisks
One or more storage_data_disk blocks.
Declaration
public Output<ImmutableArray<VirtualMachineStorageDataDisk>> StorageDataDisks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<VirtualMachineStorageDataDisk>> |
StorageImageReference
A storage_image_reference block.
Declaration
public Output<VirtualMachineStorageImageReference> StorageImageReference { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineStorageImageReference> |
StorageOsDisk
A storage_os_disk block.
Declaration
public Output<VirtualMachineStorageOsDisk> StorageOsDisk { get; }
Property Value
| Type | Description |
|---|---|
| Output<VirtualMachineStorageOsDisk> |
Tags
A mapping of tags to assign to the Virtual Machine.
Declaration
public Output<ImmutableDictionary<string, string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
VmSize
Specifies the size of the Virtual Machine.
Declaration
public Output<string> VmSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Zones
A list of a single item of the Availability Zone which the Virtual Machine should be allocated in.
Declaration
public Output<string> Zones { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |