New-​Azure​Rm​Vmss​Config

Creates a VMSS configuration object.

Syntax

New-AzureRmVmssConfig
   [[-Overprovision] <Boolean>]
   [[-Location] <String>]
   [[-Extension] <VirtualMachineScaleSetExtension[]>]
   [[-Tag] <Hashtable>]
   [[-SkuName] <String>]
   [[-SkuTier] <String>]
   [[-SkuCapacity] <Int64>]
   [[-UpgradePolicyMode] <UpgradeMode>]
   [[-OsProfile] <VirtualMachineScaleSetOSProfile>]
   [[-StorageProfile] <VirtualMachineScaleSetStorageProfile>]
   [[-NetworkInterfaceConfiguration] <VirtualMachineScaleSetNetworkConfiguration[]>]
   [-BootDiagnostic <BootDiagnostics>]
   [-IdentityType <ResourceIdentityType>]
   [-LicenseType <String>]
   [-PlanName <String>]
   [-PlanProduct <String>]
   [-PlanPromotionCode <String>]
   [-PlanPublisher <String>]
   [-RecoveryPolicyMode <RecoveryMode>]
   [-SinglePlacementGroup <Boolean>]
   [-Confirm]
   [-WhatIf]
   [<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.

Optional Parameters

-BootDiagnostic

Specifies the virtual machine scale set boot diagnostics profile.

Type:BootDiagnostics
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IdentityType

Specify the identity of the virtual machine scale set, if configured.

Type:ResourceIdentityType
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LicenseType

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Location

Specifies the Azure location where the VMSS is created.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Overprovision

Indicates whether the cmdlet overprovisions the VMSS.

Type:Boolean
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PlanName

Specifies the plan name.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PlanProduct

Specifies the plan product.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PlanPromotionCode

Specifies the plan promotion code.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PlanPublisher

Specifies the plan publisher.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RecoveryPolicyMode

Specify the recovery policy.

Type:RecoveryMode
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SinglePlacementGroup

Specifies the single placement group.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SkuCapacity

Specifies the number of instances in the VMSS.

Type:Int64
Position:5
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SkuName

Specifies the size of all the instances of VMSS.

Type:String
Aliases:AccountType
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tag

Specifies the tags that will be assigned to the VMSS.

Type:Hashtable
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
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:UpgradeMode
Parameter Sets:Automatic, Manual
Position:6
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False

Outputs

This cmdlet does not generate any output.