Show / Hide Table of Contents

Class VirtualMachine

Manages a Virtual Machine.

Disclaimers

Note: The azure.compute.VirtualMachine resource has been superseded by the azure.compute.LinuxVirtualMachine and azure.compute.WindowsVirtualMachine resources. The existing azure.compute.VirtualMachine resource 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 the azure.compute.LinuxVirtualMachine and azure.compute.WindowsVirtualMachine resources.

Note: Data Disks can be attached either directly on the azure.compute.VirtualMachine resource, or using the azure.compute.DataDiskAttachment resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur.

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.Azure.Compute
Assembly: Pulumi.Azure.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

AdditionalCapabilities

A additional_capabilities block.

Declaration
public Output<VirtualMachineAdditionalCapabilities> AdditionalCapabilities { get; }
Property Value
Type Description
Output<VirtualMachineAdditionalCapabilities>
View Source

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>
View Source

BootDiagnostics

A boot_diagnostics block.

Declaration
public Output<VirtualMachineBootDiagnostics> BootDiagnostics { get; }
Property Value
Type Description
Output<VirtualMachineBootDiagnostics>
View Source

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>>
View Source

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>>
View Source

Identity

A identity block.

Declaration
public Output<VirtualMachineIdentity> Identity { get; }
Property Value
Type Description
Output<VirtualMachineIdentity>
View Source

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>
View Source

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>
View Source

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>
View Source

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>>
View Source

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>
View Source

OsProfileLinuxConfig

A os_profile_linux_config block.

Declaration
public Output<VirtualMachineOsProfileLinuxConfig> OsProfileLinuxConfig { get; }
Property Value
Type Description
Output<VirtualMachineOsProfileLinuxConfig>
View Source

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>>
View Source

OsProfileWindowsConfig

A os_profile_windows_config block.

Declaration
public Output<VirtualMachineOsProfileWindowsConfig> OsProfileWindowsConfig { get; }
Property Value
Type Description
Output<VirtualMachineOsProfileWindowsConfig>
View Source

Plan

A plan block.

Declaration
public Output<VirtualMachinePlan> Plan { get; }
Property Value
Type Description
Output<VirtualMachinePlan>
View Source

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>
View Source

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>
View Source

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>
View Source

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>>
View Source

StorageImageReference

A storage_image_reference block.

Declaration
public Output<VirtualMachineStorageImageReference> StorageImageReference { get; }
Property Value
Type Description
Output<VirtualMachineStorageImageReference>
View Source

StorageOsDisk

A storage_os_disk block.

Declaration
public Output<VirtualMachineStorageOsDisk> StorageOsDisk { get; }
Property Value
Type Description
Output<VirtualMachineStorageOsDisk>
View Source

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>>
View Source

VmSize

Specifies the size of the Virtual Machine.

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

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 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.