Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzVmss
- Module:
- Az.Compute Module
Creates a virtual machine scale set.
Syntax
DefaultParameter (Default)
New-AzVmss
[-ResourceGroupName] <String>
[-VMScaleSetName] <String>
[-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
[-AsJob]
[-IfMatch <String>]
[-IfNoneMatch <String>]
[-EdgeZone <String>]
[-HighSpeedInterconnectPlacement <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SimpleParameterSet
New-AzVmss
[[-ResourceGroupName] <String>]
[-VMScaleSetName] <String>
-Credential <PSCredential>
[-AsJob]
[-UserData <String>]
[-EnableAutomaticOSUpgrade]
[-IfMatch <String>]
[-IfNoneMatch <String>]
[-ImageName <String>]
[-InstanceCount <Int32>]
[-VirtualNetworkName <String>]
[-SubnetName <String>]
[-PublicIpAddressName <String>]
[-DomainNameLabel <String>]
[-SecurityGroupName <String>]
[-LoadBalancerName <String>]
[-BackendPort <Int32[]>]
[-Location <String>]
[-EdgeZone <String>]
[-VmSize <String>]
[-UpgradePolicyMode <UpgradeMode>]
[-AllocationMethod <String>]
[-VnetAddressPrefix <String>]
[-SubnetAddressPrefix <String>]
[-FrontendPoolName <String>]
[-BackendPoolName <String>]
[-SystemAssignedIdentity]
[-UserAssignedIdentity <String>]
[-EnableUltraSSD]
[-Zone <System.Collections.Generic.List`1[System.String]>]
[-NatBackendPort <Int32[]>]
[-DataDiskSizeInGb <Int32[]>]
[-ProximityPlacementGroupId <String>]
[-HostGroupId <String>]
[-Priority <String>]
[-EvictionPolicy <String>]
[-MaxPrice <Double>]
[-ScaleInPolicy <String[]>]
[-SkipExtensionsOnOverprovisionedVMs]
[-EncryptionAtHost]
[-PlatformFaultDomainCount <Int32>]
[-OrchestrationMode <String>]
[-CapacityReservationGroupId <String>]
[-ImageReferenceId <String>]
[-DiskControllerType <String>]
[-SharedGalleryImageId <String>]
[-SecurityType <String>]
[-EnableVtpm <Boolean>]
[-EnableSecureBoot <Boolean>]
[-SecurityPostureId <String>]
[-SecurityPostureExcludeExtension <String[]>]
[-SkuProfileVmSize <String[]>]
[-SkuProfileAllocationStrategy <String>]
[-EnableProxyAgent]
[-AddProxyAgentExtension]
[-ZonePlacementPolicy <String>]
[-IncludeZone <String[]>]
[-ExcludeZone <String[]>]
[-HighSpeedInterconnectPlacement <String>]
[-ZonalPlatformFaultDomainAlignMode <String>]
[-DefaultProfile <IAzureContextContainer>]
[-SinglePlacementGroup]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzVmss cmdlet creates a Virtual Machine Scale Set (VMSS) in Azure.
Use the simple parameter set (SimpleParameterSet) to quickly create a pre-set VMSS and associated resources.
Use the default parameter set (DefaultParameter) for more advanced scenarios when you need to precisely configure each component of the VMSS and each associated resource before creation.
For default parameter set, first use the New-AzVmssConfig cmdlet to create a virtual machine scale set object.
Then use the following cmdlets to set different properties of the virtual machine scale set object:
- Add-AzVmssNetworkInterfaceConfiguration to set the network profile.
- Set-AzVmssOsProfile to set the OS profile.
- Set-AzVmssStorageProfile to set the storage profile.
- Get-AzComputeResourceSku can also be used to find out available virtual machine sizes for your subscription and region.
See other cmdlets for virtual machine scale set here.
VMSS creation will default to OrchestrationMode:Flexible. Default parameter set will set properties in VirtualMachineScaleSetVMProfile by default. To create a VMSS with an empty VirtualMachineScaleSetVMProfile property, use simple parameter set by first creating a VirtualMachineScaleSet object with an empty VirtualMachineScaleSetVMProfile property using New-AzVmssConfig.
See [Quickstart: Create a virtual machine scale set with Azure PowerShell](https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/quick-create-powershell) for tutorial.
Examples
Example 1: Create a VMSS using the SimpleParameterSet
$vmssName = 'VMSSNAME'
# Create credentials, I am using one way to create credentials, there are others as well.
# Pick one that makes the most sense according to your use case.
$vmPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force
$vmCred = New-Object System.Management.Automation.PSCredential('USERNAME', $vmPassword)
$securityTypeStnd = "Standard"
#Create a VMSS using the default settings
New-AzVmss -Credential $vmCred -VMScaleSetName $vmssName -SecurityType $securityTypeStnd
The command above creates the following with the name $vmssName :
- A Resource Group
- A virtual network
- A load balancer
- A public IP
- the VMSS with 2 instances
The default image chosen for the VMs in the VMSS is 2016-Datacenter Windows Server and the SKU is Standard_DS1_v2
Example 2: Create a VMSS using the DefaultParameterSet
# Common
$LOC = "WestUs";
$RGName = "rgkyvms";
New-AzResourceGroup -Name $RGName -Location $LOC -Force;
# SRP
$STOName = "sto" + $RGName;
$STOType = "Standard_GRS";
New-AzStorageAccount -ResourceGroupName $RGName -Name $STOName -Location $LOC -Type $STOType;
$STOAccount = Get-AzStorageAccount -ResourceGroupName $RGName -Name $STOName;
# NRP
$SubNet = New-AzVirtualNetworkSubnetConfig -Name ("subnet" + $RGName) -AddressPrefix "10.0.0.0/24";
$VNet = New-AzVirtualNetwork -Force -Name ("vnet" + $RGName) -ResourceGroupName $RGName -Location $LOC -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $SubNet;
$VNet = Get-AzVirtualNetwork -Name ('vnet' + $RGName) -ResourceGroupName $RGName;
$SubNetId = $VNet.Subnets[0].Id;
$PubIP = New-AzPublicIpAddress -Force -Name ("pubip" + $RGName) -ResourceGroupName $RGName -Location $LOC -AllocationMethod Dynamic -DomainNameLabel ("pubip" + $RGName);
$PubIP = Get-AzPublicIpAddress -Name ("pubip" + $RGName) -ResourceGroupName $RGName;
# Create LoadBalancer
$FrontendName = "fe" + $RGName
$BackendAddressPoolName = "bepool" + $RGName
$ProbeName = "vmssprobe" + $RGName
$InboundNatPoolName = "innatpool" + $RGName
$LBRuleName = "lbrule" + $RGName
$LBName = "vmsslb" + $RGName
$Frontend = New-AzLoadBalancerFrontendIpConfig -Name $FrontendName -PublicIpAddress $PubIP
$BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName
$Probe = New-AzLoadBalancerProbeConfig -Name $ProbeName -RequestPath healthcheck.aspx -Protocol http -Port 80 -IntervalInSeconds 15 -ProbeCount 2
$InboundNatPool = New-AzLoadBalancerInboundNatPoolConfig -Name $InboundNatPoolName -FrontendIPConfigurationId `
$Frontend.Id -Protocol Tcp -FrontendPortRangeStart 3360 -FrontendPortRangeEnd 3367 -BackendPort 3370;
$LBRule = New-AzLoadBalancerRuleConfig -Name $LBRuleName `
-FrontendIPConfiguration $Frontend -BackendAddressPool $BackendAddressPool `
-Probe $Probe -Protocol Tcp -FrontendPort 80 -BackendPort 80 `
-IdleTimeoutInMinutes 15 -EnableFloatingIP -LoadDistribution SourceIP;
$ActualLb = New-AzLoadBalancer -Name $LBName -ResourceGroupName $RGName -Location $LOC `
-FrontendIpConfiguration $Frontend -BackendAddressPool $BackendAddressPool `
-Probe $Probe -LoadBalancingRule $LBRule -InboundNatPool $InboundNatPool;
$ExpectedLb = Get-AzLoadBalancer -Name $LBName -ResourceGroupName $RGName
# New VMSS Parameters
$VMSSName = "vmss" + $RGName;
$AdminUsername = "Admin01";
$AdminPassword = "p4ssw0rd@123" + $RGName;
$PublisherName = "MicrosoftWindowsServer"
$Offer = "WindowsServer"
$Sku = "2012-R2-Datacenter"
$Version = "latest"
$VHDContainer = "https://" + $STOName + ".blob.core.windows.net/" + $VMSSName;
$ExtName = "CSETest";
$Publisher = "Microsoft.Compute";
$ExtType = "BGInfo";
$ExtVer = "2.1";
#IP Config for the NIC
$IPCfg = New-AzVmssIpConfig -Name "Test" `
-LoadBalancerInboundNatPoolsId $ExpectedLb.InboundNatPools[0].Id `
-LoadBalancerBackendAddressPoolsId $ExpectedLb.BackendAddressPools[0].Id `
-SubnetId $SubNetId;
#VMSS Config
$securityTypeStnd = "Standard";
$VMSS = New-AzVmssConfig -Location $LOC -SkuCapacity 2 -SkuName "Standard_E4-2ds_v4" -UpgradePolicyMode "Automatic" -SecurityType $securityTypeStnd `
| Add-AzVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg `
| Add-AzVmssNetworkInterfaceConfiguration -Name "Test2" -IPConfiguration $IPCfg `
| Set-AzVmssOsProfile -ComputerNamePrefix "Test" -AdminUsername $AdminUsername -AdminPassword $AdminPassword `
| Set-AzVmssStorageProfile -Name "Test" -OsDiskCreateOption 'FromImage' -OsDiskCaching "None" `
-ImageReferenceOffer $Offer -ImageReferenceSku $Sku -ImageReferenceVersion $Version `
-ImageReferencePublisher $PublisherName -VhdContainer $VHDContainer `
| Add-AzVmssExtension -Name $ExtName -Publisher $Publisher -Type $ExtType -TypeHandlerVersion $ExtVer -AutoUpgradeMinorVersion $True
#Create the VMSS
New-AzVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS;
The complex example above creates a VMSS, following is an explanation of what is happening:
- The first command creates a resource group with the specified name and location.
- The second command uses the New-AzStorageAccount cmdlet to create a storage account.
- The third command then uses the Get-AzStorageAccount cmdlet to get the storage account created in the second command and stores the result in the $STOAccount variable.
- The fifth command uses the New-AzVirtualNetworkSubnetConfig cmdlet to create a subnet and stores the result in the variable named $SubNet.
- The sixth command uses the New-AzVirtualNetwork cmdlet to create a virtual network and stores the result in the variable named $VNet.
- The seventh command uses the Get-AzVirtualNetwork to get information about the virtual network created in the sixth command and stores the information in the variable named $VNet.
- The eighth and ninth command uses the New-AzPublicIpAddress and Get- AzureRmPublicIpAddress to create and get information from that public IP address.
- The commands store the information in the variable named $PubIP.
- The tenth command uses the New- AzureRmLoadBalancerFrontendIpConfig cmdlet to create a frontend load balancer and stores the result in the variable named $Frontend.
- The eleventh command uses the New-AzLoadBalancerBackendAddressPoolConfig to create a backend address pool configuration and stores the result in the variable named $BackendAddressPool.
- The twelfth command uses the New-AzLoadBalancerProbeConfig to create a probe and stores the probe information in the variable named $Probe.
- The thirteenth command uses the New-AzLoadBalancerInboundNatPoolConfig cmdlet to create a load balancer inbound network address translation (NAT) pool configuration.
- The fourteenth command uses the New-AzLoadBalancerRuleConfig to create a load balancer rule configuration and stores the result in the variable named $LBRule.
- The fifteenth command uses the New-AzLoadBalancer cmdlet to create a load balancer and stores the result in the variable named $ActualLb.
- The sixteenth command uses the Get-AzLoadBalancer to get information about the load balancer that was created in the fifteenth command and stores the information in the variable named $ExpectedLb.
- The seventeenth command uses the New-AzVmssIpConfig cmdlet to create a VMSS IP configuration and stores the information in the variable named $IPCfg.
- The eighteenth command uses the New-AzVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS.
- The nineteenth command uses the New-AzVmss cmdlet to create the VMSS.
Example 3: Create a VMSS with a UserData value
$ResourceGroupName = 'RESOURCE GROUP NAME';
$vmssName = 'VMSSNAME';
$domainNameLabel = "dnl" + $ResourceGroupName;
# Create credentials, I am using one way to create credentials, there are others as well.
# Pick one that makes the most sense according to your use case.
$vmPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force;
$vmCred = New-Object System.Management.Automation.PSCredential('USERNAME', $vmPassword);
$text = "UserData value to encode";
$bytes = [System.Text.Encoding]::Unicode.GetBytes($text);
$userData = [Convert]::ToBase64String($bytes);
$securityTypeStnd = "Standard";
#Create a VMSS
New-AzVmss -ResourceGroupName $ResourceGroupName -Name $vmssName -Credential $vmCred -DomainNameLabel $domainNameLabel -Userdata $userData -SecurityType $securityTypeStnd;
$vmss = Get-AzVmss -ResourceGroupName $ResourceGroupName -VMScaleSetName $vmssName -InstanceView:$false -Userdata;
Create a VMSS with a UserData value
Example 4: Create a Vmss with the security type TrustedLaunch
$rgname = "rgname";
$loc = "eastus";
# VMSS Profile & Hardware requirements for the TrustedLaunch default behavior.
$vmssSize = 'Standard_D4s_v3';
$vmssName1 = 'vmss1' + $rgname;
$imageName = "Win2022AzureEdition";
$adminUsername = "<Username>";
$adminPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force;
$vmCred = New-Object System.Management.Automation.PSCredential ($adminUsername, $adminPassword);
# VMSS Creation
$result = New-AzVmss -Credential $vmCred -VMScaleSetName $vmssName1 -ImageName $imageName -SecurityType "TrustedLaunch";
# Validate that for -SecurityType "TrustedLaunch", "-Vtpm" and -"SecureBoot" are "Enabled/true"
# $result.VirtualMachineProfile.SecurityProfile.UefiSettings.VTpmEnabled;
# $result.VirtualMachineProfile.SecurityProfile.UefiSettings.SecureBootEnabled;
This example Creates a new VMSS with the new Security Type 'TrustedLaunch' and the necessary UEFISettings values, VTpmEnabled and SecureBootEnabled are true. Please check the Trusted Launch feature page for more information.
Example 5: Create a Vmss in Orchestration Mode: Flexible by default
# Create configuration object
$vmssConfig = New-AzVmssConfig -Location EastUs2 -UpgradePolicyMode Manual -SinglePlacementGroup $true
# VMSS Creation
New-AzVmss -ResourceGroupName TestRg -VMScaleSetName myVMSS -VirtualMachineScaleSet $vmssConfig
This example Creates a new VMSS and it will default to OrchestrationMode Flexible.
Example 6: Create a new VMSS with TrustedLaunch turned on by default.
$rgname = "<Resource Group>";
$loc = "<Azure Region>";
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$vmssName = 'vmss' + $rgname;
$vmssSize = 'Standard_D4s_v3';
$imageName = "Win2022AzureEdition";
$publisherName = "MicrosoftWindowsServer";
$offer = "WindowsServer";
$sku = "2022-Datacenter-Azure-Edition";
$adminUsername = "<Username>";
$password = "<Password>";
# NRP
$vnetworkName = 'vnet' + $rgname;
$subnetName = 'subnet' + $rgname;
$subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix "10.0.0.0/24";
$vnet = New-AzVirtualNetwork -Name $vnetworkName -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet;
$vnet = Get-AzVirtualNetwork -Name $vnetworkName -ResourceGroupName $rgname;
$subnetId = $vnet.Subnets[0].Id;
$ipCfg = New-AzVmssIpConfig -Name 'test' -SubnetId $subnetId;
$vmss = New-AzVmssConfig -Location $loc -SkuCapacity 2 -SkuName $vmssSize -UpgradePolicyMode 'Manual' `
| Add-AzVmssNetworkInterfaceConfiguration -Name 'test' -Primary $true -IPConfiguration $ipCfg `
| Set-AzVmssOsProfile -ComputerNamePrefix 'test' -AdminUsername $adminUsername -AdminPassword $password;
# Create TL Vmss
$result = New-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName -VirtualMachineScaleSet $vmss;
$vmssGet = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName;
# Verify $vmssGet.VirtualMachineProfile.SecurityProfile.SecurityType is TrustedLaunch.
# Verify $vmssGet.VirtualMachineProfile.SecurityProfile.UefiSettings.VTpmEnabled is True.
# Verify $vmssGet.VirtualMachineProfile.SecurityProfile.UefiSettings.SecureBootEnabled is True.
# Verify $vmssGet.VirtualMachineProfile.StorageProfile.ImageReference.Sku is 2022-Datacenter-Azure-Edition.
The virtual machine scale set above has Trusted Launch enabled by default. Please check the Trusted Launch feature page for more information.
Parameters
-AddProxyAgentExtension
Specifies whether to implicitly install the ProxyAgent Extension. This option is currently applicable only for Linux OS.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-AllocationMethod
Allocation method for the Public IP Address of the Scale Set (Static or Dynamic). If no value is supplied, allocation will be static.
Parameter properties
| Type: | String |
| Default value: | Static |
| Accepted values: | Static, Dynamic |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-AsJob
Run cmdlet in the background and return a Job to track progress.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-BackendPoolName
The name of the backend address pool to use in the load balancer for this Scale Set. If no value is provided, a new backend pool will be created, with the same name as the Scale Set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-BackendPort
Backend port numbers used by the Scale Set load balancer to communicate with VMs in the Scale Set. If no values are specified, ports 3389 and 5985 will be used for Windows VMS, and port 22 will be used for Linux VMs.
Parameter properties
| Type: | Int32[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-CapacityReservationGroupId
Id of the capacity reservation Group that is used to allocate.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-Credential
The administrator credentials (username and password) for VMs in this Scale Set.
Username
Restriction:
Windows: Cannot contain special characters /""[]:|<>+=;,?*@& or end in "."
Linux: Username must only contain letters, numbers, hyphens, and underscores and may not start with a hyphen or number.
Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
Minimum-length: 1 character
Max-length: 20 characters for Windows, 64 characters for Linux
Password
Must have 3 of the following: 1 lower case character, 1 upper case character, 1 number, and 1 special character.
The value must be between 12 and 123 characters long.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DataDiskSizeInGb
Specifies the sizes of data disks in GB.
Parameter properties
| Type: | Int32[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-DiskControllerType
Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property is only supported for virtual machines whose operating system disk and VM sku supports Generation 2 (https://learn.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned as part of VM sku capabilities in the response of Microsoft.Compute SKUs api for the region contains V2 (https://learn.microsoft.com/rest/api/compute/resourceskus/list) .
For more information about Disk Controller Types supported please refer to https://aka.ms/azure-diskcontrollertypes.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-DomainNameLabel
The domain name label for the public Fully-Qualified domain name (FQDN) for this Scale Set. This is the first component of the domain name that is automatically assigned to the Scale Set. Automatically assigned Domain names use the form (<DomainNameLabel>.<Location>.cloudapp.azure.com). If no value is supplied, the default domain name label will be the concatenation of <ScaleSetName> and <ResourceGroupName>.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EdgeZone
Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EnableAutomaticOSUpgrade
Whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the image becomes available.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EnableProxyAgent
Specifies whether Metadata Security Protocol(ProxyAgent) feature should be enabled or not.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EnableSecureBoot
Specifies whether secure boot should be enabled on the virtual machine.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EnableUltraSSD
Use UltraSSD disks for the VMs in the scale set.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EnableVtpm
Specifies whether vTPM should be enabled on the virtual machine.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EncryptionAtHost
This parameter 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.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-EvictionPolicy
The eviction policy for the low priority virtual machine scale set. Only supported values are 'Deallocate' and 'Delete'.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ExcludeZone
This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-FrontendPoolName
The name of the frontend address pool to use in the Scale Set load balancer. If no value is supplied, a new Frontend Address Pool will be created, with the same name as the scale set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-HighSpeedInterconnectPlacement
Specifies the high speed interconnect placement for the virtual machine scale set.
Parameter properties
| Type: | String |
| Default value: | None |
| Accepted values: | None, Trunk |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-HostGroupId
Specifies the dedicated host group the virtual machine scale set will reside in.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | HostGroup |
Parameter sets
-IfMatch
used to make a request conditional for the PUT and other non-safe methods. The server will only return the requested resources if the resource matches one of the listed ETag values. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-IfNoneMatch
Used to make a request conditional for the GET and HEAD methods. The server will only return the requested resources if none of the listed ETag values match the current entity. Used to make a request conditional for the GET and HEAD methods. The server will only return the requested resources if none of the listed ETag values match the current entity. Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ImageName
The alias of the image for VMs in this Scale Set. If no value is provided, the "Windows Server 2016 DataCenter" image will be used. The available aliases are: Win2022AzureEdition, Win2022AzureEditionCore, Win2019Datacenter, Win2016Datacenter, Win2012R2Datacenter, Win2012Datacenter, UbuntuLTS, Ubuntu2204, CentOS85Gen2, Debian11, OpenSuseLeap154Gen2, RHELRaw8LVMGen2, SuseSles15SP3, FlatcarLinuxFreeGen2.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Image |
Parameter sets
-ImageReferenceId
Specified the shared gallery image unique id for vmss deployment. This can be fetched from shared gallery image GET call.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-IncludeZone
This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InstanceCount
The number of VM images in the Scale Set. If no value is provided, 2 instances will be created.
Parameter properties
| Type: | Int32 |
| Default value: | 2 |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-LoadBalancerName
The name of the load balancer to use with this Scale Set. A new load balancer using the same name as the Scale Set will be created if no value is specified.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Location
The Azure location where this Scale Set will be created. If no value is specified, the location will be inferred from the location of other resources referenced in the parameters.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MaxPrice
The max price of the billing of a low priority virtual machine scale set.
Parameter properties
| Type: | Double |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-NatBackendPort
Backend port for inbound network address translation.
Parameter properties
| Type: | Int32[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-OrchestrationMode
Specifies the orchestration mode for the virtual machine scale set. Possible values: Uniform, Flexible
Creating a VMSS in OrchestrationMode:Flexible using default parameter set will result in having the VirtualMachineScaleSetVMProfile being populated by default. If you want to create a VMSS with an empty VirtualMachineScaleSetVMProfile, first create a VirtualMachineScaleSet object with empty VMProfile property using New-AzVmssConfig, then create the VMSS using simple parameter set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PlatformFaultDomainCount
Fault Domain count for each placement group.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Priority
The priority for the virtual machine in the scale set. 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'.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ProximityPlacementGroupId
The resource id of the Proximity Placement Group to use with this scale set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ProximityPlacementGroup |
Parameter sets
-PublicIpAddressName
The name of the public IP Address to use with this scale set. A new Public IPAddress with the same name as the Scale Set will be created if no value is provided.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
Specifies the name of the resource group of the VMSS. If no value is specified, a new ResourceGroup will be created using the same name as the Scale Set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScaleInPolicy
The rules to be followed when scaling-in a virtual machine scale set. Possible values are: 'Default', 'OldestVM' and 'NewestVM'. 'Default' when a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. 'OldestVM' when a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. 'NewestVM' when a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SecurityGroupName
The name of the network security group to apply to this Scale Set. If no value is provided, a default network security group with the same name as the Scale Set will be created and applied to the Scale Set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SecurityPostureExcludeExtension
List of virtual machine extensions to exclude when applying the security posture.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SecurityPostureId
The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SecurityType
Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. UefiSettings will not be enabled unless this property is set.
Parameter properties
| Type: | String |
| Default value: | None |
| Accepted values: | TrustedLaunch, ConfidentialVM, Standard |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SharedGalleryImageId
Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SinglePlacementGroup
Use this to create the Scale set in a single placement group, default is multiple groups
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SkipExtensionsOnOverprovisionedVMs
Specifies that the extensions do not run on the extra overprovisioned VMs.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SkuProfileAllocationStrategy
Allocation strategy for the SKU profile.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SkuProfileVmSize
Array of VM sizes for the scale set.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SubnetAddressPrefix
The address prefix of the Subnet this ScaleSet will use. Default Subnet settings (192.168.1.0/24) will be applied if no value is provided.
Parameter properties
| Type: | String |
| Default value: | 192.168.1.0/24 |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SubnetName
The name of the subnet to use with this Scale Set. A new Subnet will be created with the same name as the Scale Set if no value is provided.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SystemAssignedIdentity
If the parameter is present then the VM(s) in the scale set is(are) assigned a managed system identity that is auto generated.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-UpgradePolicyMode
The upgrade policy mode for VM instances in this Scale Set. Upgrade policy could specify Automatic, Manual, or Rolling upgrades.
Parameter properties
| Type: | UpgradeMode |
| Default value: | None |
| Accepted values: | Automatic, Manual, Rolling |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-UserAssignedIdentity
The name of a managed service identity that should be assigned to the VM(s) in the scale set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-UserData
UserData for the Vmss, which will be base-64 encoded. Customer should not pass any secrets in here.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-VirtualMachineScaleSet
Specifies the VirtualMachineScaleSet object that contains the properties of the VMSS that this cmdlet creates.
Parameter properties
| Type: | PSVirtualMachineScaleSet |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-VirtualNetworkName
The name fo the Virtual Network to use with this scale set. If no value is supplied, a new virtual network with the same name as the Scale Set will be created.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-VMScaleSetName
Specifies the name of the VMSS that this cmdlet creates.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Name |
Parameter sets
-VmSize
The size of the VM instances in this scale set. Get-AzComputeResourceSku can be used to find out available sizes for your subscription and region. A default size (Standard_DS1_v2) will be used if no Size is specified.
Parameter properties
| Type: | String |
| Default value: | Standard_DS1_v2 |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-VnetAddressPrefix
The address prefix for the virtual network used with this Scale Set. Default virtual network address prefix settings (192.168.0.0/16) will be used if no value is supplied.
Parameter properties
| Type: | String |
| Default value: | 192.168.0.0/16 |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
-ZonalPlatformFaultDomainAlignMode
Specifies the align mode between Virtual Machine Scale Set (VMSS) compute and storage Fault Domain count. Valid values are 'Aligned', 'Unaligned', and 'BestEffortAligned'. 'BestEffortAligned' offloads alignment to VMSS - disks that support enough Storage Fault Domains are aligned, while others remain unaligned, preventing deployment failures for mixed-SKU disk configurations. Applicable to VMSS Flex only.
Parameter properties
| Type: | String |
| Default value: | None |
| Accepted values: | Aligned, Unaligned, BestEffortAligned |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Zone
A list of availability zones denoting the IP allocated for the resource needs to come from.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ZonePlacementPolicy
Specifies the policy for resource's placement in availability zone. Possible values are: Any (used for Virtual Machines), Auto (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
PSVirtualMachineScaleSet
List<T>
Outputs
PSVirtualMachineScaleSet
Related Links
Azure PowerShell
Feedback
Was this page helpful?
