Skip to content

Commit 2af888b

Browse files
ankitbaluni123Ankit Baluni (from Dev Box)
andauthored
Add Get-AzMigrateServerMigrationStatus cmdlet and associated documentation. (#27759)
Co-authored-by: Ankit Baluni (from Dev Box) <[email protected]>
1 parent 4715e55 commit 2af888b

12 files changed

+1257
-18
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@
2424
[assembly: System.Reflection.AssemblyVersionAttribute("2.7.0")]
2525
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
2626
[assembly: System.CLSCompliantAttribute(false)]
27+
28+
29+

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

Lines changed: 622 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Migrate
3-
Module Guid: f86539fb-ae5e-499c-af58-5b21bbeef039
3+
Module Guid: ac145a87-2ada-4b6f-9d19-a70ac116949d
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.migrate
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -47,6 +47,9 @@ Gets the details of registered recovery services provider.
4747
### [Get-AzMigrateRunAsAccount](Get-AzMigrateRunAsAccount.md)
4848
Method to get run as account.
4949

50+
### [Get-AzMigrateServerMigrationStatus](Get-AzMigrateServerMigrationStatus.md)
51+
Retrieves the details of the replicating server status.
52+
5053
### [Get-AzMigrateServerReplication](Get-AzMigrateServerReplication.md)
5154
Retrieves the details of the replicating server.
5255

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
---
2+
external help file:
3+
Module Name: Az.Migrate
4+
online version: https://learn.microsoft.com/powershell/module/az.migrate/get-azmigrateservermigrationstatus
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzMigrateServerMigrationStatus
9+
10+
## SYNOPSIS
11+
Retrieves the details of the replicating server status.
12+
13+
## SYNTAX
14+
15+
### ListByName (Default)
16+
```
17+
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String>
18+
[-SubscriptionId <String>] [-Filter <String>] [-SkipToken <String>] [-DefaultProfile <PSObject>]
19+
[<CommonParameters>]
20+
```
21+
22+
### GetByApplianceName
23+
```
24+
Get-AzMigrateServerMigrationStatus -ApplianceName <String> -ProjectName <String> -ResourceGroupName <String>
25+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
26+
```
27+
28+
### GetByMachineName
29+
```
30+
Get-AzMigrateServerMigrationStatus -MachineName <String> -ProjectName <String> -ResourceGroupName <String>
31+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
32+
```
33+
34+
### GetHealthByMachineName
35+
```
36+
Get-AzMigrateServerMigrationStatus -Health -MachineName <String> -ProjectName <String>
37+
-ResourceGroupName <String> [-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
38+
```
39+
40+
## DESCRIPTION
41+
The Get-AzMigrateServerMigrationStatus cmdlet retrieves the replication status for the replicating server.
42+
43+
## EXAMPLES
44+
45+
### Example 1: List status by project name.
46+
```powershell
47+
Get-AzMigrateServerMigrationStatus -ResourceGroupName cbtpvtrg -ProjectName migpvt
48+
```
49+
50+
```output
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
55+
56+
57+
58+
59+
To resolve the health issue use the command
60+
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
61+
```
62+
63+
Get by project name.
64+
65+
### Example 2: List status by machine name.
66+
```powershell
67+
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -MachineName "CVM-Win2019"
68+
```
69+
70+
```output
71+
Server CVM-Win2019 is currently healthy.
72+
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
76+
77+
78+
79+
Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
80+
---- ----- -------- ----------- ------------- ----------- ---------
81+
TestVM DeltaReplication Completed - - - - Shared_1TB
82+
CVM-Win2019 DeltaReplication Completed - - - - datastore1
83+
```
84+
85+
Get by machine name.
86+
87+
### Example 2: List status by appliance name.
88+
```powershell
89+
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -ApplianceName "migpvt"
90+
```
91+
92+
```output
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
97+
98+
99+
To resolve the health issue use the command
100+
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
101+
```
102+
103+
Get by appliance name.
104+
105+
## PARAMETERS
106+
107+
### -ApplianceName
108+
Specifies the name of the appliance.
109+
110+
```yaml
111+
Type: System.String
112+
Parameter Sets: GetByApplianceName
113+
Aliases:
114+
115+
Required: True
116+
Position: Named
117+
Default value: None
118+
Accept pipeline input: False
119+
Accept wildcard characters: False
120+
```
121+
122+
### -DefaultProfile
123+
The credentials, account, tenant, and subscription used for communication with Azure.
124+
125+
```yaml
126+
Type: System.Management.Automation.PSObject
127+
Parameter Sets: (All)
128+
Aliases: AzureRMContext, AzureCredential
129+
130+
Required: False
131+
Position: Named
132+
Default value: None
133+
Accept pipeline input: False
134+
Accept wildcard characters: False
135+
```
136+
137+
### -Filter
138+
OData filter options.
139+
140+
```yaml
141+
Type: System.String
142+
Parameter Sets: ListByName
143+
Aliases:
144+
145+
Required: False
146+
Position: Named
147+
Default value: None
148+
Accept pipeline input: False
149+
Accept wildcard characters: False
150+
```
151+
152+
### -Health
153+
Specifies whether the health issues to show for replicating server.
154+
155+
```yaml
156+
Type: System.Management.Automation.SwitchParameter
157+
Parameter Sets: GetHealthByMachineName
158+
Aliases:
159+
160+
Required: True
161+
Position: Named
162+
Default value: None
163+
Accept pipeline input: False
164+
Accept wildcard characters: False
165+
```
166+
167+
### -MachineName
168+
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
169+
Specifies the display name of the replicating machine.
170+
171+
```yaml
172+
Type: System.String
173+
Parameter Sets: GetByMachineName, GetHealthByMachineName
174+
Aliases:
175+
176+
Required: True
177+
Position: Named
178+
Default value: None
179+
Accept pipeline input: False
180+
Accept wildcard characters: False
181+
```
182+
183+
### -ProjectName
184+
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
185+
Specifies the Azure Migrate project in the current subscription.
186+
187+
```yaml
188+
Type: System.String
189+
Parameter Sets: (All)
190+
Aliases:
191+
192+
Required: True
193+
Position: Named
194+
Default value: None
195+
Accept pipeline input: False
196+
Accept wildcard characters: False
197+
```
198+
199+
### -ResourceGroupName
200+
[Parameter(ParameterSetName = 'GetByPrioritiseServer', Mandatory)]
201+
Specifies the Resource Group of the Azure Migrate Project in the current subscription.
202+
203+
```yaml
204+
Type: System.String
205+
Parameter Sets: (All)
206+
Aliases:
207+
208+
Required: True
209+
Position: Named
210+
Default value: None
211+
Accept pipeline input: False
212+
Accept wildcard characters: False
213+
```
214+
215+
### -SkipToken
216+
The pagination token.
217+
218+
```yaml
219+
Type: System.String
220+
Parameter Sets: ListByName
221+
Aliases:
222+
223+
Required: False
224+
Position: Named
225+
Default value: None
226+
Accept pipeline input: False
227+
Accept wildcard characters: False
228+
```
229+
230+
### -SubscriptionId
231+
Azure Subscription ID.
232+
233+
```yaml
234+
Type: System.String
235+
Parameter Sets: (All)
236+
Aliases:
237+
238+
Required: False
239+
Position: Named
240+
Default value: (Get-AzContext).Subscription.Id
241+
Accept pipeline input: False
242+
Accept wildcard characters: False
243+
```
244+
245+
### CommonParameters
246+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
247+
248+
## INPUTS
249+
250+
## OUTPUTS
251+
252+
### System.Management.Automation.PSObject[]
253+
254+
## NOTES
255+
256+
## RELATED LINKS
257+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
### Example 1: List status by project name.
2+
```powershell
3+
Get-AzMigrateServerMigrationStatus -ResourceGroupName cbtpvtrg -ProjectName migpvt
4+
```
5+
6+
```output
7+
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore
8+
--------- ------ ----- -------- ----------- ------------- ----------- ------ -------- ---------
9+
migpvt CVM-Win2019 DeltaReplication Completed - - - - Normal 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
10+
migpvt CVM-Win2022 DeltaReplication Completed - - - - Normal 12/7/2023, 10:41:42 AM datastore1
11+
12+
13+
14+
15+
To resolve the health issue use the command
16+
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
17+
```
18+
19+
Get by project name.
20+
21+
### Example 2: List status by machine name.
22+
```powershell
23+
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -MachineName "CVM-Win2019"
24+
```
25+
26+
```output
27+
Server CVM-Win2019 is currently healthy.
28+
29+
Appliance Server State Progress TimeElapsed TimeRemaining UploadSpeed LastSync Datastore
30+
--------- ------ ----- -------- ----------- ------------- ----------- -------- ---------
31+
migpvt CVM-Win2019 DeltaReplication Completed - - - - 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
32+
33+
34+
35+
Disk State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
36+
---- ----- -------- ----------- ------------- ----------- ---------
37+
TestVM DeltaReplication Completed - - - - Shared_1TB
38+
CVM-Win2019 DeltaReplication Completed - - - - datastore1
39+
```
40+
41+
Get by machine name.
42+
43+
### Example 2: List status by appliance name.
44+
```powershell
45+
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -ApplianceName "migpvt"
46+
```
47+
48+
```output
49+
Server State Progress TimeElapsed TimeRemaining UploadSpeed Health LastSync Datastore
50+
------ ----- -------- ----------- ------------- ----------- ------ -------- ---------
51+
CVM-Win2019 DeltaReplication Completed - - - - Normal 12/7/2023, 11:18:07 AM Shared_1TB, datastore1
52+
CVM-Win2022 DeltaReplication Completed - - - - Normal 12/7/2023, 10:41:42 AM datastore1
53+
54+
55+
To resolve the health issue use the command
56+
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
57+
```
58+
59+
Get by appliance name.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "46df379f-23ec-4e1f-b9b2-d493388e0d5c"
2+
"generate_Id": "145f526c-1786-4548-bea6-6c9c35ec0f0e"
33
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzMigrateServerMigrationStatus'))
2+
{
3+
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
4+
if (-Not (Test-Path -Path $loadEnvPath)) {
5+
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
6+
}
7+
. ($loadEnvPath)
8+
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzMigrateServerMigrationStatus.Recording.json'
9+
$currentPath = $PSScriptRoot
10+
while(-not $mockingPath) {
11+
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
12+
$currentPath = Split-Path -Path $currentPath -Parent
13+
}
14+
. ($mockingPath | Select-Object -First 1).FullName
15+
}
16+
17+
Describe 'Get-AzMigrateServerMigrationStatus' {
18+
It 'ListByName' -skip {
19+
{ throw [System.NotImplementedException] } | Should -Not -Throw
20+
}
21+
22+
It 'GetByApplianceName' -skip {
23+
{ throw [System.NotImplementedException] } | Should -Not -Throw
24+
}
25+
26+
It 'GetByMachineName' -skip {
27+
{ throw [System.NotImplementedException] } | Should -Not -Throw
28+
}
29+
30+
It 'GetHealthByMachineName' -skip {
31+
{ throw [System.NotImplementedException] } | Should -Not -Throw
32+
}
33+
}

0 commit comments

Comments
 (0)