-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Adding platform fault domain and avzone support #28681
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
base: main
Are you sure you want to change the base?
Adding platform fault domain and avzone support #28681
Conversation
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
Thank you for your contribution @abageria! We will review the pull request and get back to you soon. |
@microsoft-github-policy-service agree company="Microsoft" |
/azp run |
Commenter does not have sufficient privileges for PR 28681 in repo Azure/azure-powershell |
Hi @abageria if you are an employer of Microsoft please join the "Azure" organization here: https://aka.ms/AzureGitHub |
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzure, HelpMessage = "Specify the platform fault domain to be used by the failover Vm in target recovery region.")] | ||
[Parameter(ParameterSetName = ASRParameterSets.AzureToAzureWithoutDiskDetails, HelpMessage = "Specify the platform fault domain to be used by the failover Vm in target recovery region.")] | ||
[ValidateNotNullOrEmpty] | ||
public int? PlatformFaultDomain { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its data type is nullable int, but we are also validating that it can't be null. These two are contradicting each other.
#create virtual Machine scale set | ||
$stnd = "Standard" | ||
$vmssConfig = New-AzVmssConfig -Location $recoveryLocation -PlatformFaultDomainCount 1 -SinglePlacementGroup 0 -SecurityType $stnd | ||
$vmssConfig = New-AzVmssConfig -Location $recoveryLocation -PlatformFaultDomainCount 2 -SinglePlacementGroup 0 -SecurityType $stnd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get the value of platformFaultDomainCount from helper class like you are doing for platformFaultDomain.
#Validate vmss Set in replicated vm properties | ||
$pe = Get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name $vmName | ||
Assert-NotNull($pe.providerSpecificDetails.RecoveryVirtualMachineScaleSetId) | ||
Assert-NotNull($pe.providerSpecificDetails.PlatformFaultDomain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also validate Equal
WaitForJobCompletion -JobId $updateDRjob.Name | ||
$pe = Get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name $vmName | ||
Assert-NotNull($pe.providerSpecificDetails.RecoveryVirtualMachineScaleSetId) | ||
Assert-NotNull($pe.providerSpecificDetails.PlatformFaultDomain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
$rgId = "/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/vijami-alertrg" | ||
|
||
$ReprotectJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ReplicationProtectedItem $ReplicationProtectedItem -ProtectionContainerMapping $RecoveryMapping -LogStorageAccountId $CacheStorageAccount -RecoveryResourceGroupID $rgId | ||
$platformFaultDomain = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't have constants here, get all these values from helper class.
$ReprotectJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ReplicationProtectedItem $ReplicationProtectedItem -ProtectionContainerMapping $RecoveryMapping -LogStorageAccountId $CacheStorageAccount -RecoveryResourceGroupID $rgId | ||
$platformFaultDomain = 1 | ||
|
||
$ReprotectJob = Update-AzRecoveryServicesAsrProtectionDirection -AzureToAzure -ReplicationProtectedItem $ReplicationProtectedItem -ProtectionContainerMapping $RecoveryMapping -LogStorageAccountId $CacheStorageAccount -RecoveryResourceGroupID $rgId -PlatformFaultDomain $platformFaultDomain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get protected item and perform validations.
/// Gets or sets the platform fault domain for replication protected item after failover. | ||
/// </summary> | ||
[Parameter] | ||
[ValidateNotNullOrEmpty] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.