Class VirtualMachine
Describes a Virtual Machine.
Namespace: System.Dynamic.ExpandoObject
Assembly: Microsoft.Azure.Management.Compute.dll
Syntax
[Microsoft.Rest.Serialization.JsonTransformation]
public class VirtualMachine : Microsoft.Azure.Management.Compute.Models.Resource
Constructors
VirtualMachine()
Initializes a new instance of the VirtualMachine class.
Declaration
public VirtualMachine ();
VirtualMachine(String, String, String, String, IDictionary<String,String>, Plan, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, NetworkProfile, DiagnosticsProfile, SubResource, SubResource, SubResource, String, String, BillingProfile, SubResource, String, VirtualMachineInstanceView, String, String, IList<VirtualMachineExtension>, VirtualMachineIdentity, IList<String>)
Initializes a new instance of the VirtualMachine class.
Declaration
public VirtualMachine (string location, string id = null, string name = null, string type = null, System.Collections.Generic.IDictionary<string,string> tags = null, Microsoft.Azure.Management.Compute.Models.Plan plan = null, Microsoft.Azure.Management.Compute.Models.HardwareProfile hardwareProfile = null, Microsoft.Azure.Management.Compute.Models.StorageProfile storageProfile = null, Microsoft.Azure.Management.Compute.Models.AdditionalCapabilities additionalCapabilities = null, Microsoft.Azure.Management.Compute.Models.OSProfile osProfile = null, Microsoft.Azure.Management.Compute.Models.NetworkProfile networkProfile = null, Microsoft.Azure.Management.Compute.Models.DiagnosticsProfile diagnosticsProfile = null, Microsoft.Azure.Management.Compute.Models.SubResource availabilitySet = null, Microsoft.Azure.Management.Compute.Models.SubResource virtualMachineScaleSet = null, Microsoft.Azure.Management.Compute.Models.SubResource proximityPlacementGroup = null, string priority = null, string evictionPolicy = null, Microsoft.Azure.Management.Compute.Models.BillingProfile billingProfile = null, Microsoft.Azure.Management.Compute.Models.SubResource host = null, string provisioningState = null, Microsoft.Azure.Management.Compute.Models.VirtualMachineInstanceView instanceView = null, string licenseType = null, string vmId = null, System.Collections.Generic.IList<Microsoft.Azure.Management.Compute.Models.VirtualMachineExtension> resources = null, Microsoft.Azure.Management.Compute.Models.VirtualMachineIdentity identity = null, System.Collections.Generic.IList<string> zones = null);
Parameters
|
String
location
Resource location |
|
String
id
Resource Id |
|
String
name
Resource name |
|
String
type
Resource type |
|
IDictionary<String,String>
tags
Resource tags |
|
Plan
plan
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 ->. Enter any required information and then click Save. |
|
HardwareProfile
hardwareProfile
Specifies the hardware settings for the virtual machine. |
|
StorageProfile
storageProfile
Specifies the storage settings for the virtual machine disks. |
|
AdditionalCapabilities
additionalCapabilities
Specifies additional capabilities enabled or disabled on the virtual machine. |
|
OSProfile
osProfile
Specifies the operating system settings for the virtual machine. |
|
NetworkProfile
networkProfile
Specifies the network interfaces of the virtual machine. |
|
DiagnosticsProfile
diagnosticsProfile
Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. |
|
SubResource
availabilitySet
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 Manage the availability of virtual machines. <br><br> For more information on Azure planned maintenance, see Planned maintenance for virtual machines in Azure <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. |
|
SubResource
virtualMachineScaleSet
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. <br><br>This property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum api‐version: 2019‐03‐01 |
|
SubResource
proximityPlacementGroup
Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. |
|
String
priority
Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low' |
|
String
evictionPolicy
Specifies the eviction policy for the low priority virtual machine. Only supported value is 'Deallocate'. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' |
|
BillingProfile
billingProfile
Specifies the billing related details of a low priority virtual machine. <br><br>Minimum api-version: 2019-03-01. |
|
SubResource
host
Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. |
|
String
provisioningState
The provisioning state, which only appears in the response. |
|
VirtualMachineInstanceView
instanceView
The virtual machine instance view. |
|
String
licenseType
Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see Azure Hybrid Use Benefit for Windows Server <br><br> Minimum api-version: 2015-06-15 |
|
String
vmId
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. |
|
IList<VirtualMachineExtension>
resources
The virtual machine child extension resources. |
|
VirtualMachineIdentity
identity
The identity of the virtual machine, if configured. |
|
IList<String>
zones
The virtual machine zones. |
Properties
AdditionalCapabilities
Gets or sets specifies additional capabilities enabled or disabled on the virtual machine.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.additionalCapabilities")]
public Microsoft.Azure.Management.Compute.Models.AdditionalCapabilities AdditionalCapabilities { get; set; }
Property Value
|
AdditionalCapabilities
|
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 Manage the availability of virtual machines. <br><br> For more information on Azure planned maintenance, see Planned maintenance for virtual machines in Azure <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.availabilitySet")]
public Microsoft.Azure.Management.Compute.Models.SubResource AvailabilitySet { get; set; }
Property Value
|
SubResource
|
BillingProfile
Gets or sets specifies the billing related details of a low priority virtual machine. <br><br>Minimum api-version: 2019-03-01.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.billingProfile")]
public Microsoft.Azure.Management.Compute.Models.BillingProfile BillingProfile { get; set; }
Property Value
|
BillingProfile
|
DiagnosticsProfile
Gets or sets specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.diagnosticsProfile")]
public Microsoft.Azure.Management.Compute.Models.DiagnosticsProfile DiagnosticsProfile { get; set; }
Property Value
|
DiagnosticsProfile
|
EvictionPolicy
Gets or sets specifies the eviction policy for the low priority virtual machine. Only supported value is 'Deallocate'. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete'
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.evictionPolicy")]
public string EvictionPolicy { get; set; }
Property Value
|
String
|
HardwareProfile
Gets or sets specifies the hardware settings for the virtual machine.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.hardwareProfile")]
public Microsoft.Azure.Management.Compute.Models.HardwareProfile HardwareProfile { get; set; }
Property Value
|
HardwareProfile
|
Host
Gets or sets specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.host")]
public Microsoft.Azure.Management.Compute.Models.SubResource Host { get; set; }
Property Value
|
SubResource
|
Identity
Gets or sets the identity of the virtual machine, if configured.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="identity")]
public Microsoft.Azure.Management.Compute.Models.VirtualMachineIdentity Identity { get; set; }
Property Value
|
VirtualMachineIdentity
|
InstanceView
Gets the virtual machine instance view.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.instanceView")]
public Microsoft.Azure.Management.Compute.Models.VirtualMachineInstanceView InstanceView { get; }
Property Value
|
VirtualMachineInstanceView
|
LicenseType
Gets or sets specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see Azure Hybrid Use Benefit for Windows Server <br><br> Minimum api-version: 2015-06-15
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.licenseType")]
public string LicenseType { get; set; }
Property Value
|
String
|
NetworkProfile
Gets or sets specifies the network interfaces of the virtual machine.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.networkProfile")]
public Microsoft.Azure.Management.Compute.Models.NetworkProfile NetworkProfile { get; set; }
Property Value
|
NetworkProfile
|
OsProfile
Gets or sets specifies the operating system settings for the virtual machine.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.osProfile")]
public Microsoft.Azure.Management.Compute.Models.OSProfile OsProfile { get; set; }
Property Value
|
OSProfile
|
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 ->. Enter any required information and then click Save.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="plan")]
public Microsoft.Azure.Management.Compute.Models.Plan Plan { get; set; }
Property Value
|
Plan
|
Priority
Gets or sets specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low'
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.priority")]
public string Priority { get; set; }
Property Value
|
String
|
ProvisioningState
Gets the provisioning state, which only appears in the response.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.provisioningState")]
public string ProvisioningState { get; }
Property Value
|
String
|
ProximityPlacementGroup
Gets or sets specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.proximityPlacementGroup")]
public Microsoft.Azure.Management.Compute.Models.SubResource ProximityPlacementGroup { get; set; }
Property Value
|
SubResource
|
Resources
Gets the virtual machine child extension resources.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="resources")]
public System.Collections.Generic.IList<Microsoft.Azure.Management.Compute.Models.VirtualMachineExtension> Resources { get; }
Property Value
|
IList<VirtualMachineExtension>
|
StorageProfile
Gets or sets specifies the storage settings for the virtual machine disks.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.storageProfile")]
public Microsoft.Azure.Management.Compute.Models.StorageProfile StorageProfile { get; set; }
Property Value
|
StorageProfile
|
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. <br><br>This property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum api‐version: 2019‐03‐01
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.virtualMachineScaleSet")]
public Microsoft.Azure.Management.Compute.Models.SubResource VirtualMachineScaleSet { get; set; }
Property Value
|
SubResource
|
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.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="properties.vmId")]
public string VmId { get; }
Property Value
|
String
|
Zones
Gets or sets the virtual machine zones.
Declaration
[Newtonsoft.Json.JsonProperty(PropertyName="zones")]
public System.Collections.Generic.IList<string> Zones { get; set; }
Property Value
|
IList<String>
|
Methods
Validate()
Validate the object.
Declaration
public override void Validate ();
Exceptions
|
ValidationException
Thrown if validation fails |