Skip to content

Commit 4c956ba

Browse files
committed
added missing changes
1 parent b823bfa commit 4c956ba

File tree

6 files changed

+38
-14
lines changed

6 files changed

+38
-14
lines changed

src/RecoveryServices/RecoveryServices.SiteRecovery/Fabrics/StartAzRecoveryServicesAsrSwitchAppliance.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class StartAzRecoveryServicesAsrSwitchAppliance : SiteRecoveryCmdletBase
3636
ParameterSetName = ASRParameterSets.Default,
3737
Mandatory = true)]
3838
[ValidateNotNullOrEmpty]
39-
[Alias("ConfigServer")]
4039
public ASRFabric Fabric { get; set; }
4140

4241
/// <summary>
@@ -81,16 +80,24 @@ public override void ExecuteSiteRecoveryCmdlet()
8180
{
8281
// Set the Fabric Name and Protection Container Name.
8382
string fabricName = this.Fabric.Name;
84-
var protectionContainerList = this.RecoveryServicesClient
85-
.GetAzureSiteRecoveryProtectionContainer(fabricName);
86-
string protectionContainerName = protectionContainerList[0].Name;
83+
string protectionContainerName = Utilities.GetValueFromArmId(
84+
this.ReplicationProtectedItem.ID,
85+
ARMResourceTypeConstants.ReplicationProtectionContainers);
8786

8887
var updateApplianceInput = new UpdateApplianceForReplicationProtectedItemInputProperties();
8988
if (this.ReplicationProtectedItem.ReplicationProvider.Equals(Constants.InMageRcm))
9089
{
9190
this.InMageRcmValidateSwitchApplianceInput();
9291
this.InMageRcmSwitchAppliance(updateApplianceInput);
9392
}
93+
else
94+
{
95+
throw new InvalidOperationException(
96+
string.Format(
97+
Resources.UnsupportedReplicationProviderOperation,
98+
this.ReplicationProtectedItem.ReplicationProvider,
99+
"SwitchAppliance"));
100+
}
94101

95102
var input = new UpdateApplianceForReplicationProtectedItemInput
96103
{

src/RecoveryServices/RecoveryServices.SiteRecovery/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/RecoveryServices/RecoveryServices.SiteRecovery/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,4 +543,7 @@ Recommended Action: To cleanup the resources created by Test failover run the Te
543543
<data name="TargetApplianceAlreadyMapped" xml:space="preserve">
544544
<value>The target appliance "{0}" is already mapped to the machine "{1}"</value>
545545
</data>
546+
<data name="UnsupportedReplicationProviderOperation" xml:space="preserve">
547+
<value>Unsupported replication provider {0} for this {1} operation</value>
548+
</data>
546549
</root>

src/RecoveryServices/RecoveryServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Azure Site Recovery multi appliance support for VMware to Azure disaster recovery scenarios using RCM as the control plane.
2122

2223
## Version 4.5.0
2324
* Added MSI based restore for managed virtual machines.

src/RecoveryServices/RecoveryServices/help/Az.RecoveryServices.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ Starts a planned failover operation.
291291
### [Start-AzRecoveryServicesAsrResynchronizeReplicationJob](Start-AzRecoveryServicesAsrResynchronizeReplicationJob.md)
292292
Starts replication resynchronization.
293293

294+
### [Start-AzRecoveryServicesAsrSwitchAppliance](Start-AzRecoveryServicesAsrSwitchAppliance.md)
295+
Starts the switch appliance action for a Site Recovery object.
296+
294297
### [Start-AzRecoveryServicesAsrSwitchProcessServerJob](Start-AzRecoveryServicesAsrSwitchProcessServerJob.md)
295298
Switch replication from one Process server to another for load balancing.
296299

src/RecoveryServices/RecoveryServices/help/Start-AzRecoveryServicesAsrSwitchAppliance.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Start-AzRecoveryServicesAsrSwitchAppliance
99

1010
## SYNOPSIS
11-
{{ Fill in the Synopsis }}
11+
Starts the switch appliance action for a Site Recovery object.
1212

1313
## SYNTAX
1414

@@ -20,21 +20,22 @@ Start-AzRecoveryServicesAsrSwitchAppliance -Fabric <ASRFabric>
2020
```
2121

2222
## DESCRIPTION
23-
{{ Fill in the Description }}
23+
The **Start-AzRecoveryServicesAsrSwitchAppliance** cmdlet starts the switch appliance process for an Azure Site Recovery object.
2424

2525
## EXAMPLES
2626

2727
### Example 1
2828
```powershell
29-
PS C:\> {{ Add example code here }}
29+
PS C:\> $currentJob = Start-AzRecoveryServicesAsrSwitchAppliance -Fabric $Fabric
30+
-ReplicationProtectedItem $RPI -TargetApplianceName $TargetApplianceName
3031
```
3132

32-
{{ Add example description here }}
33+
Starts the switch appliance for the specified replicated protected item and returns the ASR job used to track the operation.
3334

3435
## PARAMETERS
3536

3637
### -CredentialsToAccessVm
37-
{{ Fill CredentialsToAccessVm Description }}
38+
Specifies the name of credentials to be used to push install the Mobility service on source machine if needed.
3839

3940
```yaml
4041
Type: System.String
@@ -64,12 +65,12 @@ Accept wildcard characters: False
6465
```
6566
6667
### -Fabric
67-
{{ Fill Fabric Description }}
68+
Specifies the ASR Fabric object.
6869
6970
```yaml
7071
Type: Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRFabric
7172
Parameter Sets: (All)
72-
Aliases: ConfigServer
73+
Aliases:
7374

7475
Required: True
7576
Position: Named
@@ -79,7 +80,7 @@ Accept wildcard characters: False
7980
```
8081
8182
### -ReplicationProtectedItem
82-
{{ Fill ReplicationProtectedItem Description }}
83+
Specifies an ASR replication protected item object to be switched to new appliance.
8384
8485
```yaml
8586
Type: Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRReplicationProtectedItem
@@ -89,12 +90,12 @@ Aliases: ReplicatedItem
8990
Required: True
9091
Position: Named
9192
Default value: None
92-
Accept pipeline input: False
93+
Accept pipeline input: True (ByValue)
9394
Accept wildcard characters: False
9495
```
9596
9697
### -TargetApplianceName
97-
{{ Fill TargetApplianceName Description }}
98+
Specifies the name of appliance to be used to replicate this machine.
9899
99100
```yaml
100101
Type: System.String

0 commit comments

Comments
 (0)