Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Migrate/Migrate.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[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.9.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.9.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.8.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.8.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
4 changes: 2 additions & 2 deletions src/Migrate/Migrate.Autorest/custom/Az.Migrate.custom.psm1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Migrate.private.dll')
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Migrate.private.dll')

# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Migrate.internal.psm1'
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Migrate.internal.psm1'
if(Test-Path $internalModulePath) {
$null = Import-Module -Name $internalModulePath
}
Expand Down

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Migrate/Migrate.Autorest/custom/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Custom
This directory contains custom implementation for non-generated cmdlets for the `Az.Migrate` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.Migrate.custom.psm1`. This file should not be modified.
This directory contains custom implementation for non-generated cmdlets for the `Az.Migrate` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Migrate.custom.psm1`. This file should not be modified.

## Info
- Modifiable: yes
Expand All @@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
For script cmdlets, these are loaded via the `Az.Migrate.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.

## Purpose
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder.
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.

## Usage
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
- Break
- DefaultProfile
- HttpPipelineAppend
Expand All @@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
- `Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute`
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Migrate`.
- `Microsoft.Azure.PowerShell.Cmdlets.Migrate.InternalExportAttribute`
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Migrate`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Migrate`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
- `Microsoft.Azure.PowerShell.Cmdlets.Migrate.ProfileAttribute`
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
2 changes: 1 addition & 1 deletion src/Migrate/Migrate.Autorest/docs/Az.Migrate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Migrate
Module Guid: 54155e7c-dd37-4932-9420-89a7bcdd9892
Module Guid: 7cbf023d-6b60-494a-8cdb-ab27463fef7d
Download Help Link: https://learn.microsoft.com/powershell/module/az.migrate
Help Version: 1.0.0.0
Locale: en-US
Expand Down
132 changes: 27 additions & 105 deletions src/Migrate/Migrate.Autorest/docs/Get-AzMigrateServerMigrationStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ Get-AzMigrateServerMigrationStatus -MachineName <String> -ProjectName <String> -
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
```

### GetByPrioritiseServer
```
Get-AzMigrateServerMigrationStatus -Expedite -MachineName <String> -ProjectName <String>
-ResourceGroupName <String> [-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
```

### GetHealthByMachineName
```
Get-AzMigrateServerMigrationStatus -Health -MachineName <String> -ProjectName <String>
Expand All @@ -50,16 +44,14 @@ The Get-AzMigrateServerMigrationStatus cmdlet retrieves the replication status f

### Example 1: List status by project name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg"
Get-AzMigrateServerMigrationStatus -ResourceGroupName cbtpvtrg -ProjectName migpvt
```

```output

Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore ESXiHost
--------- ------ ----- -------- ----------- ------------- ----------- ------ -------- --------- --------
nosbm-test-ds el41-r5w12r1-3 InitialReplication InProgress 48 % 3 hr 48 min 12 hr 37 min 1230 Mbps Normal - IDCLAB-T100_10TB idclab-vcen65.corp.microsoft.com_10.150.84.28
nosbm-test-ds el41-r5w2k8r2-1 DeltaReplication Completed - - - - Normal 9/4/2025, 3:04:45 PM IDCLAB-T100_10TB idclab-vcen65.corp.microsoft.com_10.150.84.28
nosbm-test-ds dsinha-cbt-test DeltaReplication Completed - - - - Normal 9/4/2025, 2:58:21 PM IDCLAB-T100_10TB idclab-vcen65.corp.microsoft.com_10.150.84.28
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore
--------- ------ ----- -------- ----------- ------------- ----------- ------ -------- ---------
migpvt CVM-Win2019 DeltaReplication Completed - - - - Normal 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
migpvt CVM-Win2022 DeltaReplication Completed - - - - Normal 12/7/2023, 10:41:42 AM datastore1



Expand All @@ -72,102 +64,44 @@ Get by project name.

### Example 2: List status by machine name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg" -MachineName "Rhel8-Vm"
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -MachineName "CVM-Win2019"
```

```output
Server Rhel8-Vm is currently healthy.

Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync ESXiHost Datastore
--------- ------ ----- -------- ----------- ------------- ----------- -------- -------- ---------
cbtresyncgql Rhel8-Vm DeltaReplication Completed - - - - 7/14/2025, 9:51:05 PM idclab-vcen8.fareast.corp.microsoft.com_10.150.102.181 IDCLAB-B161-3TB
Server CVM-Win2019 is currently healthy.

Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync Datastore
--------- ------ ----- -------- ----------- ------------- ----------- -------- ---------
migpvt CVM-Win2019 DeltaReplication Completed - - - - 12/7/2023, 11:18:07 AM Shared_1TB, datastore1


Disk Level Operation Status:

Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
---- ----- -------- ----------- ------------- ----------- ---------
Rhel8-Vm DeltaReplication Completed - - - - IDCLAB-B161-3TB
Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
---- ----- -------- ----------- ------------- ----------- ---------
TestVM DeltaReplication Completed - - - - Shared_1TB
CVM-Win2019 DeltaReplication Completed - - - - datastore1
```

Get by machine name.

### Example 3: List status by appliance name.
### Example 2: List status by appliance name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg" -ApplianceName "cbtresyncgql"
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -ApplianceName "migpvt"
```

```output
Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore ESXiHost
------ ----- -------- ----------- ------------- ----------- ------ -------- --------- --------
el41-r5w12r1-3 InitialReplication InProgress 48 % 3 hr 48 min 12 hr 37 min 1230 Mbps Normal - IDCLAB-T100_10TB idclab-vcen65.corp.microsoft.com_10.150.84.28
el41-r5w2k8r2-1 DeltaReplication Completed - - - - Normal 9/4/2025, 3:04:45 PM IDCLAB-T100_10TB idclab-vcen65.corp.microsoft.com_10.150.84.28
dsinha-cbt-test DeltaReplication Completed - - - - Normal 9/4/2025, 2:58:21 PM IDCLAB-T100_10TB idclab-vcen65.corp.microsoft.com_10.150.84.28
Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore
------ ----- -------- ----------- ------------- ----------- ------ -------- ---------
CVM-Win2019 DeltaReplication Completed - - - - Normal 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
CVM-Win2022 DeltaReplication Completed - - - - Normal 12/7/2023, 10:41:42 AM datastore1


To check expedite the operation of a server use the command
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Expedite

To resolve the health issue use the command
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
```

Get by appliance name.

### Example 4: Expedite replication for a server.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg" -MachineName "Rhel8-Vm" -Expedite
```

```output
Server Information:

Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync ESXiHost Datastore
--------- ------ ----- -------- ----------- ------------- ----------- -------- -------- ---------
cbtresyncgql Rhel8-Vm DeltaReplication Completed - - - - 7/14/2025, 9:51:05 PM idclab-vcen8.fareast.corp.microsoft.com_10.150.102.181 IDCLAB-B161-3TB



Disk Level Operation Status:

Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
---- ----- -------- ----------- ------------- ----------- ---------
Rhel8-Vm DeltaReplication Completed - - - - IDCLAB-B161-3TB


Resource Sharing:

The following VMs share at least one resource (Appliance, ESXi Host, or Datastore) with VM 'Rhel8-Vm'. The 'SharedResourceType' and 'SharedResourceName' columns indicate which resource is shared.

Appliance Server SharedResourceType State TimeRemaining ESXiHost Datastore
--------- ------ ------------------ ----- ------------- -------- ---------
cbtresyncgql wave-selfhost-vm8 Appliance DeltaReplication Completed - idclab-vcen8.fareast.corp.microsoft.com_10.150.102.191 Shared_1TB
cbtresyncgql el41-r5w12r2-1 Appliance DeltaReplication Completed - idclab-vcen65.corp.microsoft.com_10.150.84.28 IDCLAB-T100_10TB
cbtresyncgql el41-r5w2k8r2-1 Appliance DeltaReplication Completed - idclab-vcen65.corp.microsoft.com_10.150.84.28 IDCLAB-T100_10TB
cbtresyncgql el41-r5w12r1-2 Appliance DeltaReplication Completed - idclab-vcen65.corp.microsoft.com_10.150.84.28 IDCLAB-T100_10TB
cbtresyncgql ubuntu22-liverserver-bios-nolvm Appliance, ESXiHost, Datastore DeltaReplication Completed - idclab-vcen8.fareast.corp.microsoft.com_10.150.102.181 IDCLAB-B161-3TB


Resource utilization information for migration operations:

Resource Capacity Utilization for server migrations Total utilization Status
-------- -------- --------------------------------- ----------------- ------
Appliance RAM Sum : Primary and scale out appliances 32768 MB 1808 MB 7014 MB Underutilized
Appliance CPU Sum : Primary and scale out appliances 4 Cores - 99% At capacity
Network bandwidth Sum : Primary and scale out appliances 1192 MBps - - Underutilized
ESXi host NFC buffer 32 MB 8 MB - Underutilized
Parallel Disks Replicated Sum : Primary and scale out appliances 58 3 - Underutilized
Datastore 'IDCLAB-B161-3TB' Snapshot Count 15 2 - Underutilized


Based on the resource utilization seen above, here are suggestions to expedite server Rhel8-Vm migration:

1. CPU is At capacity. Pause or stop other migrations under this appliance, or increase CPU resources if possible.
```

Expedite replication for a specific server.

## PARAMETERS

### -ApplianceName
Expand Down Expand Up @@ -200,21 +134,6 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Expedite
Specifies whether to expedite the operation of a replicating server.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: GetByPrioritiseServer
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Filter
OData filter options.

Expand Down Expand Up @@ -246,11 +165,12 @@ Accept wildcard characters: False
```

### -MachineName
Specifies the display name of the replicating machine.
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
Specifies the display name of the replicating machine.

```yaml
Type: System.String
Parameter Sets: GetByMachineName, GetByPrioritiseServer, GetHealthByMachineName
Parameter Sets: GetByMachineName, GetHealthByMachineName
Aliases:

Required: True
Expand All @@ -261,7 +181,8 @@ Accept wildcard characters: False
```

### -ProjectName
Specifies the Azure Migrate project in the current subscription.
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
Specifies the Azure Migrate project in the current subscription.

```yaml
Type: System.String
Expand All @@ -276,7 +197,8 @@ Accept wildcard characters: False
```

### -ResourceGroupName
Specifies the Resource Group of the Azure Migrate Project in the current subscription.
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
Specifies the Resource Group of the Azure Migrate Project in the current subscription.

```yaml
Type: System.String
Expand Down
Loading