Skip to content

Cmdlets for ClusterTestFailover, ClusterTestFailoverCleanup, ClusterUnplannedFailover, ClusterApplyRecoveryPoint, ClusterCommitFailover #39

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

Merged

Conversation

riyanshpal
Copy link

Description

Checklist

  • SHOULD select appropriate branch. Cmdlets from Autorest.PowerShell should go to generation branch.
  • SHOULD make the title of PR clear and informative, and in the present imperative tense.
  • SHOULD update ChangeLog.md file(s) appropriately
    • For any service, the ChangeLog.md file can be found at 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. Add changelog in description section if PR goes into generation branch.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD have approved design review for the changes in this repository (Microsoft internal only) with following situations
    • Create new module from scratch
    • Create new resource types which are not easy to conform to Azure PowerShell Design Guidelines
    • Create new resource type which name doesn't use module name as prefix
    • Have design question before implementation
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT introduce breaking changes in Az minor release except preview version.
  • SHOULD NOT adjust version of module manually in pull request

@riyanshpal riyanshpal force-pushed the dev/riyanshpal/SharedDisk branch from 77ba91e to bb860c8 Compare March 17, 2025 10:15
[Parameter(
ParameterSetName = ASRParameterSets.ByObject,
Mandatory = false)]
public List<string> NodeRecoveryPoints { get; set; }
Copy link
Author

Choose a reason for hiding this comment

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

Add validation to check nodeRecoveryPoints.

Copy link
Author

Choose a reason for hiding this comment

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

Added the null check, will add ArmId validations in next release.

@@ -171,5 +171,153 @@ public PSSiteRecoveryLongRunningOperation RemoveAzureSiteRecoveryReplicationProt
var result = SiteRecoveryAutoMapperProfile.Mapper.Map<PSSiteRecoveryLongRunningOperation>(op);
return result;
}

/// <summary>
/// Starts Unplanned Failover

Choose a reason for hiding this comment

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

Cluster Unplanned.

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

}

/// <summary>
/// Starts Test Failover

Choose a reason for hiding this comment

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

Cluster Test Failover. Similarly for Input as well

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

}

/// <summary>
/// Starts Test Failover Cleanup

Choose a reason for hiding this comment

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

Change across all calls

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

ProviderSpecificDetails = new ApplyClusterRecoveryPointProviderSpecificInput()
};

if (LatestProcessedRecoveryPoints && ClusterRecoveryPoint == null)

Choose a reason for hiding this comment

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

Can you add this. for all parameter inputs across this file

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

/// <returns> List of node recovery points.</returns>
private List<string> UpdateNodeRecoveryPoints()
{
List<string> clusterProtectedItemIds = ReplicationProtectionCluster.ClusterProtectedItemIds.ToList();

Choose a reason for hiding this comment

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

Add a null check for ReplicationProtectionCluster.ClusterProtectedItemIds

Copy link
Author

Choose a reason for hiding this comment

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

Does it is even possible that cluster has no nodes?

Choose a reason for hiding this comment

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

Yes, we create cluster and then user need to use this cluster for enable protection

node =>
{
List<RecoveryPoint> recoveryPoints = this.RecoveryServicesClient.GetAzureSiteRecoveryRecoveryPoint(
fabricName,

Choose a reason for hiding this comment

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

Correct indentation

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

Comment on lines 26 to 27
/// <summary>
/// Starts a test failover operation.

Choose a reason for hiding this comment

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

Cluster test failover

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.


List<string> nodeRecoveryPointsList = nodeRecoveryPoints.ToList();
return nodeRecoveryPointsList;
}

Choose a reason for hiding this comment

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

Let's move these to Utilities class as it's used in 3 different cmdlets

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

{

/// <summary>
/// Starts a unplanned failover operation.

Choose a reason for hiding this comment

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

Cluster unplanned

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

}

/// <summary>
/// Starts replication protected clustrer unplanned failover.

Choose a reason for hiding this comment

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

typo

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.



List<string> nodeRecoveryPointsList = nodeRecoveryPoints.ToList();
return nodeRecoveryPointsList;

Choose a reason for hiding this comment

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

Same as other comment

Copy link
Author

Choose a reason for hiding this comment

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

Ack, updating in next revision.

@riyanshpal riyanshpal force-pushed the dev/riyanshpal/SharedDisk branch from b2c0fb0 to 898fc48 Compare March 19, 2025 11:56
{
return null;
}
}

Choose a reason for hiding this comment

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

Remove as per latest merge

# Start-AzRecoveryServicesAsrApplyClusterRecoveryPoint

## SYNOPSIS
Changes a recovery point for a failed over repliction protection cluster before committing the failover operation

Choose a reason for hiding this comment

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

replication

@vidyadharijami vidyadharijami merged commit ebc6ed3 into dev/vijami/SharedDiskFinalChanges Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants