Skip to content

Commit 580aa8c

Browse files
authored
Merge pull request #10875 from AsrOneSdk/pubhatt/tfoSettingsAndRename
Azure Site Recovery - Adding optional parameters to enable resource renaming and Test failover networking configuration.
2 parents 08a6767 + 71bc9ac commit 580aa8c

File tree

114 files changed

+1315
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1315
-149
lines changed

src/RecoveryServices/RecoveryServices.SiteRecovery.Test/RecoveryServices.SiteRecovery.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.2.1-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.0.4-preview" />
15+
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.0.5-preview" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ public class AzureRmAsrAzureToAzureDiskReplicationConfig : SiteRecoveryCmdletBas
133133
[ValidateNotNullOrEmpty]
134134
public string KeyEncryptionVaultId { get; set; }
135135

136+
/// <summary>
137+
/// Gets or sets the failover disk name.
138+
/// </summary>
139+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzureManagedDisk, Mandatory = false)]
140+
[ValidateNotNullOrEmpty]
141+
public string FailoverDiskName { get; set; }
142+
143+
/// <summary>
144+
/// Gets or sets the test failover disk name.
145+
/// </summary>
146+
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzureManagedDisk, Mandatory = false)]
147+
[ValidateNotNullOrEmpty]
148+
public string TfoDiskName { get; set; }
149+
136150
#endregion Parameters
137151

138152
/// <summary>
@@ -172,7 +186,9 @@ public override void ExecuteSiteRecoveryCmdlet()
172186
DiskEncryptionVaultId = this.DiskEncryptionVaultId,
173187
KeyEncryptionKeyUrl = this.KeyEncryptionKeyUrl,
174188
KeyEncryptionVaultId = this.KeyEncryptionVaultId,
175-
RecoveryDiskEncryptionSetId = this.RecoveryDiskEncryptionSetId
189+
RecoveryDiskEncryptionSetId = this.RecoveryDiskEncryptionSetId,
190+
FailoverDiskName = this.FailoverDiskName,
191+
TfoDiskName = this.TfoDiskName
176192
};
177193
break;
178194
}

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

Lines changed: 106 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,11 @@ public ASRVMNicDetails(
947947
this.RecoveryNetworkSecurityGroupId = vMNicDetails.RecoveryNetworkSecurityGroupId;
948948
this.RecoveryLBBackendAddressPoolId =
949949
vMNicDetails.RecoveryLBBackendAddressPoolIds?.ToList() ?? new List<string>();
950+
this.TfoVMNetworkId = vMNicDetails.TfoVMNetworkId;
951+
this.TfoVMSubnetName = vMNicDetails.TfoVMSubnetName;
952+
this.TfoNetworkSecurityGroupId = vMNicDetails.TfoNetworkSecurityGroupId;
953+
this.TfoIPConfigs = vMNicDetails.TfoIPConfigs?.ToList() ?? new List<IPConfig>();
954+
this.EnableAcceleratedNetworkingOnTfo = vMNicDetails.EnableAcceleratedNetworkingOnTfo;
950955
}
951956

952957
//
@@ -1028,6 +1033,31 @@ public ASRVMNicDetails(
10281033
/// Gets or sets the target backend address pools for the NIC.
10291034
/// </summary>
10301035
public List<string> RecoveryLBBackendAddressPoolId { get; set; }
1036+
1037+
/// <summary>
1038+
/// Gets or sets test failover network Id.
1039+
/// </summary>
1040+
public string TfoVMNetworkId { get; set; }
1041+
1042+
/// <summary>
1043+
/// Gets or sets test failover subnet name.
1044+
/// </summary>
1045+
public string TfoVMSubnetName { get; set; }
1046+
1047+
/// <summary>
1048+
/// Gets or sets the id of the NSG associated with the test failover NIC.
1049+
/// </summary>
1050+
public string TfoNetworkSecurityGroupId { get; set; }
1051+
1052+
/// <summary>
1053+
/// Gets or sets the IP configuration details for test failover NIC.
1054+
/// </summary>
1055+
public List<IPConfig> TfoIPConfigs { get; set; }
1056+
1057+
//
1058+
// Summary:
1059+
// Gets or sets whether accelerated networking is enabled on test failover NIC.
1060+
public bool? EnableAcceleratedNetworkingOnTfo { get; set; }
10311061
}
10321062

10331063
/// <summary>
@@ -1422,8 +1452,10 @@ public ASRReplicationProtectedItem(
14221452
var a2aProviderSpecificDetails = (A2AReplicationDetails)rpi.Properties.ProviderSpecificDetails;
14231453

14241454
this.RecoveryAzureVMName = a2aProviderSpecificDetails.RecoveryAzureVMName;
1455+
this.TfoAzureVMName = a2aProviderSpecificDetails.TfoAzureVMName;
14251456
this.RecoveryAzureVMSize = a2aProviderSpecificDetails.RecoveryAzureVMSize;
14261457
this.SelectedRecoveryAzureNetworkId = a2aProviderSpecificDetails.SelectedRecoveryAzureNetworkId;
1458+
this.SelectedTfoAzureNetworkId = a2aProviderSpecificDetails.SelectedTfoAzureNetworkId;
14271459
this.ProtectionState = a2aProviderSpecificDetails.VmProtectionState;
14281460
this.ProtectionStateDescription = a2aProviderSpecificDetails.VmProtectionStateDescription;
14291461
this.ProviderSpecificDetails = new ASRAzureToAzureSpecificRPIDetails(a2aProviderSpecificDetails);
@@ -1610,6 +1642,16 @@ public ASRReplicationProtectedItem(
16101642
/// Gets or sets type of the Protection entity.
16111643
/// </summary>
16121644
public string Type { get; set; }
1645+
1646+
/// <summary>
1647+
/// Gets or sets name of the test failover virtual machine.
1648+
/// </summary>
1649+
public string TfoAzureVMName { get; set; }
1650+
1651+
/// <summary>
1652+
/// Gets or sets Id of the test failover virtual network.
1653+
/// </summary>
1654+
public string SelectedTfoAzureNetworkId { get; set; }
16131655
}
16141656

16151657
/// <summary>
@@ -2281,23 +2323,17 @@ public class AsrVolume
22812323
}
22822324

