Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="25.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.10.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.2.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.0.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.0.2-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,10 @@ public ASRVMNicDetails(
this.PrimaryNicStaticIPAddress = vMNicDetails.PrimaryNicStaticIPAddress;
this.RecoveryNicIpAddressType = vMNicDetails.RecoveryNicIpAddressType;
this.EnableAcceleratedNetworkingOnRecovery = vMNicDetails.EnableAcceleratedNetworkingOnRecovery;
this.RecoveryPublicIPAddressId = vMNicDetails.RecoveryPublicIpAddressId;
this.RecoveryNetworkSecurityGroupId = vMNicDetails.RecoveryNetworkSecurityGroupId;
this.RecoveryLBBackendAddressPoolId =
vMNicDetails.RecoveryLBBackendAddressPoolIds?.ToList() ?? new List<string>();
}

//
Expand Down Expand Up @@ -1009,6 +1013,21 @@ public ASRVMNicDetails(
/// Gets or sets VM subnet name.
/// </summary>
public string VMSubnetName { get; set; }

/// <summary>
/// Gets or sets the id of the public IP address resource associated with the NIC.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recovery load balancer?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not getting what you are trying to say.

/// </summary>
public string RecoveryPublicIPAddressId { get; set; }

/// <summary>
/// Gets or sets the id of the NSG associated with the NIC.
/// </summary>
public string RecoveryNetworkSecurityGroupId { get; set; }

/// <summary>
/// Gets or sets the target backend address pools for the NIC.
/// </summary>
public List<string> RecoveryLBBackendAddressPoolId { get; set; }
}

/// <summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,7 @@ Recommended Action: To cleanup the resources created by Test failover run the Te
<data name="TryDownloadingVaultFile" xml:space="preserve">
<value>Download vault credential file using cmdlet Get-AzRecoveryServicesVaultSettingsFile and Import-AzRecoveryServicesAsrVaultSettingsFile</value>
</data>
<data name="NetworkingResourcesInDRNotSupportedForClassicVms" xml:space="preserve">
<value>Classic virtual machines are not supported for network security group, public IP address and load balancer related enhancements.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.2.2" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.2.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.0.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.0.2-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,26 @@ public class SetAzureRmRecoveryServicesAsrReplicationProtectedItem : SiteRecover
Constants.False)]
public string UseManagedDisk { get; set; }

/// <summary>
/// Gets or sets the id of the public IP address resource associated with the NIC.
/// </summary>
[Parameter]
[ValidateNotNullOrEmpty]
public string RecoveryPublicIPAddressId { get; set; }

/// <summary>
/// Gets or sets the id of the NSG associated with the NIC.
/// </summary>
[Parameter]
[ValidateNotNullOrEmpty]
public string RecoveryNetworkSecurityGroupId { get; set; }

/// <summary>
/// Gets or sets the target backend address pools for the NIC.
/// </summary>
[Parameter]
public string[] RecoveryLBBackendAddressPoolId { get; set; }

/// <summary>
/// ProcessRecord of the command.
/// </summary>
Expand Down Expand Up @@ -248,6 +268,16 @@ public override void ExecuteSiteRecoveryCmdlet()
return;
}

// NSG, LB and PIP only for A2A provider.
if ((!string.IsNullOrEmpty(RecoveryNetworkSecurityGroupId) ||
!string.IsNullOrEmpty(RecoveryPublicIPAddressId) ||
RecoveryLBBackendAddressPoolId != null &&
RecoveryLBBackendAddressPoolId.Length > 0) &&
!(provider is A2AReplicationDetails))
{
this.WriteWarning(Resources.NetworkingResourcesInDRNotSupportedForClassicVms);
return;
}

var vmName = this.Name;
var vmSize = this.Size;
Expand Down Expand Up @@ -545,6 +575,12 @@ private List<VMNicInputDetails> getNicListToUpdate(IList<VMNicDetails> vmNicList
vMNicInputDetails.SelectionType =
string.IsNullOrEmpty(this.NicSelectionType)
? Constants.SelectedByUser : this.NicSelectionType;
vMNicInputDetails.RecoveryLBBackendAddressPoolIds =
this.RecoveryLBBackendAddressPoolId?.ToList();
vMNicInputDetails.RecoveryPublicIpAddressId =
this.RecoveryPublicIPAddressId;
vMNicInputDetails.RecoveryNetworkSecurityGroupId =
this.RecoveryNetworkSecurityGroupId;
vMNicInputDetailsList.Add(vMNicInputDetails);
// NicId matched for update
nicFoundToBeUpdated = true;
Expand All @@ -568,6 +604,12 @@ private List<VMNicInputDetails> getNicListToUpdate(IList<VMNicDetails> vmNicList
vMNicInputDetails.SelectionType = nDetails.SelectionType;
vMNicInputDetailsList.Add(vMNicInputDetails);
vMNicInputDetails.EnableAcceleratedNetworkingOnRecovery = nDetails.EnableAcceleratedNetworkingOnRecovery;
vMNicInputDetails.RecoveryLBBackendAddressPoolIds =
nDetails.RecoveryLBBackendAddressPoolIds;
vMNicInputDetails.RecoveryPublicIpAddressId =
nDetails.RecoveryPublicIpAddressId;
vMNicInputDetails.RecoveryNetworkSecurityGroupId =
nDetails.RecoveryNetworkSecurityGroupId;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Set-AzRecoveryServicesAsrReplicationProtectedItem -InputObject <ASRReplicationPr
[-RecoveryBootDiagStorageAccountId <String>]
[-AzureToAzureUpdateReplicationConfiguration <ASRAzuretoAzureDiskReplicationConfig[]>]
[-DiskEncryptionVaultId <String>] [-DiskEncryptionSecretUrl <String>] [-KeyEncryptionKeyUrl <String>]
[-KeyEncryptionVaultId <String>] [-UseManagedDisk <String>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-KeyEncryptionVaultId <String>] [-UseManagedDisk <String>] [-RecoveryPublicIPAddressId <String>]
[-RecoveryNetworkSecurityGroupId <String>] [-RecoveryLBBackendAddressPoolId <String[]>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -414,7 +415,48 @@ Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -RecoveryPublicIPAddressId
Specifies the ID of the public IP address resource to be associated with the recovery NIC.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -RecoveryNetworkSecurityGroupId
Specifies the ID of the network security group to be associated with the recovery NIC.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -RecoveryLBBackendAddressPoolId
Specifies the target backend address pools to be associated with the recovery NIC.

```yaml
Type: System.String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.

Expand Down
2 changes: 1 addition & 1 deletion tools/Common.Netcore.Dependencies.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup >
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.19"/>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.20"/>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.19"/>
<PackageReference Include="Microsoft.Azure.PowerShell.Clients.Aks" Version="1.2.1-preview"/>
<PackageReference Include="Microsoft.Azure.PowerShell.Authentication.Abstractions" Version="1.2.1-preview"/>
Expand Down
Binary file not shown.