VirtualMachine Class

Definition

Describes a Virtual Machine.

[Microsoft.Rest.Serialization.JsonTransformation]
public class VirtualMachine : Microsoft.Azure.Management.Compute.Models.Resource
[<Microsoft.Rest.Serialization.JsonTransformation>]
type VirtualMachine = class
    inherit Resource
Public Class VirtualMachine
Inherits Resource
Inheritance
VirtualMachine
Attributes

Constructors

VirtualMachine()

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, IList<VirtualMachineExtension>)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, IList<VirtualMachineExtension>, VirtualMachineIdentity)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, IList<VirtualMachineExtension>)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>, ExtendedLocation)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, CapacityReservationProfile, ApplicationProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>, ExtendedLocation)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, CapacityReservationProfile, ApplicationProfile, Nullable<DateTime>, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>, ExtendedLocation)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, CapacityReservationProfile, IList<VirtualMachineExtension>)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, CapacityReservationProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, CapacityReservationProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, CapacityReservationProfile, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>, ExtendedLocation)

Initializes a new instance of the VirtualMachine class.

VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, IList<VirtualMachineExtension>, VirtualMachineIdentity)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>)
VirtualMachine(String, String, String, String, IDictionary<String, String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, SecurityProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, SubResource, String, VirtualMachineInstanceView, String, String, String, Nullable<Int32>, ScheduledEventsProfile, String, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>, ExtendedLocation)

Initializes a new instance of the VirtualMachine class.

Properties

AdditionalCapabilities

Gets or sets specifies additional capabilities enabled or disabled on the virtual machine.

ApplicationProfile

Gets or sets specifies the gallery applications that should be made available to the VM/VMSS.

AvailabilitySet

Gets or sets specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Availability sets overview. For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure. Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.

BillingProfile

Gets or sets specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01.

CapacityReservation

Gets or sets specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01.

DiagnosticsProfile

Gets or sets specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.

EvictionPolicy

Gets or sets specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'

ExtendedLocation

Gets or sets the extended location of the Virtual Machine.

ExtensionsTimeBudget

Gets or sets specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). Minimum api-version: 2020-06-01.

HardwareProfile

Gets or sets specifies the hardware settings for the virtual machine.

Host

Gets or sets specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01.

HostGroup

Gets or sets specifies information about the dedicated host group that the virtual machine resides in. Note: User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01.

Id

Gets resource Id

(Inherited from Resource)
Identity

Gets or sets the identity of the virtual machine, if configured.

InstanceView

Gets the virtual machine instance view.

LicenseType

Gets or sets specifies that the image or disk that is being used was licensed on-premises. &lt;br&gt;&lt;br&gt; Possible values for Windows Server operating system are: &lt;br&gt;&lt;br&gt; Windows_Client &lt;br&gt;&lt;br&gt; Windows_Server &lt;br&gt;&lt;br&gt; Possible values for Linux Server operating system are: &lt;br&gt;&lt;br&gt; RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS (for SUSE) &lt;br&gt;&lt;br&gt; For more information, see Azure Hybrid Use Benefit for Windows Server &lt;br&gt;&lt;br&gt; Azure Hybrid Use Benefit for Linux Server &lt;br&gt;&lt;br&gt; Minimum api-version: 2015-06-15

Location

Gets or sets resource location

(Inherited from Resource)
Name

Gets resource name

(Inherited from Resource)
NetworkProfile

Gets or sets specifies the network interfaces of the virtual machine.

OsProfile

Gets or sets specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.

Plan

Gets or sets specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started -&gt;. Enter any required information and then click Save.

PlatformFaultDomain

Gets or sets specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01.

Priority

Gets or sets specifies the priority for the virtual machine. Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot'

ProvisioningState

Gets the provisioning state, which only appears in the response.

ProximityPlacementGroup

Gets or sets specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01.

Resources

Gets the virtual machine child extension resources.

ScheduledEventsProfile

Gets or sets specifies Scheduled Event related configurations.

SecurityProfile

Gets or sets specifies the Security related profile settings for the virtual machine.

StorageProfile

Gets or sets specifies the storage settings for the virtual machine disks.

Tags

Gets or sets resource tags

(Inherited from Resource)
TimeCreated

Gets specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.

Type

Gets resource type

(Inherited from Resource)
UserData

Gets or sets userData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.

VirtualMachineScaleSet

Gets or sets specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01.

VmId

Gets specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.

Zones

Gets or sets the virtual machine zones.

Methods

Validate()

Validate the object.

Applies to