diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index eb638586c44a..af0d31a069f3 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -20,6 +20,7 @@ --> ## Upcoming Release +* Added `-Hibernate` switch parameter to `Stop-AzVmss` default parameter set. * For `Get-AzVmRunCommand`, a bug is fixed to work when returning a list of RunCommands [#22403] * Updated Azure.Core to 1.34.0. diff --git a/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs b/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs index e2bf7a243676..5206fb8de430 100644 --- a/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs +++ b/src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetDeallocateMethod.cs @@ -58,7 +58,8 @@ public override void ExecuteCmdlet() } else { - result = VirtualMachineScaleSetsClient.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult(); + bool? hibernate = this.Hibernate.IsPresent ? (bool?)true : null; + result = VirtualMachineScaleSetsClient.DeallocateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, hibernate, instanceIds).GetAwaiter().GetResult(); } PSOperationStatusResponse output = new PSOperationStatusResponse @@ -129,5 +130,11 @@ public override void ExecuteCmdlet() [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } + + [Parameter( + Mandatory = false, + ParameterSetName = "DefaultParameter", + HelpMessage = "Hibernate a virtual machine from the VM scale set. This feature is available for VMSS with Flexible OrchestrationMode only.")] + public SwitchParameter Hibernate { get; set; } } } diff --git a/src/Compute/Compute/help/Stop-AzVmss.md b/src/Compute/Compute/help/Stop-AzVmss.md index 66b642b3cf11..fd8da47df0d8 100644 --- a/src/Compute/Compute/help/Stop-AzVmss.md +++ b/src/Compute/Compute/help/Stop-AzVmss.md @@ -16,7 +16,7 @@ Stops the VMSS or a set of virtual machines within the VMSS. ### DefaultParameter (Default) ``` Stop-AzVmss [-ResourceGroupName] [-VMScaleSetName] [[-InstanceId] ] [-Force] - [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-AsJob] [-Hibernate] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### FriendMethod @@ -93,6 +93,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Hibernate +Hibernate a virtual machine from the VM scale set. This feature is available for VMSS with Flexible OrchestrationMode only. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: DefaultParameter +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -InstanceId Specifies, as a string array, the ID or IDs of the virtual machine instances that this cmdlet stops. For instance: `-InstanceId "0", "3"`.