Skip to content

Conversation

abageria
Copy link

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

Thank you for your contribution @abageria! We will review the pull request and get back to you soon.

@abageria
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@abageria
Copy link
Author

/azp run

Copy link
Contributor

Commenter does not have sufficient privileges for PR 28681 in repo Azure/azure-powershell

@isra-fel
Copy link
Member

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; }
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants