cdot65 / pan-os-upgrade

An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
https://cdot65.github.io/pan-os-upgrade/
Apache License 2.0
43 stars 9 forks source link

Implement inventory capture for modular devices (PA-7500, PA-7000, PA-5450) #133

Closed cdot65 closed 2 months ago

cdot65 commented 8 months ago

Is your feature request related to a problem? Please describe. When upgrading PAN-OS on modular devices like the PA-7500, PA-7000, and PA-5450 firewalls using the pan-os-upgrade utility, it is important to capture and record the inventory information of these devices before and after the upgrade process. The inventory information includes details about the hardware components, such as line cards, management cards, fan trays, and power supplies. Capturing this inventory helps in tracking any changes or updates to the hardware configuration during the upgrade and ensures that the device is functioning as expected after the upgrade. Currently, the utility does not have a built-in mechanism to capture and store the inventory information for these modular devices.

Describe the solution you'd like Enhance the pan-os-upgrade utility to include the ability to capture and record the inventory information for modular devices (PA-7500, PA-7000, PA-5450) before and after the upgrade process. The utility should:

  1. Identify the device model and determine if it is a modular device (PA-7500, PA-7000, or PA-5450).
  2. Use the PAN-OS SDK to execute the equivalent of the show system inventory command on the firewall to retrieve the inventory information.
  3. Parse the inventory information returned by the SDK and extract relevant details, such as:
    • Line card types and slot numbers
    • Management card types and slot numbers
    • Fan tray types and status
    • Power supply types and status
    • Any other pertinent hardware component details
  4. Store the captured inventory information in a structured format (e.g., JSON or XML) along with metadata such as the device model, serial number, and timestamp.
  5. Proceed with the normal upgrade process.
  6. After the upgrade is completed and the firewall is back online, re-capture the inventory information using the same SDK command.
  7. Compare the pre-upgrade and post-upgrade inventory information to identify any changes or discrepancies in the hardware configuration.
  8. Generate a report or display the comparison results to the user, highlighting any differences or potential issues.
  9. Provide an option to export or store the inventory information for future reference or auditing purposes.

Describe alternatives you've considered An alternative approach could be to manually document the inventory information before and after the upgrade process. However, this would be time-consuming, error-prone, and may not provide a consistent and automated way to track inventory changes across multiple devices.

Additional context Here are a few additional points to consider:

By implementing this feature, the pan-os-upgrade utility will provide a comprehensive solution for capturing and comparing the inventory information of modular devices before and after the upgrade process. This will help in ensuring the integrity and consistency of the hardware configuration, identifying any potential issues, and maintaining accurate records of the device inventory throughout the upgrade lifecycle.

cdot65 commented 2 months ago

will revisit when time permits, closing for now