Skip to content

Commit e312d8c

Browse files
authored
ASR:BugFix: Updating the disk type input while creating disk configuration (#12083)
* updating the disk type * updated help file * updated as per comments
1 parent 9da06f0 commit e312d8c

File tree

6 files changed

+42
-4
lines changed

6 files changed

+42
-4
lines changed

src/RecoveryServices/RecoveryServices.SiteRecovery/DiskReplicationConfiguration/AzureRmAsrAzureToAzureDiskReplicationConfig.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System.Management.Automation;
16+
using Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.Properties;
1617

1718
namespace Microsoft.Azure.Commands.RecoveryServices.SiteRecovery
1819
{
@@ -84,7 +85,8 @@ public class AzureRmAsrAzureToAzureDiskReplicationConfig : SiteRecoveryCmdletBas
8485
[ValidateSet(
8586
Constants.Premium_LRS,
8687
Constants.Standard_LRS,
87-
Constants.Standard_SSD)]
88+
Constants.Standard_SSD,
89+
Constants.StandardSSD_LRS)]
8890
public string RecoveryReplicaDiskAccountType { get; set; }
8991

9092
/// <summary>
@@ -95,7 +97,8 @@ public class AzureRmAsrAzureToAzureDiskReplicationConfig : SiteRecoveryCmdletBas
9597
[ValidateSet(
9698
Constants.Premium_LRS,
9799
Constants.Standard_LRS,
98-
Constants.Standard_SSD)]
100+
Constants.Standard_SSD,
101+
Constants.StandardSSD_LRS)]
99102
public string RecoveryTargetDiskAccountType { get; set; }
100103

101104
/// <summary>
@@ -174,6 +177,23 @@ public override void ExecuteSiteRecoveryCmdlet()
174177
};
175178
break;
176179
case ASRParameterSets.AzureToAzureManagedDisk:
180+
181+
if (this.RecoveryReplicaDiskAccountType == Constants.Standard_SSD ||
182+
this.RecoveryTargetDiskAccountType == Constants.Standard_SSD)
183+
{
184+
this.WriteWarning(Resources.RecoveryDiskTypeUnSupported);
185+
186+
if (this.RecoveryReplicaDiskAccountType == Constants.Standard_SSD)
187+
{
188+
this.RecoveryReplicaDiskAccountType = Constants.StandardSSD_LRS;
189+
}
190+
191+
if (this.RecoveryTargetDiskAccountType == Constants.StandardSSD_LRS)
192+
{
193+
this.RecoveryTargetDiskAccountType = Constants.StandardSSD_LRS;
194+
}
195+
}
196+
177197
diskRelicationConfig = new ASRAzuretoAzureDiskReplicationConfig()
178198
{
179199
DiskId = this.DiskId,

src/RecoveryServices/RecoveryServices.SiteRecovery/Models/PSConstants.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ public static class Constants
467467
/// </summary>
468468
public const string Standard_LRS = "Standard_LRS";
469469

470+
/// <summary>
471+
/// Represents StandardSSD_LRS storage account.
472+
/// </summary>
473+
public const string StandardSSD_LRS = "StandardSSD_LRS";
474+
470475
/// <summary>
471476
/// Represents Standard_SSD storage account.
472477
/// </summary>

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
@@ -507,4 +507,7 @@ Recommended Action: To cleanup the resources created by Test failover run the Te
507507
<data name="UnsupportedReplicationProvidedForNetworkingResources" xml:space="preserve">
508508
<value>Unsupported replication provider for network security group, public IP address, and/or backend address pool related updates.</value>
509509
</data>
510+
<data name="RecoveryDiskTypeUnSupported" xml:space="preserve">
511+
<value>Recovery manged disk type "Standard_SSD" is not supported. Converting it to "StandardSSD_LRS".</value>
512+
</data>
510513
</root>

src/RecoveryServices/RecoveryServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Upcoming Release
2121
* Azure Backup added support for fetching MAB items.
22+
* Azure Site Recovery supports disk type :StandardSSD_LRS
2223

2324
## Version 2.9.1
2425
* Azure Site Recovery support for creating recovery plan for zone to zone replication from xml input.

src/RecoveryServices/RecoveryServices/help/New-AzRecoveryServicesAsrAzureToAzureDiskReplicationConfig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Specifies the account type of replicated managed disk.
240240
Type: System.String
241241
Parameter Sets: AzureToAzureManagedDisk
242242
Aliases:
243-
Accepted values: Premium_LRS, Standard_LRS, Standard_SSD
243+
Accepted values: Premium_LRS, Standard_LRS, StandardSSD_LRS
244244

245245
Required: True
246246
Position: Named
@@ -271,7 +271,7 @@ Specifies the recovery target disk for replicated managed disk.
271271
Type: System.String
272272
Parameter Sets: AzureToAzureManagedDisk
273273
Aliases:
274-
Accepted values: Premium_LRS, Standard_LRS, Standard_SSD
274+
Accepted values: Premium_LRS, Standard_LRS, StandardSSD_LRS
275275

276276
Required: True
277277
Position: Named

0 commit comments

Comments
 (0)