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

109 implement safeguards to prevent upgrades that may cause ha pair incompatibility #113

Conversation

cdot65
Copy link
Owner

@cdot65 cdot65 commented Mar 17, 2024

Here's a refined PR description based on the provided GitHub issue and changes:

Checklist for This Pull Request

🚨Please adhere to the guidelines for contributing to this repository.

  • Ensure you are submitting your pull request to a branch dedicated to a specific topic/feature/bugfix. Avoid using the master branch for pull requests.
  • Target your pull request to the main development branch in this repository.
  • Ensure your commit messages follow the project's preferred format.
  • Check that your code additions do not fail any linting checks or unit tests.

Pull Request Description

This pull request introduces a safeguard feature in the pan-os-upgrade tool to prevent compatibility issues when upgrading PAN-OS firewalls in an HA pair. The feature gracefully exits the upgrade process if the user selects an upgrade version that is two or more minor releases ahead of the current version and the firewalls are in an HA state.

What does this pull request accomplish?

  • Feature addition

Are there any breaking changes included?

  • Yes
  • No

Changes made in this pull request

  • Added a new function check_ha_compatibility to assess the compatibility of the target PAN-OS version with the current version in an HA pair.
  • Updated the software_update_check function to call check_ha_compatibility when dealing with firewalls in an HA pair.
  • If the target version is incompatible, a warning message is logged, and the function returns False, preventing the upgrade from proceeding.
  • Updated docstrings for the check_ha_compatibility function to align with the project's documentation style.

Resolves issue

Resolves #109

Motivation behind this feature

When upgrading PAN-OS firewalls in an HA pair, selecting a version that is two or more minor releases ahead of the current version can lead to compatibility issues. If one firewall is upgraded to a version that is significantly ahead of its peer, it may not be able to rejoin the HA pair after the upgrade, putting itself in a suspended state. When the upgrade process begins on the other firewall, it issues an HA state switch over. If the peer is in a suspended state, neither firewall will be able to forward traffic, as they both operate in a suspended state.

This safeguard feature mitigates this issue by gracefully exiting the upgrade process when the specified conditions are met. It helps prevent users from accidentally causing HA pair incompatibility issues and ensures they are aware of the potential consequences before proceeding with the upgrade.

Is there anything the reviewers should know?

Please review the changes carefully, especially the logic in the check_ha_compatibility function, to ensure it accurately identifies potential compatibility issues based on the version numbers and HA state.

@cdot65 cdot65 added the enhancement New feature or request label Mar 17, 2024
@cdot65 cdot65 self-assigned this Mar 17, 2024
@cdot65 cdot65 merged commit 3db799b into main Mar 17, 2024
1 check passed
@cdot65 cdot65 deleted the 109-implement-safeguards-to-prevent-upgrades-that-may-cause-ha-pair-incompatibility branch March 17, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement safeguards to prevent upgrades that may cause HA pair incompatibility
1 participant