Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Proximity placement group and Availability zone for Vmware to Azure and HyperV to Azure scenarios #14007

Merged
merged 8 commits into from
Jan 26, 2021
Merged
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 @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.3.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.1.3-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.3.0" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.1.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.1.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.1.3-preview" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,73 @@ public void TestUpdateRPIWithDES()
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void TestCreateRPIWithPPG()
{
this.VaultSettingsFilePath = System.IO.Path.Combine(
System.AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "B2A", "B2AInput", "B2A.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"Test-CreateRPIWithProximityPlacementGroup -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void TestUpdateRPIWithPPG()
{
this.VaultSettingsFilePath = System.IO.Path.Combine(
System.AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "B2A", "B2AInput", "B2A.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"Test-UpdateRPIWithProximityPlacementGroup -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void TestCreateRPIWithAvZone()
{
this.VaultSettingsFilePath = System.IO.Path.Combine(
System.AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "B2A", "B2AInput", "B2A.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"Test-CreateRPIWithAvailabilityZone -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void TestUpdateRPIWithAvZone()
{
this.VaultSettingsFilePath = System.IO.Path.Combine(
System.AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "B2A", "B2AInput", "B2A.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"Test-UpdateRPIWithAvailabilityZone -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -797,4 +797,97 @@ function Test-UpdateRPIWithDiskEncryptionSetMap
Set-AsrReplicationProtectedItem -InputObject $rpi -DiskIdToDiskEncryptionSetMap $diskEncryptionSetMap
$rpi = Get-AsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
Assert-NotNull($rpi.ProviderSpecificDetails.AzureVMDiskDetails[0].DiskEncryptionSetId)
}

<#
.SYNOPSIS
Site Recovery Create RPI with ProximityPlacementGroup
#>
function Test-CreateRPIWithProximityPlacementGroup
{
param([string] $vaultSettingsFilePath)

# Import Azure RecoveryServices Vault Settings File
Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath
$PrimaryFabricName = "H2ASite"
$fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName
$pc = Get-ASRProtectionContainer -Fabric $fabric
$pcm = Get-ASRProtectionContainerMapping -ProtectionContainer $pc
$policyName ="b2apolicy"
$policy = Get-AzRecoveryServicesAsrPolicy -Name $policyName
$VMFriendlyName ="A020-VJ-Dum1"
$VM= Get-AsrProtectableItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
$ResourceGroupId ="/subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/h2arg"
$LogStorageAccountId = "/subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/h2arg/providers/Microsoft.Storage/storageAccounts/hrasa"
$ppg = "/subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/h2arg/providers/Microsoft.Compute/proximityPlacementGroups/ppgh2a"
$EnableDRjob = New-AsrReplicationProtectedItem -ProtectableItem $VM -Name $VM.Name -ProtectionContainerMapping $pcm -RecoveryAzureStorageAccountId $LogStorageAccountId -OSDiskName $($VMFriendlyName+"disk") -OS Windows -RecoveryResourceGroupId $ResourceGroupId -RecoveryProximityPlacementGroupId $ppg
}

<#
.SYNOPSIS
Site Recovery Update RPI with ProximityPlacementGroup
#>
function Test-UpdateRPIWithProximityPlacementGroup
{
param([string] $vaultSettingsFilePath)

# Import Azure RecoveryServices Vault Settings File
Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath
$PrimaryFabricName = "H2ASite"
$fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName
$pc = Get-ASRProtectionContainer -Fabric $fabric
$policyName ="b2apolicy"
$policy = Get-AzRecoveryServicesAsrPolicy -Name $policyName
$VMFriendlyName ="A020-VJ-Dum1"
$rpi = Get-AsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
$ppgSet="/subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/h2arg/providers/Microsoft.Compute/proximityPlacementGroups/ppgh2aset"
Set-AsrReplicationProtectedItem -InputObject $rpi -RecoveryProximityPlacementGroupId $ppgSet
$rpi = Get-AsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
Assert-NotNull($rpi.ProviderSpecificDetails.RecoveryProximityPlacementGroupId)
}

<#
.SYNOPSIS
Site Recovery Create RPI with AvailabilityZone
#>
function Test-CreateRPIWithAvailabilityZone
{
param([string] $vaultSettingsFilePath)

Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath
$PrimaryFabricName = "H2ASite"
$fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName
$pc = Get-ASRProtectionContainer -Fabric $fabric
$pcm = Get-ASRProtectionContainerMapping -ProtectionContainer $pc
$policyName ="b2apolicy"
$policy = Get-AzRecoveryServicesAsrPolicy -Name $policyName
$VMFriendlyName ="A020-VJ-Dum2"
$VM= Get-AsrProtectableItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
$ResourceGroupId ="/subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/h2arg"
$LogStorageAccountId = "/subscriptions/b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c/resourceGroups/h2arg/providers/Microsoft.Storage/storageAccounts/hrasa"
$avZone = "1"
$EnableDRjob = New-AsrReplicationProtectedItem -ProtectableItem $VM -Name $VM.Name -ProtectionContainerMapping $pcm -RecoveryAzureStorageAccountId $LogStorageAccountId -OSDiskName $($VMFriendlyName+"disk") -OS Windows -RecoveryResourceGroupId $ResourceGroupId -RecoveryAvailabilityZone $avZone
}

<#
.SYNOPSIS
Site Recovery Update RPI with AvailabilityZone
#>
function Test-UpdateRPIWithAvailabilityZone
{
param([string] $vaultSettingsFilePath)

# Import Azure RecoveryServices Vault Settings File
Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath
$PrimaryFabricName = "H2ASite"
$fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName
$pc = Get-ASRProtectionContainer -Fabric $fabric
$policyName ="b2apolicy"
$policy = Get-AzRecoveryServicesAsrPolicy -Name $policyName
$VMFriendlyName ="A020-VJ-Dum2"
$rpi = Get-AsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
$avZoneSet="2"
Set-AsrReplicationProtectedItem -InputObject $rpi -RecoveryAvailabilityZone $avZoneSet
$rpi = Get-AsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $VMFriendlyName
Assert-NotNull($rpi.ProviderSpecificDetails.RecoveryAvailabilityZone)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><RSVaultAsrCreds xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Azure.Portal.RecoveryServices.Models.Common"><VaultDetails><SubscriptionId>b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c</SubscriptionId><ResourceGroup>prakrg</ResourceGroup><ResourceName>H2ATest</ResourceName><ResourceId>3539378903324577401</ResourceId><Location>westus2</Location><ResourceType>Vaults</ResourceType><ProviderNamespace>Microsoft.RecoveryServices</ProviderNamespace></VaultDetails><ManagementCert>MIIKWQIBAzCCChUGCSqGSIb3DQEHAaCCCgYEggoCMIIJ/jCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAiBZgD63PhSpgICB9AEggTYVtkM0Hx64KYr4qir9XiOrAo0ve6zz0EPIBLMjqc6ZplPKFxcHsxuwCaaGfe29LAy4Essv83wY2H23kHhRN7z+Lb4dQdQlTG40Wn9f8R+EmBHPXy6HkWrQMXKlrMRUNp/44xeC5uu8fd7b95s6fL9YtbTqe4UgabJxhQLZ6NiUGO2T4hkCxR/xDcz8pN9wR8rx8vj/+L0UaR1O/MvIXLlQuhBxuvUkh8GYsP6vVahCnjs2x8o7UgQjgqyy9uujNASExE9hbfNec88+K8KGusMGrXM0noOVYn6P1FD5Fx2UGfLQujJ+h7s9KRiAPtb+P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KtxquV1PJ3fEZmJdK304g5nVPwmZrKUy6IxDZ9eiRxWUILGoKaxdnYYWbdHsHV7dgQypvLxwRfUgLvRF2gsqu/N1TWOh8tb1oirv0TsLkurVSYzyH/0pruOOh6a+zGkGpY8hEsI1riR2bvfBdJxRXQG3sSu3tibjOHGkqgjrevDZGuT4s09MR8KmsbTfvVmenjD3MJjymSKhK7z91lG2vk8W+Ue9BN1jB/PKQtNQnwW289upMXzobgQIS5D6x4NH076SOIAVs2/zc7aQCxCYLWYtvisCnuOZgkFGPCHo28Ve2JeDiC4mQdFThEVhdSjWx1r9x8f3CocCKTz0vr1i+3HaoaD8tplfKMCi0oRlgi9du5vIrqG/KzqMPUC2xB+gs7lZ/+tXgNhxE9Oj9TKEoOMNyh5BTCtE9RrhpqqdlA9haEXQcktmehEG0Y0u/8XezolOPwqj/j0RWPEhB9RS3752eqW0I8nGLhuB6V5a3flF3iFBn2RrmYa7bgwUSf+8XdrEu7LpvUOFCU5Wg9We50T/gCQKU5KThnL8RizYA9iri5dxffQpAZsRsLVme1J20FlMoCU9+HIadE6iWCM5uRAk4hb4bseTdKXRWdlgbacA36rCW/w/Tof6sVEeMHopT4OIo3YDirFjgJd5jGJDqAuQ2auiJpYCM2u1SFXHUjSI2TzLHBENua4Ublsp+ix/ClMkYLOy9x73g39NXWsvd29i+SQKgZOFNu+S7XXg86OocmdNPcSnbTKQyBHrHsKmWc5bt+0D9bgx6KjcegCYOMDswHzAHBgUrDgMCGgQUuoGcVwuv1d/3///wKabup6abbDEEFMGYbSvqmgD2/QfNhMLHWgcvLBf5AgIH0A==</ManagementCert><Version>2.0</Version><AadDetails><AadAuthority>https://login.windows.net</AadAuthority><AadTenantId>4154c262-ea7f-426f-86ec-ac8ed8734b41</AadTenantId><ServicePrincipalClientId>4d6bc55d-166a-48c5-a239-8a715cacc483</ServicePrincipalClientId><AadVaultAudience>https://RecoveryServiceVault/westus2/H2ATest/3539378903324577401</AadVaultAudience><ArmManagementEndpoint>https://pod01-id1.wus2.backup.windowsazure.com/restapi/</ArmManagementEndpoint></AadDetails><ChannelIntegrityKey></ChannelIntegrityKey><SiteId>1efac2b5-1ac2-5efd-8afa-4487a6cad9b2</SiteId><SiteName>H2ASite</SiteName><PrivateEndpointStateForSiteRecovery>None</PrivateEndpointStateForSiteRecovery></RSVaultAsrCreds>
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,73 @@ public void V2ACreateRPIWithDESEnabledDiskInput()
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void V2ACreateRPIWithPPG()
{
this.VaultSettingsFilePath = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "V2A", "V2AInput", "V2AInput.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"V2ACreateRPIWithPPG -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void V2AUpdateRPIWithPPG()
{
this.VaultSettingsFilePath = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "V2A", "V2AInput", "V2AInput.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"V2AUpdateRPIWithPPG -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void V2ACreateRPIWithAvZone()
{
this.VaultSettingsFilePath = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "V2A", "V2AInput", "V2AInput.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"V2ACreateRPIWithAvZone -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}

[Fact]
[Trait(
Category.AcceptanceType,
Category.CheckIn)]
public void V2AUpdateRPIWithAvZone()
{
this.VaultSettingsFilePath = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"ScenarioTests", "V2A", "V2AInput", "V2AInput.VaultCredentials");
this.RunPowerShellTest(
_logger,
Constants.NewModel,
"V2AUpdateRPIWithAvZone -vaultSettingsFilePath \"" +
this.VaultSettingsFilePath +
"\"");
}
}
}
Loading