Skip to content

Commit 9aa7397

Browse files
author
Sam Lee
committed
Update preview message and add validation fix for disk
1 parent c2f7bc2 commit 9aa7397

10 files changed

+33
-24
lines changed

src/Migrate/Migrate.Autorest/custom/Get-AzMigrateLocalJob.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Get-AzMigrateLocalJob cmdlet retrives the status of an Azure Migrate job.
2222
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocaljob
2323
#>
2424
function Get-AzMigrateLocalJob {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
2727
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
2828
param(

src/Migrate/Migrate.Autorest/custom/Get-AzMigrateLocalServerReplication.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Get-AzMigrateLocalServerReplication cmdlet retrieves the object for the repl
2222
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocalserverreplication
2323
#>
2424
function Get-AzMigrateLocalServerReplication {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IProtectedItemModel])]
2727
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
2828
param(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ https://learn.microsoft.com/powershell/module/az.migrate/initialize-azmigrateloc
2323
#>
2424

2525
function Initialize-AzMigrateLocalReplicationInfrastructure {
26-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
26+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2727
[OutputType([System.Boolean], ParameterSetName = 'AzLocal')]
2828
[CmdletBinding(DefaultParameterSetName = 'AzLocal', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
2929
param(

src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalDiskMappingObject.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The New-AzMigrateLocalDiskMappingObject cmdlet creates a mapping of the source d
2222
https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratelocaldiskmappingobject
2323
#>
2424
function New-AzMigrateLocalDiskMappingObject {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.AzLocalDiskInput])]
2727
[CmdletBinding(PositionalBinding = $false)]
2828
param(
@@ -75,6 +75,10 @@ function New-AzMigrateLocalDiskMappingObject {
7575
$isDynamicDisk = [System.Convert]::ToBoolean($IsDynamic)
7676
$osDisk = [System.Convert]::ToBoolean($IsOSDisk)
7777

78+
if ($Format -eq "VHD" -and $PhysicalSectorSize -ne 512) {
79+
throw "PhysicalSectorSize must be 512 for VHD format."
80+
}
81+
7882
$DiskObject = [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.AzLocalDiskInput]::new(
7983
$DiskID,
8084
$isDynamicDisk,

src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalNicMappingObject.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The New-AzMigrateLocalNicMappingObject cmdlet creates a mapping of the source NI
2222
https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratelocalnicmappingobject
2323
#>
2424
function New-AzMigrateLocalNicMappingObject {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.AzLocalNicInput])]
2727
[CmdletBinding(PositionalBinding = $false)]
2828
param(

src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The New-AzMigrateLocalServerReplication cmdlet starts the replication for a part
2222
https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratelocalserverreplication
2323
#>
2424
function New-AzMigrateLocalServerReplication {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
2727
[CmdletBinding(DefaultParameterSetName = 'ByIdDefaultUser', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
2828
param(
@@ -593,11 +593,16 @@ function New-AzMigrateLocalServerReplication {
593593
# Validate DiskToInclude
594594
[PSCustomObject[]]$uniqueDisks = @()
595595
foreach ($disk in $DiskToInclude) {
596-
# Check if disk format is valid per Hyper-V Generation
596+
# VHD is not supported in Gen2 VMs
597597
if ($customProperties.HyperVGeneration -eq "2" -and $disk.DiskFileFormat -eq "VHD") {
598598
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."
599599
}
600600

601+
# PhysicalSectorSize must be 512 for VHD format
602+
if ($disk.DiskFileFormat -eq "VHD" -and $disk.DiskPhysicalSectorSize -ne 512) {
603+
throw "PhysicalSectorSize must be 512 for VHD format. Please replace disk with id '$($disk.DiskId)' in -DiskToInclude by re-running New-AzMigrateLocalDiskMappingObject with 512 as PhysicalSectorSize."
604+
}
605+
601606
if ($SiteType -eq $SiteTypes.HyperVSites) {
602607
$discoveredDisk = $machine.Disk | Where-Object { $_.InstanceId -eq $disk.DiskId }
603608
if ($null -eq $discoveredDisk) {

src/Migrate/Migrate.Autorest/custom/Remove-AzMigrateLocalServerReplication.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Remove-AzMigrateLocalServerReplication cmdlet stops the replication for a mi
2222
https://learn.microsoft.com/powershell/module/az.migrate/remove-azmigratelocalserverreplication
2323
#>
2424
function Remove-AzMigrateLocalServerReplication {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
2727
[CmdletBinding(DefaultParameterSetName = 'ByID', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact='Medium')]
2828
param(

src/Migrate/Migrate.Autorest/custom/Set-AzMigrateLocalServerReplication.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Set-AzMigrateLocalServerReplication cmdlet updates the target properties for
2222
https://learn.microsoft.com/powershell/module/az.migrate/set-azmigratelocalserverreplication
2323
#>
2424
function Set-AzMigrateLocalServerReplication {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
2727
[CmdletBinding(DefaultParameterSetName = 'ById', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact='Medium')]
2828
param(

src/Migrate/Migrate.Autorest/custom/Start-AzMigrateLocalServerMigration.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Starts the migration for the replicating server.
2222
https://learn.microsoft.com/powershell/module/az.migrate/start-azmigratelocalservermigration
2323
#>
2424
function Start-AzMigrateLocalServerMigration {
25-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is using a preview API version and is subject to breaking change in a future release.")]
25+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")]
2626
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
2727
[CmdletBinding(DefaultParameterSetName = 'ByID', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact='Medium')]
2828
param(

src/Migrate/Migrate.sln

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migrate", "Migrate\Migrate.
2121
EndProject
2222
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Migrate.Autorest", "Migrate.Autorest", "{9AA2C35A-2264-B74D-8556-EB72BD88EE60}"
2323
EndProject
24-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Migrate", "Migrate.Autorest\Az.Migrate.csproj", "{86C9DC86-DAB8-4269-B3F4-30E002CD9869}"
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Migrate", "Migrate.Autorest\Az.Migrate.csproj", "{214A468C-8ED4-41E0-883E-35C53A36AA7A}"
2525
EndProject
2626
Global
2727
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -117,18 +117,18 @@ Global
117117
{1847EC8D-87A5-4772-9E75-1DEA1DC531EE}.Release|x64.Build.0 = Release|Any CPU
118118
{1847EC8D-87A5-4772-9E75-1DEA1DC531EE}.Release|x86.ActiveCfg = Release|Any CPU
119119
{1847EC8D-87A5-4772-9E75-1DEA1DC531EE}.Release|x86.Build.0 = Release|Any CPU
120-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Debug|Any CPU.Build.0 = Debug|Any CPU
122-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Debug|x64.ActiveCfg = Debug|Any CPU
123-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Debug|x64.Build.0 = Debug|Any CPU
124-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Debug|x86.ActiveCfg = Debug|Any CPU
125-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Debug|x86.Build.0 = Debug|Any CPU
126-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Release|Any CPU.ActiveCfg = Release|Any CPU
127-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Release|Any CPU.Build.0 = Release|Any CPU
128-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Release|x64.ActiveCfg = Release|Any CPU
129-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Release|x64.Build.0 = Release|Any CPU
130-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Release|x86.ActiveCfg = Release|Any CPU
131-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869}.Release|x86.Build.0 = Release|Any CPU
120+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
122+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x64.ActiveCfg = Debug|Any CPU
123+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x64.Build.0 = Debug|Any CPU
124+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x86.ActiveCfg = Debug|Any CPU
125+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Debug|x86.Build.0 = Debug|Any CPU
126+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
127+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|Any CPU.Build.0 = Release|Any CPU
128+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x64.ActiveCfg = Release|Any CPU
129+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x64.Build.0 = Release|Any CPU
130+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x86.ActiveCfg = Release|Any CPU
131+
{214A468C-8ED4-41E0-883E-35C53A36AA7A}.Release|x86.Build.0 = Release|Any CPU
132132
EndGlobalSection
133133
GlobalSection(SolutionProperties) = preSolution
134134
HideSolutionNode = FALSE
@@ -140,6 +140,6 @@ Global
140140
{FB2B969F-E6FB-4E6E-9D2A-E52F4F53F51F} = {2D0176AD-AE30-4235-9D62-17043F0D4CD8}
141141
{D8D28132-CE20-45C8-8476-6B88C891D945} = {2D0176AD-AE30-4235-9D62-17043F0D4CD8}
142142
{B799EA2F-9E28-421A-9301-BB061C6ADDC2} = {2D0176AD-AE30-4235-9D62-17043F0D4CD8}
143-
{86C9DC86-DAB8-4269-B3F4-30E002CD9869} = {9AA2C35A-2264-B74D-8556-EB72BD88EE60}
143+
{214A468C-8ED4-41E0-883E-35C53A36AA7A} = {9AA2C35A-2264-B74D-8556-EB72BD88EE60}
144144
EndGlobalSection
145145
EndGlobal

0 commit comments

Comments
 (0)