Skip to content

Commit 70eb940

Browse files
added nicRenaming parameters to NicConfig Cmdlet
1 parent 62edd98 commit 70eb940

File tree

2 files changed

+98
-2
lines changed

2 files changed

+98
-2
lines changed

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

Lines changed: 38 additions & 2 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>
@@ -2353,7 +2389,7 @@ public class ASRVMNicConfig
23532389
public string RecoveryNicResourceGroupName { get; set; }
23542390

23552391
/// <summary>
2356-
/// Gets or sets whether an existing Nic can be reused during failover.
2392+
/// Gets or sets whether an existing Nic can be used during failover.
23572393
/// </summary>
23582394
[DataMember]
23592395
public bool ReuseExistingNic { get; set; }
@@ -2401,7 +2437,7 @@ public class ASRVMNicConfig
24012437
public string TfoNicResourceGroupName { get; set; }
24022438

24032439
/// <summary>
2404-
/// Gets or sets whether an existing Nic can be reused during TFO .
2440+
/// Gets or sets whether an existing Nic can be used during TFO .
24052441
/// </summary>
24062442
[DataMember]
24072443
public bool TfoReuseExistingNic { get; set; }

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,

0 commit comments

Comments
 (0)