Skip to content

Commit e75155f

Browse files
Revert "Enhance Get-AzMigrateServerMigrationStatus cmdlet to support -Expedit…"
This reverts commit 26a72c5.
1 parent a9c3a32 commit e75155f

File tree

57 files changed

+550
-1007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+550
-1007
lines changed

src/Migrate/Migrate.Autorest/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
2121
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
2222
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Migrate")]
23-
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.9.0")]
24-
[assembly: System.Reflection.AssemblyVersionAttribute("2.9.0")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.8.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("2.8.0")]
2525
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
2626
[assembly: System.CLSCompliantAttribute(false)]

src/Migrate/Migrate.Autorest/custom/Az.Migrate.custom.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# region Generated
22
# Load the private module dll
3-
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Migrate.private.dll')
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Migrate.private.dll')
44

55
# Load the internal module
6-
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Migrate.internal.psm1'
6+
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Migrate.internal.psm1'
77
if(Test-Path $internalModulePath) {
88
$null = Import-Module -Name $internalModulePath
99
}

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

Lines changed: 109 additions & 369 deletions
Large diffs are not rendered by default.

src/Migrate/Migrate.Autorest/custom/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Custom
2-
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.
2+
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.
33

44
## Info
55
- Modifiable: yes
@@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
1515
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.
1616

1717
## Purpose
18-
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.
18+
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.
1919

2020
## Usage
21-
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:
21+
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:
2222
- Break
2323
- DefaultProfile
2424
- HttpPipelineAppend
@@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
3636
- `Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute`
3737
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Migrate`.
3838
- `Microsoft.Azure.PowerShell.Cmdlets.Migrate.InternalExportAttribute`
39-
- 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.
39+
- 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.
4040
- `Microsoft.Azure.PowerShell.Cmdlets.Migrate.ProfileAttribute`
4141
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

src/Migrate/Migrate.Autorest/docs/Az.Migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Migrate
3-
Module Guid: 54155e7c-dd37-4932-9420-89a7bcdd9892
3+
Module Guid: 7cbf023d-6b60-494a-8cdb-ab27463fef7d
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.migrate
55
Help Version: 1.0.0.0
66
Locale: en-US

src/Migrate/Migrate.Autorest/docs/Get-AzMigrateServerMigrationStatus.md

Lines changed: 27 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ Get-AzMigrateServerMigrationStatus -MachineName <String> -ProjectName <String> -
3131
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
3232
```
3333

34-
### GetByPrioritiseServer
35-
```
36-
Get-AzMigrateServerMigrationStatus -Expedite -MachineName <String> -ProjectName <String>
37-
-ResourceGroupName <String> [-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
38-
```
39-
4034
### GetHealthByMachineName
4135
```
4236
Get-AzMigrateServerMigrationStatus -Health -MachineName <String> -ProjectName <String>
@@ -50,16 +44,14 @@ The Get-AzMigrateServerMigrationStatus cmdlet retrieves the replication status f
5044

5145
### Example 1: List status by project name.
5246
```powershell
53-
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg"
47+
Get-AzMigrateServerMigrationStatus -ResourceGroupName cbtpvtrg -ProjectName migpvt
5448
```
5549

5650
```output
57-
58-
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore ESXiHost
59-
--------- ------ ----- -------- ----------- ------------- ----------- ------ -------- --------- --------
60-
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
61-
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
62-
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
51+
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore
52+
--------- ------ ----- -------- ----------- ------------- ----------- ------ -------- ---------
53+
migpvt CVM-Win2019 DeltaReplication Completed - - - - Normal 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
54+
migpvt CVM-Win2022 DeltaReplication Completed - - - - Normal 12/7/2023, 10:41:42 AM datastore1
6355
6456
6557
@@ -72,102 +64,44 @@ Get by project name.
7264

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

7870
```output
79-
Server Rhel8-Vm is currently healthy.
80-
81-
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync ESXiHost Datastore
82-
--------- ------ ----- -------- ----------- ------------- ----------- -------- -------- ---------
83-
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
71+
Server CVM-Win2019 is currently healthy.
8472
73+
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync Datastore
74+
--------- ------ ----- -------- ----------- ------------- ----------- -------- ---------
75+
migpvt CVM-Win2019 DeltaReplication Completed - - - - 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
8576
8677
87-
Disk Level Operation Status:
8878
89-
Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
90-
---- ----- -------- ----------- ------------- ----------- ---------
91-
Rhel8-Vm DeltaReplication Completed - - - - IDCLAB-B161-3TB
79+
Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
80+
---- ----- -------- ----------- ------------- ----------- ---------
81+
TestVM DeltaReplication Completed - - - - Shared_1TB
82+
CVM-Win2019 DeltaReplication Completed - - - - datastore1
9283
```
9384

9485
Get by machine name.
9586

96-
### Example 3: List status by appliance name.
87+
### Example 2: List status by appliance name.
9788
```powershell
98-
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg" -ApplianceName "cbtresyncgql"
89+
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -ApplianceName "migpvt"
9990
```
10091

