Skip to content

Commit b8fb0f6

Browse files
authored
Merge pull request #12207 from AsrOneSdk/koredd
NIC renaming changes for TFO/FO
2 parents 9a4ef6b + 90849b3 commit b8fb0f6

File tree

9 files changed

+25538
-637
lines changed

9 files changed

+25538
-637
lines changed

src/RecoveryServices/RecoveryServices.SiteRecovery.Test/ScenarioTests/A2A/A2ATestsHelper.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ function getRecoveryCacheStorageAccountName{
132132
function getRecoveryResourceGroupName{
133133
return "recRG"+ $seed;
134134
}
135+
136+
function getRecoveryNicName{
137+
return "A2ArecNICName"+ $seed;
138+
}
139+
135140
function Get-RandomSuffix(
136141
[int] $size = 8)
137142
{

src/RecoveryServices/RecoveryServices.SiteRecovery.Test/ScenarioTests/A2A/AsrA2ATests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ public void A2AReplicateProximityPlacementGroupVm()
9797
this.RunPowerShellTest(_logger, Constants.NewModel, "Test-ReplicateProximityPlacementGroupVm");
9898
}
9999

100+
[Fact]
101+
[Trait(Category.AcceptanceType, Category.CheckIn)]
102+
public void A2AVMNicConfig()
103+
{
104+
this.RunPowerShellTest(_logger, Constants.NewModel, "Test-VMNicConfig");
105+
}
106+
100107
[Fact]
101108
[Trait(Category.AcceptanceType, Category.CheckIn)]
102109
public void A2AZoneToZoneRecoveryPlanReplication()

src/RecoveryServices/RecoveryServices.SiteRecovery.Test/ScenarioTests/A2A/AsrA2ATests.ps1

Lines changed: 762 additions & 632 deletions
Large diffs are not rendered by default.

src/RecoveryServices/RecoveryServices.SiteRecovery.Test/SessionRecords/RecoveryServices.SiteRecovery.Test.AsrA2ATests/A2AVMNicConfig.json

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

src/RecoveryServices/RecoveryServices.SiteRecovery/Models/PSObjects.cs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,9 @@ public ASRVMNicDetails(
936936
this.VMNetworkName = vMNicDetails.VMNetworkName;
937937
this.VMSubnetName = vMNicDetails.VMSubnetName;
938938
this.RecoveryVMNetworkId = vMNicDetails.RecoveryVMNetworkId;
939+
this.RecoveryNicName = vMNicDetails.RecoveryNicName;
940+
this.RecoveryNicResourceGroupName = vMNicDetails.RecoveryNicResourceGroupName;
941+
this.ReuseExistingNic = vMNicDetails.ReuseExistingNic;
939942
this.RecoveryVMSubnetName = vMNicDetails.RecoveryVMSubnetName;
940943
this.ReplicaNicStaticIPAddress = vMNicDetails.ReplicaNicStaticIPAddress;
941944
this.IpAddressType = vMNicDetails.IpAddressType;
@@ -948,6 +951,9 @@ public ASRVMNicDetails(
948951
this.RecoveryLBBackendAddressPoolId =
949952
vMNicDetails.RecoveryLBBackendAddressPoolIds?.ToList() ?? new List<string>();
950953
this.TfoVMNetworkId = vMNicDetails.TfoVMNetworkId;
954+
this.TfoNicName = vMNicDetails.TfoRecoveryNicName;
955+
this.TfoNicResourceGroupName = vMNicDetails.TfoRecoveryNicResourceGroupName;
956+
this.TfoReuseExistingNic = vMNicDetails.TfoReuseExistingNic;
951957
this.TfoVMSubnetName = vMNicDetails.TfoVMSubnetName;
952958
this.TfoNetworkSecurityGroupId = vMNicDetails.TfoNetworkSecurityGroupId;
953959
this.TfoIPConfigs = vMNicDetails.TfoIPConfigs?.ToList() ?? new List<IPConfig>();
@@ -989,6 +995,21 @@ public ASRVMNicDetails(
989995
/// </summary>
990996
public string NicId { get; set; }
991997

998+
/// <summary>
999+
/// Gets or sets the name of the recovery NIC.
1000+
/// </summary>
1001+
public string RecoveryNicName { get; set; }
1002+
1003+
/// <summary>
1004+
/// Gets or sets the name of the recovery NIC resource group name.
1005+
/// </summary>
1006+
public string RecoveryNicResourceGroupName { get; set; }
1007+
1008+
/// <summary>
1009+
/// Gets or sets whether an existing Nic can be used during failover.
1010+
/// </summary>
1011+
public bool? ReuseExistingNic { get; set; }
1012+
9921013
/// <summary>
9931014
/// Gets or sets recovery VM network Id.
9941015
/// </summary>
@@ -1039,6 +1060,21 @@ public ASRVMNicDetails(
10391060
/// </summary>
10401061
public string TfoVMNetworkId { get; set; }
10411062

1063+
/// <summary>
1064+
/// Gets or sets name of the TFO Nic.
1065+
/// </summary>
1066+
public string TfoNicName { get; set; }
1067+
1068+
/// <summary>
1069+
/// Gets or sets name of the TFO Nic resource group name.
1070+
/// </summary>
1071+
public string TfoNicResourceGroupName { get; set; }
1072+
1073+
/// <summary>
1074+
/// Gets or sets whether an existing Nic can be used during TFO .
1075+
/// </summary>
1076+
public bool? TfoReuseExistingNic { get; set; }
1077+
10421078
/// <summary>
10431079
/// Gets or sets test failover subnet name.
10441080
/// </summary>
@@ -2340,6 +2376,24 @@ public class ASRVMNicConfig
23402376
[DataMember]
23412377
public string RecoveryVMNetworkId { get; set; }
23422378

2379+
/// <summary>
2380+
/// Gets or sets the name of the recovery NIC.
2381+
/// </summary>
2382+
[DataMember]
2383+
public string RecoveryNicName { get; set; }
2384+
2385+
/// <summary>
2386+
/// Gets or sets the name of the recovery NIC resource group name.
2387+
/// </summary>
2388+
[DataMember]
2389+
public string RecoveryNicResourceGroupName { get; set; }
2390+
2391+
/// <summary>
2392+
/// Gets or sets whether an existing Nic can be used during failover.
2393+
/// </summary>
2394+
[DataMember]
2395+
public bool ReuseExistingNic { get; set; }
2396+
23432397
/// <summary>
23442398
/// Gets or sets the name of the recovery VM subnet.
23452399
/// </summary>
@@ -2370,6 +2424,24 @@ public class ASRVMNicConfig
23702424
[DataMember]
23712425
public string TfoVMNetworkId { get; set; }
23722426

2427+
/// <summary>
2428+
/// Gets or sets name of the TFO Nic.
2429+
/// </summary>
2430+
[DataMember]
2431+
public string TfoNicName { get; set; }
2432+
2433+
/// <summary>
2434+
/// Gets or sets name of the TFO Nic resource group name.
2435+
/// </summary>
2436+
[DataMember]
2437+
public string TfoNicResourceGroupName { get; set; }
2438+
2439+
/// <summary>
2440+
/// Gets or sets whether an existing Nic can be used during TFO .
2441+
/// </summary>
2442+
[DataMember]
2443+
public bool TfoReuseExistingNic { get; set; }
2444+
23732445
/// <summary>
23742446
/// Gets or sets the name of the test failover VM subnet.
23752447
/// </summary>

src/RecoveryServices/RecoveryServices.SiteRecovery/NetworkInterfaceCard/NewAzureRmAsrVmNicConfig.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,33 @@ public class NewAzureRmAsrVmNicConfig : SiteRecoveryCmdletBase
5656
[ValidateNotNullOrEmpty]
5757
public string RecoveryVMNetworkId { get; set; }
5858

59+
/// <summary>
60+
/// Gets or sets name of the recovery NIC.
61+
/// </summary>
62+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure,
63+
Mandatory = false,
64+
HelpMessage = "Specifies the name of the recovery NIC.")]
65+
[ValidateNotNullOrEmpty]
66+
public string RecoveryNicName { get; set; }
67+
68+
/// <summary>
69+
/// Gets or sets name of the recovery NIC resource group name.
70+
/// </summary>
71+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure,
72+
Mandatory = false,
73+
HelpMessage = "Specifies the name of the recovery NIC resource group.")]
74+
[ValidateNotNullOrEmpty]
75+
public string RecoveryNicResourceGroupName { get; set; }
76+
77+
/// <summary>
78+
/// Gets or sets whether an existing NIC can be used during failover.
79+
/// </summary>
80+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure,
81+
Mandatory = false,
82+
HelpMessage = "Specifies whether an existing NIC can be used during failover.")]
83+
[ValidateNotNullOrEmpty]
84+
public SwitchParameter ReuseExistingNic { get; set; }
85+
5986
/// <summary>
6087
/// Gets or sets the name of the recovery VM subnet.
6188
/// </summary>
@@ -119,6 +146,33 @@ public class NewAzureRmAsrVmNicConfig : SiteRecoveryCmdletBase
119146
[ValidateNotNullOrEmpty]
120147
public string TfoVMNetworkId { get; set; }
121148

149+
/// <summary>
150+
/// Gets or sets name of the test failover NIC.
151+
/// </summary>
152+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure,
153+
Mandatory = false,
154+
HelpMessage = "Specifies the name of the test failover NIC.")]
155+
[ValidateNotNullOrEmpty]
156+
public string TfoNicName { get; set; }
157+
158+
/// <summary>
159+
/// Gets or sets name of the test failover NIC resource group.
160+
/// </summary>
161+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure,
162+
Mandatory = false,
163+
HelpMessage = "Specifies the name of the test failover NIC resource group.")]
164+
[ValidateNotNullOrEmpty]
165+
public string TfoNicResourceGroupName { get; set; }
166+
167+
/// <summary>
168+
/// Gets or sets whether an existing NIC can be reused during test failover.
169+
/// </summary>
170+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure,
171+
Mandatory = false,
172+
HelpMessage = "Specifies whether an existing NIC can be used during test failover.")]
173+
[ValidateNotNullOrEmpty]
174+
public SwitchParameter TfoReuseExistingNic { get; set; }
175+
122176
/// <summary>
123177
/// Gets or sets the name of the test failover subnet.
124178
/// </summary>
@@ -338,6 +392,9 @@ public override void ExecuteSiteRecoveryCmdlet()
338392
{
339393
NicId = this.NicId,
340394
RecoveryVMNetworkId = this.RecoveryVMNetworkId,
395+
RecoveryNicName = this.RecoveryNicName,
396+
RecoveryNicResourceGroupName = this.RecoveryNicResourceGroupName,
397+
ReuseExistingNic = this.ReuseExistingNic,
341398
RecoveryVMSubnetName = this.RecoveryVMSubnetName,
342399
RecoveryNetworkSecurityGroupId = this.RecoveryNetworkSecurityGroupId,
343400
EnableAcceleratedNetworkingOnRecovery =
@@ -356,6 +413,9 @@ public override void ExecuteSiteRecoveryCmdlet()
356413
},
357414

