Skip to content

Enhance Az.Migrate to prep for GA #28020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minhsuanlee
Copy link
Contributor

@minhsuanlee minhsuanlee commented Jun 24, 2025

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@Copilot Copilot AI review requested due to automatic review settings June 24, 2025 18:46
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances the Az.Migrate module in preparation for GA by updating command parameters, validation logic, documentation, and version references. Key changes include:

  • Removal of the –TargetStoragePathId parameter and addition of appliance names to improve user control.
  • Updates to cmdlet implementation (parameter handling, disk format validation, and replication infrastructure) and solution file/project reference changes.
  • Version bumps across assembly, changelogs, and module documentation.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Migrate/Migrate/ChangeLog.md Changelog updated with customer-friendly release notes.
src/Migrate/Migrate.sln Updated project reference for Az.Migrate reflecting new directory structure.
src/Migrate/Migrate.Autorest/docs/*.md Updated documentation examples and parameter descriptions for new appliance names.
src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1 Refactored parameter handling and enhanced disk format validation for Gen2 VMs.
src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateLocalReplicationInfrastructure.ps1 Updated parameter passing and stricter validation for replication infrastructure.
src/Migrate/Migrate.Autorest/custom/Helper/*.ps1 Improved OS type and VMware tools validation in replication helper functions.
src/Migrate/Migrate.Autorest/custom/AzLocalDiskInput.cs Removed the target storage container property to align with parameter removals.
src/Migrate/Migrate.Autorest/README.md and AssemblyInfo.cs Bumped module and assembly versions in line with GA prep changes.
Comments suppressed due to low confidence (3)

src/Migrate/Migrate.sln:24

  • The project reference for 'Az.Migrate' has been updated. Please verify that the new relative path aligns with the intended build configuration and dependency structure.
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Migrate", "Migrate.Autorest\Az.Migrate.csproj", "{86C9DC86-DAB8-4269-B3F4-30E002CD9869}"

src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateLocalReplicationInfrastructure.ps1:181

  • The updated use of dictionary parameters when invoking 'InvokeAzMigrateGetCommandWithRetries' improves clarity; please ensure that the parameter keys exactly match the target cmdlet's expected input.
            -Parameters @{

src/Migrate/Migrate.Autorest/custom/Helper/CommonHelper.ps1:287

  • [nitpick] The enhanced OS type validation is more robust now; please verify that this condition does not inadvertently block valid OS scenarios where additional guest OS details could be provided.
            ($Machine.OperatingSystemDetailOSType -eq $OsType.OtherGuestFamily -and [string]::IsNullOrEmpty($Machine.GuestOSDetailOsname))) {

Comment on lines +597 to +598
if ($customProperties.HyperVGeneration -eq "2" -and $disk.DiskFileFormat -eq "VHD") {
throw "VHD disks are not supported in Hyper-V Generation 2 VMs. Please replace disk with id '$($disk.DiskId)' in -DiskToInclude by re-running New-AzMigrateLocalDiskMappingObject with 'VHDX' as Format."
Copy link
Preview

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The disk format validation correctly restricts 'VHD' disks for Hyper-V Generation 2 VMs; ensure that this logic is revisited if future releases extend support to VHD formats on Gen2.

Suggested change
if ($customProperties.HyperVGeneration -eq "2" -and $disk.DiskFileFormat -eq "VHD") {
throw "VHD disks are not supported in Hyper-V Generation 2 VMs. Please replace disk with id '$($disk.DiskId)' in -DiskToInclude by re-running New-AzMigrateLocalDiskMappingObject with 'VHDX' as Format."
$supportedFormats = GetSupportedDiskFormatsForHyperVGeneration($customProperties.HyperVGeneration)
if (-not $supportedFormats.Contains($disk.DiskFileFormat)) {
throw "The disk format '$($disk.DiskFileFormat)' is not supported in Hyper-V Generation $($customProperties.HyperVGeneration) VMs. Please replace disk with id '$($disk.DiskId)' in -DiskToInclude by re-running New-AzMigrateLocalDiskMappingObject with a supported format: $($supportedFormats -join ', ')."

Copilot uses AI. Check for mistakes.

@minhsuanlee minhsuanlee added this to the Az 14.3.0 (08/05/2025) milestone Jun 24, 2025
@minhsuanlee minhsuanlee added the Breaking Change Release This PR contains breaking change label Jun 24, 2025
Copy link

To the author of the pull request,
This PR was labeled "Breaking Change Release" because it contains breaking changes.

  • According to our policy, breaking changes can only take place during major release and they must be preannounced.
  • Please follow our guide on the detailed steps.
  • Required: Please fill in the task below to facilitate our contact,you will receive notifications related to breaking changes.

@YanaXu
Copy link
Contributor

YanaXu commented Jun 25, 2025

Hi @minhsuanlee, if it's a breaking change PR, we'll leave this PR open till the breaking change release sprint.

@minhsuanlee minhsuanlee removed the Breaking Change Release This PR contains breaking change label Jun 25, 2025
@minhsuanlee
Copy link
Contributor Author

Hi @minhsuanlee, if it's a breaking change PR, we'll leave this PR open till the breaking change release sprint.

The modified commands are all in preview which I believe breaking changes are allowed. Let me know if that is not the case. If not, please help me get pass the above failing checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants