Skip to content

Commit

Permalink
[Az.Migrate] Data replication 2024-09-01 API version and rebranding (A…
Browse files Browse the repository at this point in the history
…zure#27207)

* Update data-replication API version to 2024-09-01

* Azure local rebranding

* Test recodings

* More test recording

* Added examples

* Including document

* Pushed help folder

* Replaced path to online repo

* Updated autorest readme

* Rebranding

* Added ChangeLog

* Rebranding

* Changelog

* Update ChangeLog formatting and entries

* Run some tests liveonly

* Create BreakingChangeIssues.csv

---------

Co-authored-by: Helen Afework <[email protected]>
Co-authored-by: Yabo Hu <[email protected]>
  • Loading branch information
3 people authored Feb 25, 2025
1 parent 43a7747 commit f055fc9
Show file tree
Hide file tree
Showing 113 changed files with 3,848 additions and 3,326 deletions.
28 changes: 28 additions & 0 deletions src/Migrate/Migrate.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// 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.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Migrate")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.6.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.6.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]


56 changes: 37 additions & 19 deletions src/Migrate/Migrate.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ In this directory, run AutoRest:
``` yaml
skip-semantics-validation: true
commit: 3b19762dab3c48c857ae2355da351b32dde22eda
commit: 473d98be4cc2fb14db8bddbba8d3184d0aa49636
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json
- $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
- $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2024-01-01/service.json
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json

module-version: 1.0.1
module-version: 3.0.10
title: Migrate
subject-prefix: 'Migrate'

Expand Down Expand Up @@ -114,9 +114,13 @@ directive:
- ProtectedItemModelCustomProperties
- HyperVToAzStackHCIProtectedItemModelCustomProperties
- VMwareToAzStackHCIProtectedItemModelCustomProperties
- ProtectedItemModelPropertiesUpdate
- ProtectedItemModelCustomPropertiesUpdate
- HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate
- VMwareToAzStackHCIProtectedItemModelCustomPropertiesUpdate
- PlannedFailoverModelProperties
- WorkflowModelProperties
- WorkflowModelCustomProperties
- JobModelProperties
- JobModelCustomProperties
- TaskModel
- TaskModelCustomProperties
# Remove variants not in scope
Expand Down Expand Up @@ -240,7 +244,7 @@ directive:
remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
subject: ^Job|^VMwareOperationsStatus
subject: ^VMwareOperationsStatus
remove: true
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
Expand Down Expand Up @@ -328,48 +332,62 @@ directive:
verb: New|Remove|Update
subject: ^HyperV
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Test|Invoke
subject: NameAvailability$|DeploymentPreflight
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Get|New
subject: ^EmailConfiguration
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Get
subject: ^(Dra|ProtectedItem|Vault|Workflow)OperationStatus$
subject: ^(FabricAgent|ProtectedItem|Vault|Job)OperationStatus$
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Get
subject: ^FabricOperationsStatus$
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: New
subject: ^(Dra|Vault)
subject: ^(FabricAgent|Vault)
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Update
subject: ^Vault
remove: true
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
subject: PrivateEndpointConnection|PrivateLinkResource
remove: true
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
subject: OperationResult
remove: true
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
where:
verb: Invoke
subject: ^PlannedReplication
remove: true
# Rename cmdlets for AzStackHCI
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
# Rename cmdlets for Azure Local
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Get
subject: ^Fabric$
set:
subject: HCIReplicationFabric
subject: LocalReplicationFabric
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Get
subject: ^Job$
set:
subject: LocalReplicationJob
# Hide cmldets used by custom
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
Expand Down Expand Up @@ -464,10 +482,10 @@ directive:
verb: New$
variant: ^CreateViaIdentity
hide: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
- from: Microsoft.DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json
where:
verb: Get$|Invoke$|New$|Remove$|Test$|Update$
subject: ^Dra|^Fabric|^Policy|^EmailConfiguration|^ProtectedItem|^ReplicationExtension|^Vault|^Workflow
subject: ^FabricAgent|^Fabric|^Policy|^EmailConfiguration|^ProtectedItem|^ReplicationExtension|^Vault
hide: true
- where:
verb: New$|Set$|Update$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"resourceType": "replicationFabrics",
"apiVersion": "2021-02-16-preview",
"apiVersion": "2024-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
},
"commands": [
{
"name": "Get-AzMigrateHCIReplicationFabric",
"name": "Get-AzMigrateLocalReplicationFabric",
"description": "Gets the details of the fabric.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcireplicationfabric"
"url": "https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocalreplicationfabric"
},
"parameterSets": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;

namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901
{
public class AzStackHCIDiskInput
public class AzLocalDiskInput
{
public AzStackHCIDiskInput(
public AzLocalDiskInput(
string diskId,
bool isDynamic,
long diskSizeGB,
string diskFileFormat,
bool isOsDisk)
bool isOsDisk,
long? diskPhysicalSectorSize,
string storageContainerId)
{
DiskId = diskId;
IsDynamic = isDynamic;
DiskSizeGb = diskSizeGB;
DiskFileFormat = diskFileFormat;
IsOSDisk = isOsDisk;

DiskPhysicalSectorSize =
(diskPhysicalSectorSize == 512 || diskPhysicalSectorSize == 4096)
? diskPhysicalSectorSize
: null;

// TODO(helenafework): Add this code back once backend is fixed to check for empty string
// StorageContainerId =
// string.IsNullOrWhiteSpace(storageContainerId)
// ? null
// : storageContainerId;
}

/// <summary>Gets or sets the type of the virtual hard disk, vhd or vhdx.</summary>
public string DiskFileFormat { get; set; }

/// <summary>Gets or sets the disk Id.</summary>
public string DiskId { get; set; }

/// <summary>Gets or sets a value of disk physical sector size.</summary>
public long? DiskPhysicalSectorSize { get; set;}

/// <summary>Gets or sets the disk size in GB.</summary>
public long DiskSizeGb { get; set; }
Expand All @@ -36,5 +53,8 @@ public AzStackHCIDiskInput(

/// <summary>Gets or sets a value indicating whether disk is os disk.</summary>
public bool IsOSDisk { get; set; }

// /// <summary>Gets or sets the target storage account ARM Id.</summary>
// public string StorageContainerId { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901
{
public class AzStackHCINicInput
public class AzLocalNicInput
{
public AzStackHCINicInput(
public AzLocalNicInput(
string nicId,
string targetNetworkId,
string testNetworkId,
Expand All @@ -20,10 +20,10 @@ public AzStackHCINicInput(
/// <summary>Gets or sets the NIC Id.</summary>
public string NicId { get; set; }

/// <summary>Gets or sets the target network Id within AzStackHCI Cluster.</summary>
/// <summary>Gets or sets the target network Id within Azure Local Cluster.</summary>
public string TargetNetworkId { get; set; }

/// <summary>Gets or sets the target test network Id within AzStackHCI Cluster.</summary>
/// <summary>Gets or sets the target test network Id within Azure Local Cluster.</summary>
public string TestNetworkId { get; set; }

/// <summary>Gets or sets the selection type of the NIC.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
.Synopsis
Retrieves the status of an Azure Migrate job.
.Description
The Get-AzMigrateHCIJob cmdlet retrives the status of an Azure Migrate job.
The Get-AzMigrateLocalJob cmdlet retrives the status of an Azure Migrate job.
.Link
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehcijob
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocaljob
#>
function Get-AzMigrateHCIJob {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IWorkflowModel])]
function Get-AzMigrateLocalJob {
[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.")]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])]
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'GetById', Mandatory)]
Expand Down Expand Up @@ -183,6 +184,6 @@ function Get-AzMigrateHCIJob {
$null = $PSBoundParameters.Add('JobName', $Name)
}

return Az.Migrate.Internal\Get-AzMigrateWorkflow @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
return Az.Migrate.Internal\Get-AzMigrateLocalReplicationJob @PSBoundParameters -ErrorVariable notPresent -ErrorAction SilentlyContinue
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
.Synopsis
Retrieves the details of the replicating server.
.Description
The Get-AzMigrateHCIServerReplication cmdlet retrieves the object for the replicating server.
The Get-AzMigrateLocalServerReplication cmdlet retrieves the object for the replicating server.
.Link
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratehciserverreplication
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratelocalserverreplication
#>
function Get-AzMigrateHCIServerReplication {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.IProtectedItemModel])]
function Get-AzMigrateLocalServerReplication {
[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.")]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IProtectedItemModel])]
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
param(
[Parameter(ParameterSetName = 'GetByItemID', Mandatory)]
Expand Down Expand Up @@ -131,7 +132,7 @@ function Get-AzMigrateHCIServerReplication {
)

process {
Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
Import-Module $PSScriptRoot\Helper\AzLocalCommonSettings.ps1

$parameterSet = $PSCmdlet.ParameterSetName
$null = $PSBoundParameters.Remove('TargetObjectID')
Expand Down Expand Up @@ -194,7 +195,7 @@ function Get-AzMigrateHCIServerReplication {

$VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
if ([string]::IsNullOrEmpty($VaultName)) {
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateHCIReplicationInfrastructure script before proceeding."
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateLocalReplicationInfrastructure script before proceeding."
}

$null = $PSBoundParameters.Add("VaultName", $VaultName)
Expand Down Expand Up @@ -236,7 +237,7 @@ function Get-AzMigrateHCIServerReplication {

$VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
if ([string]::IsNullOrEmpty($VaultName)) {
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateHCIReplicationInfrastructure script before proceeding."
throw "Azure Migrate Project not configured: missing replication vault. Setup Azure Migrate Project and run the Initialize-AzMigrateLocalReplicationInfrastructure script before proceeding."
}

$null = $PSBoundParameters.Add("VaultName", $VaultName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$AzStackHCIInstanceTypes = @{
HyperVToAzStackHCI = "HyperVToAzStackHCI";
VMwareToAzStackHCI = "VMwareToAzStackHCI";
$AzLocalInstanceTypes = @{
HyperVToAzLocal = "HyperVToAzStackHCI";
VMwareToAzLocal = "VMwareToAzStackHCI";
}

# Fabric instances
$FabricInstanceTypes = @{
HyperVInstance = "HyperVMigrate";
VMwareInstance = "VMwareMigrate";
AzStackHCIInstance = "AzStackHCI";
AzLocalInstance = "AzStackHCI";
}

$ReplicationDetails = @{
Expand All @@ -27,7 +27,7 @@ $ApiVersions = @{
StorageAccount = "2021-09-01";
HyperVSites = "2020-01-01";
ProtectedItem = "2021-02-16-preview";
AzStackHCI = "2021-09-01-preview";
AzLocal = "2021-09-01-preview";
}

# Role definition GUIDs for storage account creation
Expand Down
Loading

0 comments on commit f055fc9

Please sign in to comment.