Update-AzureRmVmss

Updates the state of a VMSS.

Syntax

Update-AzureRmVmss
      [-AsJob]
      [-ResourceGroupName] <String>
      [-VMScaleSetName] <String>
      [[-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>]
      [-ImageReferenceSku <String>]
      [-EnableAutomaticUpdate <Boolean>]
      [-ManagedDiskStorageAccountType <StorageAccountTypes>]
      [-PlanPublisher <String>]
      [-ProvisionVMAgent <Boolean>]
      [-BootDiagnosticsEnabled <Boolean>]
      [-Overprovision <Boolean>]
      [-MaxBatchInstancePercent <Int32>]
      [-TimeZone <String>]
      [-BootDiagnosticsStorageUri <String>]
      [-AutomaticOSUpgrade <Boolean>]
      [-SinglePlacementGroup <Boolean>]
      [-CustomData <String>]
      [-UpgradePolicyMode <UpgradeMode>]
      [-ImageReferenceId <String>]
      [-DisablePasswordAuthentication <Boolean>]
      [-Tag <Hashtable>]
      [-PlanName <String>]
      [-MaxUnhealthyUpgradedInstancePercent <Int32>]
      [-ImageReferencePublisher <String>]
      [-PlanProduct <String>]
      [-ImageUri <String>]
      [-SkuTier <String>]
      [-VhdContainer <String[]>]
      [-LicenseType <String>]
      [-IdentityType <ResourceIdentityType>]
      [-SkuName <String>]
      [-PlanPromotionCode <String>]
      [-MaxUnhealthyInstancePercent <Int32>]
      [-SkuCapacity <Int32>]
      [-ImageReferenceOffer <String>]
      [-PauseTimeBetweenBatches <String>]
      [-OsDiskCaching <CachingTypes>]
      [-ImageReferenceVersion <String>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzureRmVmss cmdlet updates the state of a Virtual Machine Scale Set (VMSS) to the state of a local VMSS object.

Examples

Example 1: Update the state of a VMSS to the state of a local VMSS object.

PS C:\> Update-AzureRmVmss -ResourceGroupName "Group001" -Name "VMSS001" -VirtualMachineScaleSet "LocalVMSS"

This command updates the state of the VMSS named VMSS001 that belongs to the resource group named Group001 to the state of a local VMSS object named LocalVMSS.

Required Parameters

-ResourceGroupName

Specifies the name of the resource group the VMSS belongs to.

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

Specifies the name of the VMSS that this cmdlet creates.

Type:String
Aliases:Name
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AsJob

Run cmdlet in the background and return a Job to track progress.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-AutomaticOSUpgrade

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:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-BootDiagnosticsEnabled

Whether boot diagnostics should be enabled on the virtual machine scale set.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-BootDiagnosticsStorageUri

URI of the storage account to use for placing the console output and screenshot.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-CustomData

Specifies a base-64 encoded string of custom data. This is decoded to a binary array that is saved as a file on the virtual machine. The maximum length of the binary array is 65535 bytes.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisablePasswordAuthentication

Indicates that this cmdlet disables password authentication for Linux OS.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableAutomaticUpdate

Indicates whether the Windows virtual machines in the VMSS are enabled for automatic updates.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IdentityType

Specify the identity for the virtual machine scale set. The acceptable values for this parameter are:

  • SystemAssigned
Type:System.Nullable`1[Microsoft.Azure.Management.Compute.Models.ResourceIdentityType]
Parameter Sets:SystemAssigned
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageReferenceId

Specifies the image reference ID.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageReferenceOffer

Specifies the type of virtual machine image (VMImage) offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageReferencePublisher

Specifies the name of a publisher of a VMImage. To obtain a publisher, use the Get-AzureRmVMImagePublisher cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageReferenceSku

Specifies the VMImage SKU. To obtain SKUs, use the Get-AzureRmVMImageSku cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageReferenceVersion

Specifies the version of the VMImage. To use the latest version, specify a value of latest instead of a particular version.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageUri

Specifies the blob URI for the user image. VMSS creates an operating system disk in the same container of the user image.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
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:False
Accept wildcard characters:False
-ManagedDiskStorageAccountType

Specifies the storage account type for managed disk. The acceptable values for this parameter are:

  • StandardLRS

  • PremiumLRS

Type:System.Nullable`1[Microsoft.Azure.Management.Compute.Models.StorageAccountTypes]
Parameter Sets:StandardLRS, PremiumLRS
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxBatchInstancePercent

The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. If the value is not specified, it is set to 20.

Type:System.Nullable`1[System.Int32]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxUnhealthyInstancePercent

The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. If the value is not specified, it is set to 20.

Type:System.Nullable`1[System.Int32]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxUnhealthyUpgradedInstancePercent

The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. If the value is not specified, it is set to 20.

Type:System.Nullable`1[System.Int32]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OsDiskCaching

Specifies the caching mode of the operating system disk. The acceptable values for this parameter are:

  • None

  • ReadOnly

  • ReadWrite

The default value is ReadWrite. If you change the caching value, the cmdlet will restart the virtual machine.

This setting affects the consistency and performance of the disk.

Type:System.Nullable`1[Microsoft.Azure.Management.Compute.Models.CachingTypes]
Parameter Sets:None, ReadOnly, ReadWrite
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Overprovision

Indicates whether the cmdlet overprovisions the VMSS.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PauseTimeBetweenBatches

The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S).

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PlanName

Specifies the plan name.

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

Specifies the plan product.

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

Specifies the plan promotion code.

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

Specifies the plan publisher.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProvisionVMAgent

Indicates whether virtual machine agent should be provisioned on the Windows virtual machines in the VMSS.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SinglePlacementGroup

Specifies the single placement group.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkuCapacity

Specifies the number of instances in the VMSS.

Type:System.Nullable`1[System.Int32]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkuName

Specifies the size of all the instances of VMSS.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkuTier

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

  • Standard

  • Basic

Type:String
Position:Named
Default value:None
Accept pipeline input:False
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:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeZone

Specifies the time zone for Windows OS.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
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

  • Rolling

Type:System.Nullable`1[Microsoft.Azure.Management.Compute.Models.UpgradeMode]
Parameter Sets:Automatic, Manual, Rolling
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VhdContainer

Specifies the container URLs that are used to store operating system disks for the VMSS.

Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VirtualMachineScaleSet

Specifies a local VMSS object. To obtain a VMSS object, use the Get-AzureRmVmss cmdlet. This virtual machine object contains the updated state for the VMSS.

Type:Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSet
Position:3
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs.

The cmdlet is not run.

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False