Skip to content

Add Get-AzMigrateServerMigrationStatus cmdlet and associated documentation. #27759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
3 changes: 3 additions & 0 deletions src/Migrate/Migrate.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@
[assembly: System.Reflection.AssemblyVersionAttribute("2.7.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]



Large diffs are not rendered by default.

5 changes: 4 additions & 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: f86539fb-ae5e-499c-af58-5b21bbeef039
Module Guid: ac145a87-2ada-4b6f-9d19-a70ac116949d
Download Help Link: https://learn.microsoft.com/powershell/module/az.migrate
Help Version: 1.0.0.0
Locale: en-US
Expand Down Expand Up @@ -47,6 +47,9 @@ Gets the details of registered recovery services provider.
### [Get-AzMigrateRunAsAccount](Get-AzMigrateRunAsAccount.md)
Method to get run as account.

### [Get-AzMigrateServerMigrationStatus](Get-AzMigrateServerMigrationStatus.md)
Retrieves the details of the replicating server status.

### [Get-AzMigrateServerReplication](Get-AzMigrateServerReplication.md)
Retrieves the details of the replicating server.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
---
external help file:
Module Name: Az.Migrate
online version: https://learn.microsoft.com/powershell/module/az.migrate/get-azmigrateservermigrationstatus
schema: 2.0.0
---

# Get-AzMigrateServerMigrationStatus

## SYNOPSIS
Retrieves the details of the replicating server status.

## SYNTAX

### ListByName (Default)
```
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String>
[-SubscriptionId <String>] [-Filter <String>] [-SkipToken <String>] [-DefaultProfile <PSObject>]
[<CommonParameters>]
```

### GetByApplianceName
```
Get-AzMigrateServerMigrationStatus -ApplianceName <String> -ProjectName <String> -ResourceGroupName <String>
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [<CommonParameters>]
```

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

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

## DESCRIPTION
The Get-AzMigrateServerMigrationStatus cmdlet retrieves the replication status for the replicating server.

## EXAMPLES

### Example 1: List status by project name.
```powershell
Get-AzMigrateServerMigrationStatus -ResourceGroupName cbtpvtrg -ProjectName migpvt
```

```output
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




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

Get by project name.

### Example 2: List status by machine name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -MachineName "CVM-Win2019"
```

```output
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 State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
---- ----- -------- ----------- ------------- ----------- ---------
TestVM DeltaReplication Completed - - - - Shared_1TB
CVM-Win2019 DeltaReplication Completed - - - - datastore1
```

Get by machine name.

### Example 2: List status by appliance name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -ApplianceName "migpvt"
```

```output
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 resolve the health issue use the command
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
```

Get by appliance name.

## PARAMETERS

### -ApplianceName
Specifies the name of the appliance.

```yaml
Type: System.String
Parameter Sets: GetByApplianceName
Aliases:

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

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.

```yaml
Type: System.Management.Automation.PSObject
Parameter Sets: (All)
Aliases: AzureRMContext, AzureCredential

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

### -Filter
OData filter options.

```yaml
Type: System.String
Parameter Sets: ListByName
Aliases:

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

### -Health
Specifies whether the health issues to show for replicating server.

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

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

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

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

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

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

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

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

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

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

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

### -SkipToken
The pagination token.

```yaml
Type: System.String
Parameter Sets: ListByName
Aliases:

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

### -SubscriptionId
Azure Subscription ID.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: (Get-AzContext).Subscription.Id
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
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).

## INPUTS

## OUTPUTS

### System.Management.Automation.PSObject[]

## NOTES

## RELATED LINKS

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
### Example 1: List status by project name.
```powershell
Get-AzMigrateServerMigrationStatus -ResourceGroupName cbtpvtrg -ProjectName migpvt
```

```output
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




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

Get by project name.

### Example 2: List status by machine name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -MachineName "CVM-Win2019"
```

```output
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 State Progress TimeElapsed TimeRemaining UploadSpeed Datastore
---- ----- -------- ----------- ------------- ----------- ---------
TestVM DeltaReplication Completed - - - - Shared_1TB
CVM-Win2019 DeltaReplication Completed - - - - datastore1
```

Get by machine name.

### Example 2: List status by appliance name.
```powershell
Get-AzMigrateServerMigrationStatus -ProjectName "migpvt-ecyproj" -ResourceGroupName "cbtprivatestamprg" -ApplianceName "migpvt"
```

```output
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 resolve the health issue use the command
Get-AzMigrateServerMigrationStatus -ProjectName <String> -ResourceGroupName <String> -MachineName <String> -Health
```

Get by appliance name.
2 changes: 1 addition & 1 deletion src/Migrate/Migrate.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "46df379f-23ec-4e1f-b9b2-d493388e0d5c"
"generate_Id": "145f526c-1786-4548-bea6-6c9c35ec0f0e"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
if(($null -eq $TestName) -or ($TestName -contains 'Get-AzMigrateServerMigrationStatus'))
{
$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1'
if (-Not (Test-Path -Path $loadEnvPath)) {
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
}
. ($loadEnvPath)
$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzMigrateServerMigrationStatus.Recording.json'
$currentPath = $PSScriptRoot
while(-not $mockingPath) {
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
$currentPath = Split-Path -Path $currentPath -Parent
}
. ($mockingPath | Select-Object -First 1).FullName
}

Describe 'Get-AzMigrateServerMigrationStatus' {
It 'ListByName' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'GetByApplianceName' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'GetByMachineName' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}

It 'GetHealthByMachineName' -skip {
{ throw [System.NotImplementedException] } | Should -Not -Throw
}
}
Loading