New-AzVM
Creates a virtual machine.
Syntax
New-AzVM
[[-ResourceGroupName] <String>]
[[-Location] <String>]
[-EdgeZone <String>]
[[-Zone] <String[]>]
-Name <String>
-Credential <PSCredential>
[-NetworkInterfaceDeleteOption <String>]
[-VirtualNetworkName <String>]
[-AddressPrefix <String>]
[-SubnetName <String>]
[-SubnetAddressPrefix <String>]
[-PublicIpAddressName <String>]
[-DomainNameLabel <String>]
[-AllocationMethod <String>]
[-SecurityGroupName <String>]
[-OpenPorts <Int32[]>]
[-Image <String>]
[-Size <String>]
[-AvailabilitySetName <String>]
[-SystemAssignedIdentity]
[-UserAssignedIdentity <String>]
[-AsJob]
[-OSDiskDeleteOption <String>]
[-DataDiskSizeInGb <Int32[]>]
[-DataDiskDeleteOption <String>]
[-EnableUltraSSD]
[-ProximityPlacementGroupId <String>]
[-HostId <String>]
[-VmssId <String>]
[-Priority <String>]
[-EvictionPolicy <String>]
[-MaxPrice <Double>]
[-EncryptionAtHost]
[-HostGroupId <String>]
[-SshKeyName <String>]
[-GenerateSshKey]
[-CapacityReservationGroupId <String>]
[-UserData <String>]
[-ImageReferenceId <String>]
[-PlatformFaultDomain <Int32>]
[-HibernationEnabled]
[-vCPUCountAvailable <Int32>]
[-vCPUCountPerCore <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVM
[-ResourceGroupName] <String>
[-Location] <String>
[-EdgeZone <String>]
[-VM] <PSVirtualMachine>
[[-Zone] <String[]>]
[-DisableBginfoExtension]
[-Tag <Hashtable>]
[-LicenseType <String>]
[-AsJob]
[-OSDiskDeleteOption <String>]
[-DataDiskDeleteOption <String>]
[-SshKeyName <String>]
[-GenerateSshKey]
[-vCPUCountAvailable <Int32>]
[-vCPUCountPerCore <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVM
[[-ResourceGroupName] <String>]
[[-Location] <String>]
[-EdgeZone <String>]
-Name <String>
[-NetworkInterfaceDeleteOption <String>]
[-VirtualNetworkName <String>]
[-AddressPrefix <String>]
[-SubnetName <String>]
[-SubnetAddressPrefix <String>]
[-PublicIpAddressName <String>]
[-DomainNameLabel <String>]
[-AllocationMethod <String>]
[-SecurityGroupName <String>]
[-OpenPorts <Int32[]>]
-DiskFile <String>
[-Linux]
[-Size <String>]
[-AvailabilitySetName <String>]
[-SystemAssignedIdentity]
[-UserAssignedIdentity <String>]
[-AsJob]
[-OSDiskDeleteOption <String>]
[-DataDiskSizeInGb <Int32[]>]
[-DataDiskDeleteOption <String>]
[-EnableUltraSSD]
[-ProximityPlacementGroupId <String>]
[-HostId <String>]
[-VmssId <String>]
[-Priority <String>]
[-EvictionPolicy <String>]
[-MaxPrice <Double>]
[-EncryptionAtHost]
[-HostGroupId <String>]
[-CapacityReservationGroupId <String>]
[-UserData <String>]
[-ImageReferenceId <String>]
[-PlatformFaultDomain <Int32>]
[-HibernationEnabled]
[-vCPUCountAvailable <Int32>]
[-vCPUCountPerCore <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzVM cmdlet creates a virtual machine in Azure.
This cmdlet takes a virtual machine object as input.
Use the New-AzVMConfig cmdlet to create a virtual machine object.
The New-AzVM cmdlet will create a new storage account for boot diagnostics if one does not already exist.
Other cmdlets can be used to configure the virtual machine, such as Set-AzVMOperatingSystem, Set-AzVMSourceImage, Add-AzVMNetworkInterface, and Set-AzVMOSDisk.
The SimpleParameterSet
provides a convenient method to create a VM by making common VM creation arguments optional.
Examples
Example 1: Create a virtual machine
New-AzVM -Name MyVm -Credential (Get-Credential)
VERBOSE: Use 'mstsc /v:myvm-222222.eastus.cloudapp.azure.com' to connect to the VM.
ResourceGroupName : MyVm
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyVm/provi
ders/Microsoft.Compute/virtualMachines/MyVm
VmId : 11111111-1111-1111-1111-111111111111
Name : MyVm
Type : Microsoft.Compute/virtualMachines
Location : eastus
Tags : {}
HardwareProfile : {VmSize}
NetworkProfile : {NetworkInterfaces}
OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets}
ProvisioningState : Succeeded
StorageProfile : {ImageReference, OsDisk, DataDisks}
FullyQualifiedDomainName : myvm-222222.eastus.cloudapp.azure.com
This example script shows how to create a virtual machine. The script will ask a user name and password for the VM. This script uses several other cmdlets.
Example 2: Create a virtual machine from a custom user image
## VM Account
# Credentials for Local Admin account you created in the sysprepped (generalized) vhd image
$VMLocalAdminUser = "LocalAdminUser"
$VMLocalAdminSecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force
## Azure Account
$LocationName = "westus"
$ResourceGroupName = "MyResourceGroup"
# This a Premium_LRS storage account.
# It is required in order to run a client VM with efficiency and high performance.
$StorageAccount = "Mydisk"
## VM
$OSDiskName = "MyClient"
$ComputerName = "MyClientVM"
$OSDiskUri = "https://Mydisk.blob.core.windows.net/disks/MyOSDisk.vhd"
$SourceImageUri = "https://Mydisk.blob.core.windows.net/vhds/MyOSImage.vhd"
$VMName = "MyVM"
# Modern hardware environment with fast disk, high IOPs performance.
# Required to run a client VM with efficiency and performance
$VMSize = "Standard_DS3"
$OSDiskCaching = "ReadWrite"
$OSCreateOption = "FromImage"
## Networking
$DNSNameLabel = "mydnsname" # mydnsname.westus.cloudapp.azure.com
$NetworkName = "MyNet"
$NICName = "MyNIC"
$PublicIPAddressName = "MyPIP"
$SubnetName = "MySubnet"
$SubnetAddressPrefix = "10.0.0.0/24"
$VnetAddressPrefix = "10.0.0.0/16"
$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix
$Vnet = New-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroupName -Location $LocationName -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet
$PIP = New-AzPublicIpAddress -Name $PublicIPAddressName -DomainNameLabel $DNSNameLabel -ResourceGroupName $ResourceGroupName -Location $LocationName -AllocationMethod Dynamic
$NIC = New-AzNetworkInterface -Name $NICName -ResourceGroupName $ResourceGroupName -Location $LocationName -SubnetId $Vnet.Subnets[0].Id -PublicIpAddressId $PIP.Id
$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);
$VirtualMachine = New-AzVMConfig -VMName $VMName -VMSize $VMSize
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id
$VirtualMachine = Set-AzVMOSDisk -VM $VirtualMachine -Name $OSDiskName -VhdUri $OSDiskUri -SourceImageUri $SourceImageUri -Caching $OSDiskCaching -CreateOption $OSCreateOption -Windows
New-AzVM -ResourceGroupName $ResourceGroupName -Location $LocationName -VM $VirtualMachine -Verbose
This example takes an existing sys-prepped, generalized custom operating system image and attaches a data disk to it, provisions a new network, deploys the VHD, and runs it. This script can be used for automatic provisioning because it uses the local virtual machine admin credentials inline instead of calling Get-Credential which requires user interaction. This script assumes that you are already logged into your Azure account. You can confirm your login status by using the Get-AzSubscription cmdlet.
Example 3: Create a VM from a marketplace image without a Public IP
$VMLocalAdminUser = "LocalAdminUser"
$VMLocalAdminSecurePassword = ConvertTo-SecureString <password> -AsPlainText -Force
$LocationName = "westus"
$ResourceGroupName = "MyResourceGroup"
$ComputerName = "MyVM"
$VMName = "MyVM"
$VMSize = "Standard_DS3"
$NetworkName = "MyNet"
$NICName = "MyNIC"
$SubnetName = "MySubnet"
$SubnetAddressPrefix = "10.0.0.0/24"
$VnetAddressPrefix = "10.0.0.0/16"
$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix
$Vnet = New-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroupName -Location $LocationName -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet
$NIC = New-AzNetworkInterface -Name $NICName -ResourceGroupName $ResourceGroupName -Location $LocationName -SubnetId $Vnet.Subnets[0].Id
$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);
$VirtualMachine = New-AzVMConfig -VMName $VMName -VMSize $VMSize
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id
$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2012-R2-Datacenter' -Version latest
New-AzVM -ResourceGroupName $ResourceGroupName -Location $LocationName -VM $VirtualMachine -Verbose
This command creates a VM from a marketplace image without a Public IP.
Example 4: Create a VM with a UserData value:
## VM Account
$VMLocalAdminUser = "LocalAdminUser";
$VMLocalAdminSecurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force;
## Azure Account
$LocationName = "eastus";
$ResourceGroupName = "MyResourceGroup";
# VM Profile & Hardware
$VMName = 'v' + $ResourceGroupName;
$domainNameLabel = "d1" + $ResourceGroupName;
$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);
# Create UserData value
$text = "text for UserData";
$bytes = [System.Text.Encoding]::Unicode.GetBytes($text);
$userData = [Convert]::ToBase64String($bytes);
# Create VM
New-AzVM -ResourceGroupName $ResourceGroupName -Name $VMName -Credential $cred -DomainNameLabel $domainNameLabel -UserData $userData;
$vm = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $VMName -UserData;
The UserData value must always be Base64 encoded.
Example 5: Creating a new VM with an existing subnet in another resource group
$UserName = "User"
$Password = ConvertTo-SecureString "############" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($UserName, $Password)
$Vnet = $(Get-AzVirtualNetwork -ResourceGroupName ResourceGroup2 -Name VnetName)
$PIP = (Get-AzPublicIpAddress -ResourceGroupName ResourceGroup2 -Name PublicIPName)
$NIC = New-AzNetworkInterface -Name NICname -ResourceGroupName ResourceGroup2 -Location SouthCentralUS -SubnetId $Vnet.Subnets[1].Id -PublicIpAddressId $PIP.Id
$VirtualMachine = New-AzVMConfig -VMName VirtualMachineName -VMSize Standard_D4s_v3
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName computerName -Credential $psCred -ProvisionVMAgent -EnableAutoUpdate
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id
$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2012-R2-Datacenter' -Version latest
New-AzVm -ResourceGroupName ResourceGroup1 -Location SouthCentralUS -VM $VirtualMachine
This example deploys a Windows VM from the marketplace in one resource group with an existing subnet in another resource group.
Example 6: Creating a new VM as part of a VMSS with a PlatformFaultDomain value.
$resourceGroupName= <Resource Group Name>
$domainNameLabel = <Domain Name Label Name>
$vmname = "<Virtual Machine Name>
$platformFaultDomainVMDefaultSet = 2
$securePassword = <Password> | ConvertTo-SecureString -AsPlainText -Force
$user = <Username>
$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword)
$vmssName = <Vmss Name>;
$vmssConfig = New-AzVmssConfig -Location $loc -PlatformFaultDomainCount $vmssFaultDomain;
$vmss = New-AzVmss -ResourceGroupName $resourceGroupName -Name $vmssName -VirtualMachineScaleSet $vmssConfig;
$vm = New-AzVM -ResourceGroupName $resourceGroupName -Name $vmname -Credential $cred -DomainNameLabel $domainNameLabel -PlatformFaultDomain $platformFaultDomainVMDefaultSet -VmssId $vmss.Id
Parameters
The address prefix for the virtual network which will be created for the VM.
Type: | String |
Position: | Named |
Default value: | 192.168.0.0/16 |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The IP allocation method for the public IP which will be created for the VM.
Type: | String |
Accepted values: | Static, Dynamic |
Position: | Named |
Default value: | Static |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Run cmdlet in the background and return a Job to track progress.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a name for the availability set.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Id of the capacity reservation Group that is used to allocate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The administrator credentials for the VM.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies Data Disk delete option after VM deletion. Options are Detach, Delete
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the sizes of data disks in GB.
Type: | Int32[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that this cmdlet does not install the BG Info extension on the virtual machine.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The local path to the virtual hard disk file to be uploaded to the cloud and for creating the VM, and it must have '.vhd' as its suffix.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The subdomain label for the fully-qualified domain name (FQDN) of the VM. This will take the form {domainNameLabel}.{location}.cloudapp.azure.com
.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Use UltraSSD disks for the vm.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
EncryptionAtHost property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. Default: The Encryption at host will be disabled unless this property is set to true for the resource.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The eviction policy for the Azure Spot virtual machine. Supported values are 'Deallocate' and 'Delete'.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Generate a SSH Public/Private key pair and create a SSH Public Key resource on Azure.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The flag that enables or disables hibernation capability on the VM.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the dedicated host group the virtual machine will reside in.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The Id of Host
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The friendly image name upon which the VM will be built. These include: Win2019Datacenter, Win2016Datacenter, Win2012R2Datacenter, Win2012Datacenter, Win2008R2SP1, UbuntuLTS, CentOS, CoreOS, Debian, openSUSE-Leap, RHEL, SLES.
Type: | String |
Aliases: | ImageName |
Position: | Named |
Default value: | Win2016Datacenter |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a license type, which indicates that the image or disk for the virtual machine was licensed on-premises. Possible values for Windows Server are:
- Windows_Client
- Windows_Server Possible values for Linux Server operating system are:
- RHEL_BYOS (for RHEL)
- SLES_BYOS (for SUSE)
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates whether the disk file is for Linux VM, if specified; or Windows, if not specified by default.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a location for the virtual machine.
Type: | String |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The max price of the billing of a low priority virtual machine.
Type: | Double |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the VM resource.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies what action to perform on the NetworkInterface resource when the VM is deleted. Options are: Detach, Delete.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
A list of ports to open on the network security group (NSG) for the created VM. The default value depends on the type of image chosen (i.e., Windows: 3389, 5985 and Linux: 22).
Type: | Int32[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies OS Disk delete option after VM deletion. Options are Detach, Delete
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the fault domain of the virtual machine.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The priority for the virtual machine. Only supported values are 'Regular', 'Spot' and 'Low'. 'Regular' is for regular virtual machine. 'Spot' is for spot virtual machine. 'Low' is also for spot virtual machine but is replaced by 'Spot'. Please use 'Spot' instead of 'Low'.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The resource id of the Proximity Placement Group to use with this virtual machine.
Type: | String |
Aliases: | ProximityPlacementGroup |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of a new (or existing) public IP address for the created VM to use. If not specified, a name will be generated.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of a resource group.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of a new (or existing) network security group (NSG) for the created VM to use. If not specified, a name will be generated.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The Virtual Machine Size. The Default Value is: Standard_D2s_v3.
Type: | String |
Position: | Named |
Default value: | Standard_D2s_v3 |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Name of the SSH Public Key resource.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The address prefix for the subnet which will be created for the VM.
Type: | String |
Position: | Named |
Default value: | 192.168.1.0/24 |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of a new (or existing) subnet for the created VM to use. If not specified, a name will be generated.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
If the parameter is present then the VM is assigned a managed system identity that is auto generated.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The name of a managed service identity that should be assigned to the VM.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
UserData for the VM, which will be base-64 encoded. Customer should not pass any secrets in here.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of List all available virtual machine sizes in a region.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of List all available virtual machine sizes in a region. Setting this property to 1 also means that hyper-threading is disabled.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The name of a new (or existing) virtual network for the created VM to use. If not specified, a name will be generated.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a local virtual machine to create. To obtain a virtual machine object, use the New-AzVMConfig cmdlet. Other cmdlets can be used to configure the virtual machine, such as Set-AzVMOperatingSystem, Set-AzVMSourceImage, and Add-AzVMNetworkInterface.
Type: | PSVirtualMachine |
Aliases: | VMProfile |
Position: | 2 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The ID of Virtual Machine Scale Set that this VM will be associated with
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the zone list of the virtual machine.
Type: | String[] |
Position: | 3 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
String[]
Outputs
Related Links
Comentarios
Enviar y ver comentarios de