22832325
/// <summary>
2284-
/// Partial details of a NIC of a VM.
2326+
/// Partial ASR details of a NIC.
22852327
/// </summary>
22862328
[DataContract(Namespace = "http://schemas.microsoft.com/windowsazure")]
2287-
public class VMNic
2329+
public class ASRVMNicConfig
22882330
{
22892331
/// <summary>
22902332
/// Gets or sets ID of the NIC.
22912333
/// </summary>
22922334
[DataMember]
22932335
public string NicId { get; set; }
22942336

2295-
/// <summary>
2296-
/// Gets or sets the static IP address of the replica NIC.
2297-
/// </summary>
2298-
[DataMember]
2299-
public string RecoveryNicStaticIPAddress { get; set; }
2300-
23012337
/// <summary>
23022338
/// Gets or sets Id of the recovery VM Network.
23032339
/// </summary>
@@ -2311,16 +2347,52 @@ public class VMNic
23112347
public string RecoveryVMSubnetName { get; set; }
23122348

23132349
/// <summary>
2314-
/// Gets or sets Name of the VM network.
2350+
/// Gets or sets the id of the NSG associated with the recovery NIC.
23152351
/// </summary>
23162352
[DataMember]
2317-
public string VMNetworkName { get; set; }
2353+
public string RecoveryNetworkSecurityGroupId { get; set; }
23182354

23192355
/// <summary>
2320-
/// Gets or sets Name of the VM subnet.
2356+
/// Gets or sets the IP configuration details for the recovery NIC.
23212357
/// </summary>
23222358
[DataMember]
2323-
public string VMSubnetName { get; set; }
2359+
public List<IPConfig> RecoveryIPConfigs { get; set; }
2360+
2361+
/// <summary>
2362+
/// Gets or sets whether the recovery NIC has accelerated networking enabled.
2363+
/// </summary>
2364+
[DataMember]
2365+
public bool EnableAcceleratedNetworkingOnRecovery { get; set; }
2366+
2367+
/// <summary>
2368+
/// Gets or sets Id of the test failover VM Network.
2369+
/// </summary>
2370+
[DataMember]
2371+
public string TfoVMNetworkId { get; set; }
2372+
2373+
/// <summary>
2374+
/// Gets or sets the name of the test failover VM subnet.
2375+
/// </summary>
2376+
[DataMember]
2377+
public string TfoVMSubnetName { get; set; }
2378+
2379+
/// <summary>
2380+
/// Gets or sets the id of the NSG associated with the test failover NIC.
2381+
/// </summary>
2382+
[DataMember]
2383+
public string TfoNetworkSecurityGroupId { get; set; }
2384+
2385+
/// <summary>
2386+
/// Gets or sets the IP configuration details for the test failover NIC.
2387+
/// </summary>
2388+
[DataMember]
2389+
public List<IPConfig> TfoIPConfigs { get; set; }
2390+
2391+
/// <summary>
2392+
/// Gets or sets whether the test failover NIC has accelerated networking enabled.
2393+
/// </summary>
2394+
[DataMember]
2395+
public bool EnableAcceleratedNetworkingOnTfo { get; set; }
23242396
}
23252397

23262398
/// <summary>
@@ -2450,6 +2522,16 @@ public ASRAzuretoAzureDiskReplicationConfig()
24502522
/// Gets or sets KeyEncryptionVaultId.
24512523
/// </summary>
24522524
public string KeyEncryptionVaultId { get; set; }
2525+
2526+
/// <summary>
2527+
/// Gets or sets the failover disk name.
2528+
/// </summary>
2529+
public string FailoverDiskName { get; set; }
2530+
2531+
/// <summary>
2532+
/// Gets or sets the test failover disk name.
2533+
/// </summary>
2534+
public string TfoDiskName { get; set; }
24532535
}
24542536

24552537
/// <summary>
@@ -2522,6 +2604,8 @@ public ASRAzureToAzureProtectedDiskDetails(A2AProtectedManagedDiskDetails disk)
25222604
this.KekKeyVaultArmId = disk.KekKeyVaultArmId;
25232605
this.KeyIdentifier = disk.KeyIdentifier;
25242606
this.RecoveryDiskEncryptionSetId = disk.RecoveryDiskEncryptionSetId;
2607+
this.FailoverDiskName = disk.FailoverDiskName;
2608+
this.TfoDiskName = disk.TfoDiskName;
25252609
}
25262610

25272611
/// <summary>
@@ -2657,6 +2741,16 @@ public ASRAzureToAzureProtectedDiskDetails(A2AProtectedManagedDiskDetails disk)
26572741
/// Gets or sets the data pending at source virtual machine in MB.
26582742
/// </summary>
26592743
public double? DataPendingAtSourceAgentInMB { get; set; }
2744+
2745+
/// <summary>
2746+
/// Gets or sets the failover disk name.
2747+
/// </summary>
2748+
public string FailoverDiskName { get; set; }
2749+
2750+
/// <summary>
2751+
/// Gets or sets the test failover disk name.
2752+
/// </summary>
2753+
public string TfoDiskName { get; set; }
26602754
}
26612755

26622756
/// <summary>

0 commit comments

Comments
 (0)