10192
```output
102-
Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore ESXiHost
103-
------ ----- -------- ----------- ------------- ----------- ------ -------- --------- --------
104-
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
105-
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
106-
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
93+
Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore
94+
------ ----- -------- ----------- ------------- ----------- ------ -------- ---------
95+
CVM-Win2019 DeltaReplication Completed - - - - Normal 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
96+
CVM-Win2022 DeltaReplication Completed - - - - Normal 12/7/2023, 10:41:42 AM datastore1
10797
10898
109-
To check expedite the operation of a server use the command
110-
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Expedite
111-
11299
To resolve the health issue use the command
113100
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
114101
```
115102

116103
Get by appliance name.
117104

118-
### Example 4: Expedite replication for a server.
119-
```powershell
120-
Get-AzMigrateServerMigrationStatus -ProjectName "cbt-resync-gql" -ResourceGroupName "ankitbaluni-resync-rg" -MachineName "Rhel8-Vm" -Expedite
121-
```
122-
123-
```output
124-
Server Information:
125-
126-
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync ESXiHost Datastore
127-
--------- ------ ----- -------- ----------- ------------- ----------- -------- -------- ---------
128-
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
129-
130-
131-
132-
Disk Level Operation Status:
133-
134-
Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
135-
---- ----- -------- ----------- ------------- ----------- ---------
136-
Rhel8-Vm DeltaReplication Completed - - - - IDCLAB-B161-3TB
137-
138-
139-
Resource Sharing:
140-
141-
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.
142-
143-
Appliance Server SharedResourceType State TimeRemaining ESXiHost Datastore
144-
--------- ------ ------------------ ----- ------------- -------- ---------
145-
cbtresyncgql wave-selfhost-vm8 Appliance DeltaReplication Completed - idclab-vcen8.fareast.corp.microsoft.com_10.150.102.191 Shared_1TB
146-
cbtresyncgql el41-r5w12r2-1 Appliance DeltaReplication Completed - idclab-vcen65.corp.microsoft.com_10.150.84.28 IDCLAB-T100_10TB
147-
cbtresyncgql el41-r5w2k8r2-1 Appliance DeltaReplication Completed - idclab-vcen65.corp.microsoft.com_10.150.84.28 IDCLAB-T100_10TB
148-
cbtresyncgql el41-r5w12r1-2 Appliance DeltaReplication Completed - idclab-vcen65.corp.microsoft.com_10.150.84.28 IDCLAB-T100_10TB
149-
cbtresyncgql ubuntu22-liverserver-bios-nolvm Appliance, ESXiHost, Datastore DeltaReplication Completed - idclab-vcen8.fareast.corp.microsoft.com_10.150.102.181 IDCLAB-B161-3TB
150-
151-
152-
Resource utilization information for migration operations:
153-
154-
Resource Capacity Utilization for server migrations Total utilization Status
155-
-------- -------- --------------------------------- ----------------- ------
156-
Appliance RAM Sum : Primary and scale out appliances 32768 MB 1808 MB 7014 MB Underutilized
157-
Appliance CPU Sum : Primary and scale out appliances 4 Cores - 99% At capacity
158-
Network bandwidth Sum : Primary and scale out appliances 1192 MBps - - Underutilized
159-
ESXi host NFC buffer 32 MB 8 MB - Underutilized
160-
Parallel Disks Replicated Sum : Primary and scale out appliances 58 3 - Underutilized
161-
Datastore 'IDCLAB-B161-3TB' Snapshot Count 15 2 - Underutilized
162-
163-
164-
Based on the resource utilization seen above, here are suggestions to expedite server Rhel8-Vm migration:
165-
166-
1. CPU is At capacity. Pause or stop other migrations under this appliance, or increase CPU resources if possible.
167-
```
168-
169-
Expedite replication for a specific server.
170-
171105
## PARAMETERS
172106

173107
### -ApplianceName
@@ -200,21 +134,6 @@ Accept pipeline input: False
200134
Accept wildcard characters: False
201135
```
202136
203-
### -Expedite
204-
Specifies whether to expedite the operation of a replicating server.
205-
206-
```yaml
207-
Type: System.Management.Automation.SwitchParameter
208-
Parameter Sets: GetByPrioritiseServer
209-
Aliases:
210-
211-
Required: True
212-
Position: Named
213-
Default value: None
214-
Accept pipeline input: False
215-
Accept wildcard characters: False
216-
```
217-
218137
### -Filter
219138
OData filter options.
220139
@@ -246,11 +165,12 @@ Accept wildcard characters: False
246165
```
247166
248167
### -MachineName
249-
Specifies the display name of the replicating machine.
168+
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
169+
Specifies the display name of the replicating machine.
250170
251171
```yaml
252172
Type: System.String
253-
Parameter Sets: GetByMachineName, GetByPrioritiseServer, GetHealthByMachineName
173+
Parameter Sets: GetByMachineName, GetHealthByMachineName
254174
Aliases:
255175

256176
Required: True
@@ -261,7 +181,8 @@ Accept wildcard characters: False
261181
```
262182
263183
### -ProjectName
264-
Specifies the Azure Migrate project in the current subscription.
184+
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
185+
Specifies the Azure Migrate project in the current subscription.
265186
266187
```yaml
267188
Type: System.String
@@ -276,7 +197,8 @@ Accept wildcard characters: False
276197
```
277198
278199
### -ResourceGroupName
279-
Specifies the Resource Group of the Azure Migrate Project in the current subscription.
200+
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
201+
Specifies the Resource Group of the Azure Migrate Project in the current subscription.
280202
281203
```yaml
282204
Type: System.String

0 commit comments

Comments
 (0)