diff --git a/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.cs b/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.cs index 91c46c112555..78f764102f93 100644 --- a/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.cs +++ b/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.cs @@ -37,5 +37,12 @@ public void TestAvailabilitySetVM() { TestRunner.RunTestScript("Test-AvailabilitySetVM"); } + + [Fact] + [Trait(Category.AcceptanceType, Category.LiveOnly)] + public void TestAvailabilitySetMigration() + { + TestRunner.RunTestScript("Test-AvailabilitySetMigration"); + } } } diff --git a/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 b/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 index 14c3df55c4b0..2eeb5c3358be 100644 --- a/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 +++ b/src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 @@ -231,3 +231,50 @@ function Test-AvailabilitySetVM Clean-ResourceGroup $rgname } } + +<# +.SYNOPSIS +Test Availability Set Migration to VMSS Flex +Note: This test requires the subscription to be enabled for the feature flag Microsoft.Compute/MigrateToVmssFlex +#> +function Test-AvailabilitySetMigration +{ + # Setup + $rgname = Get-ComputeTestResourceName + + try + { + # Common + $loc = Get-ComputeVMLocation; + New-AzResourceGroup -Name $rgname -Location $loc -Force; + + # Create Availability Set + $asetName = 'aset' + $rgname; + New-AzAvailabilitySet -ResourceGroupName $rgname -Name $asetName -Location $loc -Sku 'Aligned' -PlatformFaultDomainCount 2 -PlatformUpdateDomainCount 5; + $aset = Get-AzAvailabilitySet -ResourceGroupName $rgname -Name $asetName; + Assert-NotNull $aset; + + # Create a Flexible VMSS for migration target + $vmssName = 'vmss' + $rgname; + $vmssConfig = New-AzVmssConfig -Location $loc -OrchestrationMode 'Flexible' -PlatformFaultDomainCount 2; + $vmss = New-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName -VirtualMachineScaleSet $vmssConfig; + Assert-NotNull $vmss; + $vmssId = $vmss.Id; + + # Test Validate Migration cmdlet + $validateResult = Test-AzAvailabilitySetMigration -ResourceGroupName $rgname -Name $asetName -VirtualMachineScaleSetFlexibleId $vmssId; + Assert-NotNull $validateResult; + + # Test Convert cmdlet (creates a new VMSS) + $newVmssName = 'vmss2' + $rgname; + $convertResult = Convert-AzAvailabilitySet -ResourceGroupName $rgname -Name $asetName -VirtualMachineScaleSetName $newVmssName; + Assert-NotNull $convertResult; + + Write-Host "Availability Set Migration cmdlets test completed successfully"; + } + finally + { + # Cleanup + Clean-ResourceGroup $rgname + } +} diff --git a/src/Compute/Compute/AvailabilitySets/ConvertAzureAvailabilitySetCommand.cs b/src/Compute/Compute/AvailabilitySets/ConvertAzureAvailabilitySetCommand.cs new file mode 100644 index 000000000000..f8895adb6bfb --- /dev/null +++ b/src/Compute/Compute/AvailabilitySets/ConvertAzureAvailabilitySetCommand.cs @@ -0,0 +1,92 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Common; +using Microsoft.Azure.Commands.Compute.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + +namespace Microsoft.Azure.Commands.Compute +{ + [Cmdlet("Convert", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AvailabilitySet", SupportsShouldProcess = true)] + [OutputType(typeof(PSComputeLongRunningOperation), typeof(PSAzureOperationResponse))] + public class ConvertAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet + { + [Parameter( + Mandatory = true, + Position = 0, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Alias("AvailabilitySetName")] + [Parameter( + Mandatory = true, + Position = 1, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The availability set name.")] + [ResourceNameCompleter("Microsoft.Compute/availabilitySets", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + Position = 2, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The name of the Virtual Machine Scale Set to create.")] + [ValidateNotNullOrEmpty] + public string VirtualMachineScaleSetName { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.")] + public SwitchParameter NoWait { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + + if (this.ShouldProcess(Name, "Convert Availability Set to Virtual Machine Scale Set")) + { + ExecuteClientAction(() => + { + if (NoWait.IsPresent) + { + var op = this.AvailabilitySetClient.BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name, + this.VirtualMachineScaleSetName).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + WriteObject(result); + } + else + { + var op = this.AvailabilitySetClient.ConvertToVirtualMachineScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name, + this.VirtualMachineScaleSetName).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + result.StartTime = this.StartTime; + result.EndTime = DateTime.Now; + WriteObject(result); + } + }); + } + } + } +} diff --git a/src/Compute/Compute/AvailabilitySets/StartAzureAvailabilitySetMigrationCommand.cs b/src/Compute/Compute/AvailabilitySets/StartAzureAvailabilitySetMigrationCommand.cs new file mode 100644 index 000000000000..e48ec294b9ed --- /dev/null +++ b/src/Compute/Compute/AvailabilitySets/StartAzureAvailabilitySetMigrationCommand.cs @@ -0,0 +1,80 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Common; +using Microsoft.Azure.Commands.Compute.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute.Models; + +namespace Microsoft.Azure.Commands.Compute +{ + [Cmdlet("Start", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AvailabilitySetMigration", SupportsShouldProcess = true)] + [OutputType(typeof(PSComputeLongRunningOperation), typeof(PSAzureOperationResponse))] + public class StartAzureAvailabilitySetMigrationCommand : AvailabilitySetBaseCmdlet + { + [Parameter( + Mandatory = true, + Position = 0, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Alias("AvailabilitySetName")] + [Parameter( + Mandatory = true, + Position = 1, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The availability set name.")] + [ResourceNameCompleter("Microsoft.Compute/availabilitySets", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + Position = 2, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource ID of the Flexible Virtual Machine Scale Set to migrate to.")] + [ValidateNotNullOrEmpty] + public string VirtualMachineScaleSetFlexibleId { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + + if (this.ShouldProcess(Name, "Start Availability Set Migration to Virtual Machine Scale Set")) + { + ExecuteClientAction(() => + { + var vmssReference = new SubResource(this.VirtualMachineScaleSetFlexibleId); + + var op = this.AvailabilitySetClient.StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name, + vmssReference).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + result.StartTime = this.StartTime; + result.EndTime = DateTime.Now; + WriteObject(result); + }); + } + } + } +} diff --git a/src/Compute/Compute/AvailabilitySets/StopAzureAvailabilitySetMigrationCommand.cs b/src/Compute/Compute/AvailabilitySets/StopAzureAvailabilitySetMigrationCommand.cs new file mode 100644 index 000000000000..b16470200fba --- /dev/null +++ b/src/Compute/Compute/AvailabilitySets/StopAzureAvailabilitySetMigrationCommand.cs @@ -0,0 +1,68 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Common; +using Microsoft.Azure.Commands.Compute.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; + +namespace Microsoft.Azure.Commands.Compute +{ + [Cmdlet("Stop", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AvailabilitySetMigration", SupportsShouldProcess = true)] + [OutputType(typeof(PSComputeLongRunningOperation), typeof(PSAzureOperationResponse))] + public class StopAzureAvailabilitySetMigrationCommand : AvailabilitySetBaseCmdlet + { + [Parameter( + Mandatory = true, + Position = 0, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Alias("AvailabilitySetName")] + [Parameter( + Mandatory = true, + Position = 1, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The availability set name.")] + [ResourceNameCompleter("Microsoft.Compute/availabilitySets", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + + if (this.ShouldProcess(Name, "Cancel Availability Set Migration")) + { + ExecuteClientAction(() => + { + var op = this.AvailabilitySetClient.CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + result.StartTime = this.StartTime; + result.EndTime = DateTime.Now; + WriteObject(result); + }); + } + } + } +} diff --git a/src/Compute/Compute/AvailabilitySets/TestAzureAvailabilitySetMigrationCommand.cs b/src/Compute/Compute/AvailabilitySets/TestAzureAvailabilitySetMigrationCommand.cs new file mode 100644 index 000000000000..982ba7b28ec9 --- /dev/null +++ b/src/Compute/Compute/AvailabilitySets/TestAzureAvailabilitySetMigrationCommand.cs @@ -0,0 +1,80 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Common; +using Microsoft.Azure.Commands.Compute.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute.Models; + +namespace Microsoft.Azure.Commands.Compute +{ + [Cmdlet("Test", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "AvailabilitySetMigration", SupportsShouldProcess = true)] + [OutputType(typeof(PSComputeLongRunningOperation), typeof(PSAzureOperationResponse))] + public class TestAzureAvailabilitySetMigrationCommand : AvailabilitySetBaseCmdlet + { + [Parameter( + Mandatory = true, + Position = 0, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Alias("AvailabilitySetName")] + [Parameter( + Mandatory = true, + Position = 1, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The availability set name.")] + [ResourceNameCompleter("Microsoft.Compute/availabilitySets", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + Position = 2, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource ID of the Flexible Virtual Machine Scale Set to validate migration to.")] + [ValidateNotNullOrEmpty] + public string VirtualMachineScaleSetFlexibleId { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + + if (this.ShouldProcess(Name, "Validate Availability Set Migration to Virtual Machine Scale Set")) + { + ExecuteClientAction(() => + { + var vmssReference = new SubResource(this.VirtualMachineScaleSetFlexibleId); + + var op = this.AvailabilitySetClient.ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name, + vmssReference).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + result.StartTime = this.StartTime; + result.EndTime = DateTime.Now; + WriteObject(result); + }); + } + } + } +} diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index 3b20e3949f01..16a9e9a97366 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -24,6 +24,12 @@ * Updated Azure.Core from 1.45.0 to 1.47.3 * Added `-EnableAutomaticUpgrade` and `-TreatFailureAsDeploymentFailure` parameters (Bool) to `New-AzVmGalleryApplication` and `New-AzVmssGalleryApplication` cmdlets. * Added `-EnableAutomaticUpgrade` and `-TreatFailureAsDeploymentFailure` parameters (Switch) to `Add-AzVmGalleryApplication` and `Add-AzVmssGalleryApplication` cmdlets. +* Added new cmdlets for Availability Set to Virtual Machine Scale Set (VMSS) Flex migration (Public Preview) + - `Convert-AzAvailabilitySet`: Converts an Availability Set to a new Flexible Virtual Machine Scale Set without downtime + - `Start-AzAvailabilitySetMigration`: Starts migration of an Availability Set to an existing Flexible VMSS + - `Test-AzAvailabilitySetMigration`: Validates that VMs in an Availability Set can be migrated to a VMSS + - `Stop-AzAvailabilitySetMigration`: Cancels a migration operation on an Availability Set + - `Move-AzVirtualMachineToVmss`: Migrates a VM from an Availability Set to a Flexible VMSS ## Version 10.5.0 * Added `-Redeploy` switch parameter for `Update-AzHost` cmdlet to enable dedicated host redeployment. diff --git a/src/Compute/Compute/VirtualMachine/Action/MoveAzureVMToVmssCommand.cs b/src/Compute/Compute/VirtualMachine/Action/MoveAzureVMToVmssCommand.cs new file mode 100644 index 000000000000..659f0f44b9b6 --- /dev/null +++ b/src/Compute/Compute/VirtualMachine/Action/MoveAzureVMToVmssCommand.cs @@ -0,0 +1,140 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Common; +using Microsoft.Azure.Commands.Compute.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute.Models; +using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; + +namespace Microsoft.Azure.Commands.Compute +{ + [Cmdlet("Move", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VirtualMachineToVmss", DefaultParameterSetName = ResourceGroupNameParameterSet, SupportsShouldProcess = true)] + [OutputType(typeof(PSComputeLongRunningOperation), typeof(PSAzureOperationResponse))] + public class MoveAzureVMToVmssCommand : VirtualMachineBaseCmdlet + { + protected const string ResourceGroupNameParameterSet = "ResourceGroupNameParameterSetName"; + protected const string IdParameterSet = "IdParameterSetName"; + + [Parameter( + Mandatory = true, + Position = 0, + ParameterSetName = ResourceGroupNameParameterSet, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = true, + Position = 0, + ParameterSetName = IdParameterSet, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The ID of the virtual machine.")] + [ValidateNotNullOrEmpty] + [ResourceIdCompleter("Microsoft.Compute/virtualMachines")] + public string Id { get; set; } + + [Parameter( + Mandatory = true, + Position = 1, + ParameterSetName = ResourceGroupNameParameterSet, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The virtual machine name.")] + [ResourceNameCompleter("Microsoft.Compute/virtualMachines", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The target zone for the virtual machine migration to Flexible Virtual Machine Scale Set.")] + [ValidateNotNullOrEmpty] + public string TargetZone { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The target compute fault domain for the virtual machine migration to Flexible Virtual Machine Scale Set.")] + [ValidateNotNullOrEmpty] + public int? TargetFaultDomain { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The target Virtual Machine size for the migration to Flexible Virtual Machine Scale Set.")] + [ValidateNotNullOrEmpty] + public string TargetVMSize { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.")] + public SwitchParameter NoWait { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + + if (ParameterSetName.Equals(IdParameterSet) && !string.IsNullOrEmpty(Id)) + { + ResourceIdentifier parsedId = new ResourceIdentifier(Id); + this.ResourceGroupName = parsedId.ResourceGroupName; + this.Name = parsedId.ResourceName; + } + + if (this.ShouldProcess(Name, "Migrate Virtual Machine to Virtual Machine Scale Set")) + { + ExecuteClientAction(() => + { + MigrateVMToVirtualMachineScaleSetInput parameters = null; + + if (!string.IsNullOrEmpty(TargetZone) || TargetFaultDomain.HasValue || !string.IsNullOrEmpty(TargetVMSize)) + { + parameters = new MigrateVMToVirtualMachineScaleSetInput + { + TargetZone = this.TargetZone, + TargetFaultDomain = this.TargetFaultDomain, + TargetVMSize = this.TargetVMSize + }; + } + + if (NoWait.IsPresent) + { + var op = this.VirtualMachineClient.BeginMigrateToVMScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name, + parameters).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + WriteObject(result); + } + else + { + var op = this.VirtualMachineClient.MigrateToVMScaleSetWithHttpMessagesAsync( + this.ResourceGroupName, + this.Name, + parameters).GetAwaiter().GetResult(); + var result = ComputeAutoMapperProfile.Mapper.Map(op); + result.StartTime = this.StartTime; + result.EndTime = DateTime.Now; + WriteObject(result); + } + }); + } + } + } +} diff --git a/src/Compute/Compute/help/Convert-AzAvailabilitySet.md b/src/Compute/Compute/help/Convert-AzAvailabilitySet.md new file mode 100644 index 000000000000..b5b764f5f59d --- /dev/null +++ b/src/Compute/Compute/help/Convert-AzAvailabilitySet.md @@ -0,0 +1,188 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://learn.microsoft.com/powershell/module/az.compute/convert-azavailabilityset +schema: 2.0.0 +--- + +# Convert-AzAvailabilitySet + +## SYNOPSIS +Converts an Availability Set to a Flexible Virtual Machine Scale Set. + +## SYNTAX + +``` +Convert-AzAvailabilitySet [-ResourceGroupName] [-Name] + [-VirtualMachineScaleSetName] [-NoWait] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **Convert-AzAvailabilitySet** cmdlet creates a new Flexible Virtual Machine Scale Set and migrates all the Virtual Machines in the Availability Set to it. This operation does not trigger a downtime on the Virtual Machines. + +This feature requires the subscription to be enabled for the feature flag Microsoft.Compute/MigrateToVmssFlex. + +## EXAMPLES + +### Example 1: Convert an Availability Set to a Virtual Machine Scale Set +```powershell +Convert-AzAvailabilitySet -ResourceGroupName "MyResourceGroup" -Name "MyAvailabilitySet" -VirtualMachineScaleSetName "MyScaleSet" +``` + +This command converts the availability set named MyAvailabilitySet in the resource group MyResourceGroup to a new Flexible Virtual Machine Scale Set named MyScaleSet. + +### Example 2: Convert an Availability Set with NoWait +```powershell +Convert-AzAvailabilitySet -ResourceGroupName "MyResourceGroup" -Name "MyAvailabilitySet" -VirtualMachineScaleSetName "MyScaleSet" -NoWait +``` + +This command starts the conversion of the availability set and returns immediately without waiting for the operation to complete. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +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. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The availability set name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AvailabilitySetName + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -NoWait +Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -VirtualMachineScaleSetName +The name of the Virtual Machine Scale Set to create. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Models.PSComputeLongRunningOperation + +### Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse + +## NOTES + +## RELATED LINKS + +[Get-AzAvailabilitySet](./Get-AzAvailabilitySet.md) + +[Start-AzAvailabilitySetMigration](./Start-AzAvailabilitySetMigration.md) + +[Test-AzAvailabilitySetMigration](./Test-AzAvailabilitySetMigration.md) + +[Stop-AzAvailabilitySetMigration](./Stop-AzAvailabilitySetMigration.md) diff --git a/src/Compute/Compute/help/Move-AzVirtualMachineToVmss.md b/src/Compute/Compute/help/Move-AzVirtualMachineToVmss.md new file mode 100644 index 000000000000..b4ea98fcbe7b --- /dev/null +++ b/src/Compute/Compute/help/Move-AzVirtualMachineToVmss.md @@ -0,0 +1,251 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://learn.microsoft.com/powershell/module/az.compute/move-azvirtualmachinetovmss +schema: 2.0.0 +--- + +# Move-AzVirtualMachineToVmss + +## SYNOPSIS +Migrates a virtual machine from an Availability Set to a Flexible Virtual Machine Scale Set. + +## SYNTAX + +### ResourceGroupNameParameterSetName (Default) +``` +Move-AzVirtualMachineToVmss [-ResourceGroupName] [-Name] [-TargetZone ] + [-TargetFaultDomain ] [-TargetVMSize ] [-NoWait] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### IdParameterSetName +``` +Move-AzVirtualMachineToVmss [-Id] [-TargetZone ] [-TargetFaultDomain ] + [-TargetVMSize ] [-NoWait] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **Move-AzVirtualMachineToVmss** cmdlet migrates a virtual machine from an Availability Set to a Flexible Virtual Machine Scale Set. This operation triggers a downtime on the virtual machine. Use this cmdlet after starting the migration with Start-AzAvailabilitySetMigration. + +This feature requires the subscription to be enabled for the feature flag Microsoft.Compute/MigrateToVmssFlex. + +## EXAMPLES + +### Example 1: Migrate a virtual machine to a VMSS +```powershell +Move-AzVirtualMachineToVmss -ResourceGroupName "MyResourceGroup" -Name "VM1" +``` + +This command migrates the virtual machine named VM1 in the resource group MyResourceGroup to the Flexible Virtual Machine Scale Set that was specified when migration was started. + +### Example 2: Migrate a virtual machine with specific target settings +```powershell +Move-AzVirtualMachineToVmss -ResourceGroupName "MyResourceGroup" -Name "VM1" -TargetZone "1" -TargetFaultDomain 0 -TargetVMSize "Standard_DS2_v2" +``` + +This command migrates the virtual machine with specific target zone, fault domain, and VM size settings. + +### Example 3: Migrate a virtual machine using resource ID +```powershell +Move-AzVirtualMachineToVmss -Id "/subscriptions/{sub-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/VM1" -TargetZone "1" +``` + +This command migrates the virtual machine specified by its resource ID to zone 1. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +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. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +The ID of the virtual machine. + +```yaml +Type: System.String +Parameter Sets: IdParameterSetName +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name +The virtual machine name. + +```yaml +Type: System.String +Parameter Sets: ResourceGroupNameParameterSetName +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -NoWait +Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of the resource group. + +```yaml +Type: System.String +Parameter Sets: ResourceGroupNameParameterSetName +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TargetFaultDomain +The target compute fault domain for the virtual machine migration to Flexible Virtual Machine Scale Set. + +```yaml +Type: System.Nullable`1[System.Int32] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TargetVMSize +The target Virtual Machine size for the migration to Flexible Virtual Machine Scale Set. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TargetZone +The target zone for the virtual machine migration to Flexible Virtual Machine Scale Set. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Models.PSComputeLongRunningOperation + +### Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse + +## NOTES + +## RELATED LINKS + +[Start-AzAvailabilitySetMigration](./Start-AzAvailabilitySetMigration.md) + +[Stop-AzAvailabilitySetMigration](./Stop-AzAvailabilitySetMigration.md) + +[Test-AzAvailabilitySetMigration](./Test-AzAvailabilitySetMigration.md) + +[Get-AzVM](./Get-AzVM.md) diff --git a/src/Compute/Compute/help/Start-AzAvailabilitySetMigration.md b/src/Compute/Compute/help/Start-AzAvailabilitySetMigration.md new file mode 100644 index 000000000000..9d95a28fa1d0 --- /dev/null +++ b/src/Compute/Compute/help/Start-AzAvailabilitySetMigration.md @@ -0,0 +1,166 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://learn.microsoft.com/powershell/module/az.compute/start-azavailabilitysetmigration +schema: 2.0.0 +--- + +# Start-AzAvailabilitySetMigration + +## SYNOPSIS +Starts the migration operation on an Availability Set to a Flexible Virtual Machine Scale Set. + +## SYNTAX + +``` +Start-AzAvailabilitySetMigration [-ResourceGroupName] [-Name] + [-VirtualMachineScaleSetFlexibleId] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **Start-AzAvailabilitySetMigration** cmdlet starts the migration operation on an Availability Set to move its Virtual Machines to a Flexible Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine using Move-AzVirtualMachineToVmss that triggers a downtime on the Virtual Machine. + +This feature requires the subscription to be enabled for the feature flag Microsoft.Compute/MigrateToVmssFlex. + +## EXAMPLES + +### Example 1: Start migration of an Availability Set to a VMSS Flex +```powershell +Start-AzAvailabilitySetMigration -ResourceGroupName "MyResourceGroup" -Name "MyAvailabilitySet" -VirtualMachineScaleSetFlexibleId "/subscriptions/{sub-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/MyFlexibleVMSS" +``` + +This command starts the migration of the availability set named MyAvailabilitySet to the specified Flexible Virtual Machine Scale Set. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +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. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The availability set name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AvailabilitySetName + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -VirtualMachineScaleSetFlexibleId +The resource ID of the Flexible Virtual Machine Scale Set to migrate to. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Models.PSComputeLongRunningOperation + +### Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse + +## NOTES + +## RELATED LINKS + +[Test-AzAvailabilitySetMigration](./Test-AzAvailabilitySetMigration.md) + +[Stop-AzAvailabilitySetMigration](./Stop-AzAvailabilitySetMigration.md) + +[Move-AzVirtualMachineToVmss](./Move-AzVirtualMachineToVmss.md) + +[Convert-AzAvailabilitySet](./Convert-AzAvailabilitySet.md) diff --git a/src/Compute/Compute/help/Stop-AzAvailabilitySetMigration.md b/src/Compute/Compute/help/Stop-AzAvailabilitySetMigration.md new file mode 100644 index 000000000000..9b474a0adbeb --- /dev/null +++ b/src/Compute/Compute/help/Stop-AzAvailabilitySetMigration.md @@ -0,0 +1,148 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://learn.microsoft.com/powershell/module/az.compute/stop-azavailabilitysetmigration +schema: 2.0.0 +--- + +# Stop-AzAvailabilitySetMigration + +## SYNOPSIS +Cancels the migration operation on an Availability Set. + +## SYNTAX + +``` +Stop-AzAvailabilitySetMigration [-ResourceGroupName] [-Name] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **Stop-AzAvailabilitySetMigration** cmdlet cancels the migration operation on an Availability Set that was previously started with Start-AzAvailabilitySetMigration. + +This feature requires the subscription to be enabled for the feature flag Microsoft.Compute/MigrateToVmssFlex. + +## EXAMPLES + +### Example 1: Cancel migration of an Availability Set +```powershell +Stop-AzAvailabilitySetMigration -ResourceGroupName "MyResourceGroup" -Name "MyAvailabilitySet" +``` + +This command cancels the migration of the availability set named MyAvailabilitySet in the resource group MyResourceGroup. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +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. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The availability set name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AvailabilitySetName + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Models.PSComputeLongRunningOperation + +### Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse + +## NOTES + +## RELATED LINKS + +[Start-AzAvailabilitySetMigration](./Start-AzAvailabilitySetMigration.md) + +[Test-AzAvailabilitySetMigration](./Test-AzAvailabilitySetMigration.md) + +[Convert-AzAvailabilitySet](./Convert-AzAvailabilitySet.md) diff --git a/src/Compute/Compute/help/Test-AzAvailabilitySetMigration.md b/src/Compute/Compute/help/Test-AzAvailabilitySetMigration.md new file mode 100644 index 000000000000..81f3ec401c5b --- /dev/null +++ b/src/Compute/Compute/help/Test-AzAvailabilitySetMigration.md @@ -0,0 +1,164 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://learn.microsoft.com/powershell/module/az.compute/test-azavailabilitysetmigration +schema: 2.0.0 +--- + +# Test-AzAvailabilitySetMigration + +## SYNOPSIS +Validates that the Virtual Machines in an Availability Set can be migrated to the specified Virtual Machine Scale Set. + +## SYNTAX + +``` +Test-AzAvailabilitySetMigration [-ResourceGroupName] [-Name] + [-VirtualMachineScaleSetFlexibleId] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +The **Test-AzAvailabilitySetMigration** cmdlet validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. This validation should be run before starting the migration using Start-AzAvailabilitySetMigration. + +This feature requires the subscription to be enabled for the feature flag Microsoft.Compute/MigrateToVmssFlex. + +## EXAMPLES + +### Example 1: Validate migration of an Availability Set +```powershell +Test-AzAvailabilitySetMigration -ResourceGroupName "MyResourceGroup" -Name "MyAvailabilitySet" -VirtualMachineScaleSetFlexibleId "/subscriptions/{sub-id}/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/MyFlexibleVMSS" +``` + +This command validates that the availability set named MyAvailabilitySet can be migrated to the specified Flexible Virtual Machine Scale Set. + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +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. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The availability set name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AvailabilitySetName + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -VirtualMachineScaleSetFlexibleId +The resource ID of the Flexible Virtual Machine Scale Set to validate migration to. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Models.PSComputeLongRunningOperation + +### Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse + +## NOTES + +## RELATED LINKS + +[Start-AzAvailabilitySetMigration](./Start-AzAvailabilitySetMigration.md) + +[Stop-AzAvailabilitySetMigration](./Stop-AzAvailabilitySetMigration.md) + +[Convert-AzAvailabilitySet](./Convert-AzAvailabilitySet.md)