Skip to content

Commit

Permalink
Az.Migrate support new Data.Replication (#23615)
Browse files Browse the repository at this point in the history
* Support new scenario in Az.Migrate

* Added retry on get machine site.

* Add READMEs

* Revert changes

---------

Co-authored-by: Sam Lee <samlee3@microsoft.com>
Co-authored-by: Helen Afework <helenafework@microsoft.com>
  • Loading branch information
3 people authored Jan 26, 2024
1 parent 0faaaad commit 1c76c97
Show file tree
Hide file tree
Showing 94 changed files with 9,892 additions and 489 deletions.
117 changes: 108 additions & 9 deletions src/Migrate/Migrate.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ commit: 0dd49a444195fef7f3555cad038cb7665cbd928c
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/2023-01-01/service.json
- $(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/2023-01-01/service.json
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json

module-version: 1.0.1
title: Migrate
Expand Down Expand Up @@ -105,6 +106,22 @@ directive:
- ProtectionContainerMappingProviderSpecificDetails
- MigrateProjectProperties
- FabricProperties
- FabricModelProperties
- FabricModelCustomProperties
- AzStackHCIFabricModelCustomProperties
- HyperVMigrateFabricModelCustomProperties
- VMwareMigrateFabricModelCustomProperties
- PolicyModelProperties
- ReplicationExtensionModelProperties
- ProtectedItemModelProperties
- ProtectedItemModelCustomProperties
- HyperVToAzStackHCIProtectedItemModelCustomProperties
- VMwareToAzStackHCIProtectedItemModelCustomProperties
- PlannedFailoverModelProperties
- WorkflowModelProperties
- WorkflowModelCustomProperties
- TaskModel
- TaskModelCustomProperties
# Remove variants not in scope
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
Expand Down Expand Up @@ -224,10 +241,6 @@ directive:
verb: New$|Remove$|Update$
subject: ^Site
remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
subject: ^HyperV
remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
subject: ^Job|^VMwareOperationsStatus
Expand All @@ -244,7 +257,12 @@ directive:
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
verb: Set$|Remove$|Update$
subject: ^Solution|ProjectSummary$
subject: ProjectSummary$
remove: true
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
verb: Remove$|Update$
subject: ^Solution
remove: true
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
Expand All @@ -261,7 +279,7 @@ directive:
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
subject: ^Commit|^Planned|^Renew|^Reprotect|^Unplanned|VaultHealth$|ComputeSize$|FabricConsistency$
subject: ^Commit|^Renew|^Reprotect|^Unplanned|VaultHealth$|ComputeSize$|FabricConsistency$
remove: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
Expand Down Expand Up @@ -298,7 +316,74 @@ directive:
verb: New
subject: ^ReplicationVaultSetting|^SupportedOperatingSystem|^ReplicationProtectionIntent
remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
verb: Get
subject: ^HyperV(Cluster|Host|Job|OperationsStatus)$
remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
verb: Set
subject: ^HyperV(Cluster|Host)$
remove: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
verb: New|Remove|Update
subject: ^HyperV
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: Test|Invoke
subject: NameAvailability$|DeploymentPreflight
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: Get|New
subject: ^EmailConfiguration
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: Get
subject: ^(Dra|ProtectedItem|Vault|Workflow)OperationStatus$
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: Get
subject: ^FabricOperationsStatus$
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: New
subject: ^(Dra|Vault)
remove: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: Update
subject: ^Vault
remove: true
- from: Microsoft.RecoveryServices/stable/2023-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
where:
verb: Get
subject: ^Fabric$
set:
subject: HCIReplicationFabric
# Hide cmldets used by custom
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
verb: Set$
subject: ^Solution
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
verb: Get$
subject: ToAzureMigrate$
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
verb: Get$
Expand Down Expand Up @@ -344,6 +429,15 @@ directive:
verb: Resume$
subject: ^ReplicationMigrationItemReplication
hide: true
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
where:
subject: ^Planned
hide: true
- from: Microsoft.OffAzure/stable/2020-01-01/migrate.json
where:
verb: Get
subject: ^HyperV(Site|RunAsAccount)$
hide: true
# Hide cmdlets not to be visible to user.
- from: Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
where:
Expand Down Expand Up @@ -373,6 +467,11 @@ directive:
verb: New$
variant: ^CreateViaIdentity
hide: true
- from: Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
where:
verb: Get$|Invoke$|New$|Remove$|Test$|Update$
subject: ^Dra|^Fabric|^Policy|^EmailConfiguration|^ProtectedItem|^ReplicationExtension|^Vault|^Workflow
hide: true
- where:
verb: New$|Set$|Update$
subject: Site$|VCenter$
Expand Down
40 changes: 40 additions & 0 deletions src/Migrate/Migrate.Autorest/custom/AzStackHCIDiskInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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
{
public class AzStackHCIDiskInput
{
public AzStackHCIDiskInput(
string diskId,
bool isDynamic,
long diskSizeGB,
string diskFileFormat,
bool isOsDisk)
{
DiskId = diskId;
IsDynamic = isDynamic;
DiskSizeGb = diskSizeGB;
DiskFileFormat = diskFileFormat;
IsOSDisk = isOsDisk;
}

/// <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 the disk size in GB.</summary>
public long DiskSizeGb { get; set; }

/// <summary>
/// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard
/// disk.
/// </summary>
public bool? IsDynamic { get; set; }

/// <summary>Gets or sets a value indicating whether disk is os disk.</summary>
public bool IsOSDisk { get; set; }
}
}
32 changes: 32 additions & 0 deletions src/Migrate/Migrate.Autorest/custom/AzStackHCINicInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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
{
public class AzStackHCINicInput
{
public AzStackHCINicInput(
string nicId,
string targetNetworkId,
string testNetworkId,
string selectionTypeForFailover)
{
NicId = nicId;
TargetNetworkId = targetNetworkId;
TestNetworkId = testNetworkId;
SelectionTypeForFailover = selectionTypeForFailover;
}

/// <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>
public string TargetNetworkId { get; set; }

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

/// <summary>Gets or sets the selection type of the NIC.</summary>
public string SelectionTypeForFailover { get; set; }
}
}
Loading

0 comments on commit 1c76c97

Please sign in to comment.