358415
TfoVMNetworkId = this.TfoVMNetworkId,
416+
TfoNicName = this.TfoNicName,
417+
TfoNicResourceGroupName = this.TfoNicResourceGroupName,
418+
TfoReuseExistingNic = this.TfoReuseExistingNic,
359419
TfoVMSubnetName = this.TfoVMSubnetName,
360420
TfoNetworkSecurityGroupId = this.TfoNetworkSecurityGroupId,
361421
EnableAcceleratedNetworkingOnTfo = this.EnableAcceleratedNetworkingOnTfo,

src/RecoveryServices/RecoveryServices.SiteRecovery/ReplicationProtectedItem/SetAzureRmRecoveryServicesAsrReplicationProtectedItem.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@ private List<VMNicInputDetails> getNicListToUpdate(IList<VMNicDetails> vmNicList
723723
var vMNicInputDetails = new VMNicInputDetails();
724724

725725
vMNicInputDetails.NicId = nic.NicId;
726+
vMNicInputDetails.RecoveryNicName = nic.RecoveryNicName;
727+
vMNicInputDetails.RecoveryNicResourceGroupName = nic.RecoveryNicResourceGroupName;
728+
vMNicInputDetails.ReuseExistingNic = nic.ReuseExistingNic;
726729
vMNicInputDetails.RecoveryVMSubnetName = nic.RecoveryVMSubnetName;
727730
vMNicInputDetails.EnableAcceleratedNetworkingOnRecovery =
728731
nic.EnableAcceleratedNetworkingOnRecovery;
@@ -735,6 +738,9 @@ private List<VMNicInputDetails> getNicListToUpdate(IList<VMNicDetails> vmNicList
735738
vMNicInputDetails.RecoveryLBBackendAddressPoolIds =
736739
nic.RecoveryIPConfigs?.FirstOrDefault()?.LBBackendAddressPoolIds;
737740

741+
vMNicInputDetails.TfoNicName = nic.TfoNicName;
742+
vMNicInputDetails.TfoNicResourceGroupName = nic.TfoNicResourceGroupName;
743+
vMNicInputDetails.TfoReuseExistingNic = nic.TfoReuseExistingNic;
738744
vMNicInputDetails.TfoVMSubnetName = nic.TfoVMSubnetName;
739745
vMNicInputDetails.EnableAcceleratedNetworkingOnTfo =
740746
nic.EnableAcceleratedNetworkingOnTfo;

src/RecoveryServices/RecoveryServices/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
## Version 2.10.0
2323
* Azure Backup added support for fetching MAB items.
24+
* Azure Site Recovery support to update failover and test failover NIC names, existing NIC reuse.
2425
* Azure Site Recovery supports disk type "StandardSSD_LRS"
2526

2627
## Version 2.9.1

0 commit comments

Comments
 (0)