New-AzureRmVmssConfig

Creates a VMSS configuration object.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmVmssConfig
   [[-Overprovision] <Boolean>]
   [[-Location] <String>]
   [[-Tag] <Hashtable>]
   [[-SkuName] <String>]
   [[-SkuTier] <String>]
   [[-SkuCapacity] <Int32>]
   [[-UpgradePolicyMode] <UpgradeMode>]
   [[-OsProfile] <VirtualMachineScaleSetOSProfile>]
   [[-StorageProfile] <VirtualMachineScaleSetStorageProfile>]
   [[-NetworkInterfaceConfiguration] <VirtualMachineScaleSetNetworkConfiguration[]>]
   [[-Extension] <VirtualMachineScaleSetExtension[]>]
   [-SinglePlacementGroup <Boolean>]
   [-ZoneBalance]
   [-PlatformFaultDomainCount <Int32>]
   [-Zone <String[]>]
   [-PlanName <String>]
   [-PlanPublisher <String>]
   [-PlanProduct <String>]
   [-PlanPromotionCode <String>]
   [-RollingUpgradePolicy <RollingUpgradePolicy>]
   [-AutoOSUpgrade]
   [-DisableAutoRollback <Boolean>]
   [-EnableUltraSSD]
   [-HealthProbeId <String>]
   [-BootDiagnostic <BootDiagnostics>]
   [-LicenseType <String>]
   [-Priority <String>]
   [-EvictionPolicy <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmVmssConfig
   [[-Overprovision] <Boolean>]
   [[-Location] <String>]
   [[-Tag] <Hashtable>]
   [[-SkuName] <String>]
   [[-SkuTier] <String>]
   [[-SkuCapacity] <Int32>]
   [[-UpgradePolicyMode] <UpgradeMode>]
   [[-OsProfile] <VirtualMachineScaleSetOSProfile>]
   [[-StorageProfile] <VirtualMachineScaleSetStorageProfile>]
   [[-NetworkInterfaceConfiguration] <VirtualMachineScaleSetNetworkConfiguration[]>]
   [[-Extension] <VirtualMachineScaleSetExtension[]>]
   [-SinglePlacementGroup <Boolean>]
   [-ZoneBalance]
   [-PlatformFaultDomainCount <Int32>]
   [-Zone <String[]>]
   [-PlanName <String>]
   [-PlanPublisher <String>]
   [-PlanProduct <String>]
   [-PlanPromotionCode <String>]
   [-RollingUpgradePolicy <RollingUpgradePolicy>]
   [-AutoOSUpgrade]
   [-DisableAutoRollback <Boolean>]
   [-EnableUltraSSD]
   [-HealthProbeId <String>]
   [-BootDiagnostic <BootDiagnostics>]
   [-LicenseType <String>]
   [-Priority <String>]
   [-EvictionPolicy <String>]
   -IdentityType <ResourceIdentityType>
   [-IdentityId <String[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmVmssConfig
   [[-Overprovision] <Boolean>]
   [[-Location] <String>]
   [[-Tag] <Hashtable>]
   [[-SkuName] <String>]
   [[-SkuTier] <String>]
   [[-SkuCapacity] <Int32>]
   [[-UpgradePolicyMode] <UpgradeMode>]
   [[-OsProfile] <VirtualMachineScaleSetOSProfile>]
   [[-StorageProfile] <VirtualMachineScaleSetStorageProfile>]
   [[-NetworkInterfaceConfiguration] <VirtualMachineScaleSetNetworkConfiguration[]>]
   [[-Extension] <VirtualMachineScaleSetExtension[]>]
   [-SinglePlacementGroup <Boolean>]
   [-ZoneBalance]
   [-PlatformFaultDomainCount <Int32>]
   [-Zone <String[]>]
   [-PlanName <String>]
   [-PlanPublisher <String>]
   [-PlanProduct <String>]
   [-PlanPromotionCode <String>]
   [-RollingUpgradePolicy <RollingUpgradePolicy>]
   [-AutoOSUpgrade]
   [-DisableAutoRollback <Boolean>]
   [-EnableUltraSSD]
   [-HealthProbeId <String>]
   [-BootDiagnostic <BootDiagnostics>]
   [-LicenseType <String>]
   [-Priority <String>]
   [-EvictionPolicy <String>]
   [-AssignIdentity]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmVmssConfig cmdlet creates a configurable local Virtual Manager Scale Set (VMSS) object. Other cmdlets are needed to configure the VMSS object. These cmdlets are:

  • Set-AzureRmVmssOsProfile
  • Set-AzureRmVmssStorageProfile
  • Add-AzureRmVmssNetworkInterfaceConfiguration
  • Add-AzureRmVmssExtension

Examples

Example 1: Create a VMSS configuration object

PS C:\> $VMSS = New-AzureRmVmssConfig -Location $Loc -SkuCapacity 2 -SkuName "Standard_A0" -UpgradePolicyMode "Automatic" -NetworkInterfaceConfiguration $NetCfg `
            | Add-AzureRmVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg `
            | Set-AzureRmVmssOSProfile -ComputerNamePrefix "Test" -AdminUsername $adminUsername -AdminPassword $AdminPassword `
            | Set-AzureRmVmssStorageProfile -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" `
            -ImageReferenceOffer $ImgRef.Offer -ImageReferenceSku $ImgRef.Skus -ImageReferenceVersion $ImgRef.Version `
            -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VHDContainer `
            | Add-AzureRmVmssAdditionalUnattendContent -ComponentName  $AUCComponentName -Content  $AUCContent -PassName  $AUCPassName -SettingName  $AUCSetting `
            | Remove-AzureRmVmssAdditionalUnattendContent -ComponentName  $AUCComponentName;

New-AzureRmVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS;

This example creates a VMSS configuration object. The first command uses the New-AzureRmVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The second command uses the New-AzureRmVmss cmdlet to create a VMSS that uses the VMSS configuration object created in the first command.

Parameters

-AssignIdentity

Specify the system assigned identity for the virtual machine scale set.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AutoOSUpgrade

Sets whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the image becomes available.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-BootDiagnostic

Specifies the virtual machine scale set boot diagnostics profile.

Type:BootDiagnostics
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableAutoRollback

Disable Auto Rollback for Auto OS Upgrade Policy

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableUltraSSD

Enables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the virtual machine scale set. Managed disks with storage account type UltraSSD_LRS can be added to a VMSS only if this property is enabled.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-EvictionPolicy

Specifies the eviction policy for the virtual machines in the scale set.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Extension

Specifies the extension information object for the VMSS. You can use the Add-AzureRmVmssExtension cmdlet to add this object.

Type:VirtualMachineScaleSetExtension[]
Position:10
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-HealthProbeId

Specifies the ID of a load balancer probe used to determine the health of an instance in the virtual machine scale set. HealthProbeId is in the form of '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-IdentityId

Specifies the list of user identities associated with the virtual machine scale set. The user identity references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-IdentityType

Specifies the type of identity used for the virtual machine scale set. The type 'SystemAssignedUserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. The acceptable values for this parameter are:

  • SystemAssigned
  • UserAssigned
  • SystemAssignedUserAssigned
  • None
Type:Nullable<T>[ResourceIdentityType]
Accepted values:SystemAssigned, UserAssigned, SystemAssignedUserAssigned, None
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-LicenseType

Specify the license type, which is for bringing your own license scenario.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Location

Specifies the Azure location where the VMSS is created.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-NetworkInterfaceConfiguration

Specifies the network profile object that contains the networking properties for the VMSS configuration. You can use the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet to add this object.

Type:VirtualMachineScaleSetNetworkConfiguration[]
Position:9
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-OsProfile

Specifies the operating system profile object that contains the operating system properties for the VMSS configuration. You can use the Set-AzureRmVmssOsProfile cmdlet to set this object.

Type:VirtualMachineScaleSetOSProfile
Position:7
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Overprovision

Indicates whether the cmdlet overprovisions the VMSS.

Type:Nullable<T>[Boolean]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PlanName

Specifies the plan name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PlanProduct

Specifies the plan product.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PlanPromotionCode

Specifies the plan promotion code.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PlanPublisher

Specifies the plan publisher.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PlatformFaultDomainCount

Fault Domain count for each placement group.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Priority

Specifies the priority for the virtual machines in the scale set.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RollingUpgradePolicy

Specifies the rolling upgrade policy.

Type:RollingUpgradePolicy
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SinglePlacementGroup

Specifies the single placement group.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SkuCapacity

Specifies the number of instances in the VMSS.

Type:Int32
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SkuName

Specifies the size of all the instances of VMSS.

Type:String
Aliases:AccountType
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SkuTier

Specifies the tier of VMSS. The acceptable values for this parameter are:

  • Standard
  • Basic
Type:String
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StorageProfile

Specifies the storage profile object that contains the disk properties for the VMSS configuration. You can use the Set-AzureRmVmssStorageProfile cmdlet to set this object.

Type:VirtualMachineScaleSetStorageProfile
Position:8
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Key-value pairs in the form of a hash table. For example: @{key0="value0";key1=$null;key2="value2"}

Type:Hashtable
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UpgradePolicyMode

Specified the mode of an upgrade to virtual machines in the scale set. The acceptable values for this parameter are:

  • Automatic
  • Manual
Type:Nullable<T>[UpgradeMode]
Accepted values:Automatic, Manual, Rolling
Position:6
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Zone

Specifies the zone list for the virtual machine scale set.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ZoneBalance

Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Nullable<T>[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

String

Hashtable

Int32

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.UpgradeMode, Microsoft.Azure.Management.Compute, Version=21.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

VirtualMachineScaleSetOSProfile

VirtualMachineScaleSetStorageProfile

VirtualMachineScaleSetNetworkConfiguration[]

VirtualMachineScaleSetExtension[]

String[]

RollingUpgradePolicy

BootDiagnostics

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.ResourceIdentityType, Microsoft.Azure.Management.Compute, Version=21.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

Outputs

PSVirtualMachineScaleSet