Skip to content

434-dynamically-calculate-the-required-free-space-in-switch-bootflash - #441

Open
lovkeshsharma702 wants to merge 15 commits into
v4.2.1-devfrom
lovsharm_bootflash_modification
Open

434-dynamically-calculate-the-required-free-space-in-switch-bootflash#441
lovkeshsharma702 wants to merge 15 commits into
v4.2.1-devfrom
lovsharm_bootflash_modification

Conversation

@lovkeshsharma702

Copy link
Copy Markdown
Collaborator

cover dynamic space check.

Testing logs when fabric on 5.2.8h.
-----------

fab1-apic1# python aci-preupgrade-validation-script.py -d switch_bootflash_usage_check -t "6.1(5e)"     
    ==== 2026-09-09T02-15-28+0000, Script Version v4.2.0  ====

!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!

To use a non-default Login Domain, enter apic#DOMAIN\\USERNAME
Enter username for APIC login          : admin
Enter password for corresponding User  : 

Gathering Node Information...

Current APIC Version...5.2(8h)
Lowest Switch Version...5.2(8h)

Target APIC version is overridden to 6.1(5e)

Collecting VPC Node IDs...

Progress: |████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 checks completed


=== Check Result (failed only) ===

[Check 1/1] Switch Node /bootflash usage...                                                                       FAIL - UPGRADE FAILURE!!
  Pod-ID  Node-ID  Avail (MB)  Required (MB)
  ------  -------  ----------  -------------
  1       105      5437.03     6518.78

  Recommended Action: Insufficient free space to download and extract the target image! Contact Cisco TAC for Support
  Reference Document: https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#switch-node-bootflash-usage



=== Summary Result ===

PASS                        :  0
FAIL - OUTAGE WARNING!!     :  0
FAIL - UPGRADE FAILURE!!    :  1
MANUAL CHECK REQUIRED       :  0
POST UPGRADE CHECK REQUIRED :  0
N/A                         :  0
ERROR !!                    :  0
TOTAL                       :  1

    Pre-Upgrade Check Complete.
    Next Steps: Address all checks flagged as FAIL, ERROR or MANUAL CHECK REQUIRED

    Result output and debug info saved to below bundle for later reference.
    Attach this bundle to Cisco TAC SRs opened to address the flagged checks.

      Result Bundle: /data/techsupport/preupgrade_validator_2026-09-09T02-15-28+0000.tgz

==== Script Version v4.2.0 FIN ====
fab1-apic1# python aci-preupgrade-validation-script.py -d switch_bootflash_usage_check -t "5.3(2b)"          
    ==== 2026-09-09T02-16-32+0000, Script Version v4.2.0  ====

!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!

To use a non-default Login Domain, enter apic#DOMAIN\\USERNAME
Enter username for APIC login          : admin
Enter password for corresponding User  : 

Gathering Node Information...

Current APIC Version...5.2(8h)
Lowest Switch Version...5.2(8h)

Target APIC version is overridden to 5.3(2b)

Collecting VPC Node IDs...

Progress: |████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 checks completed


=== Check Result (failed only) ===


=== Summary Result ===

PASS                        :  1
FAIL - OUTAGE WARNING!!     :  0
FAIL - UPGRADE FAILURE!!    :  0
MANUAL CHECK REQUIRED       :  0
POST UPGRADE CHECK REQUIRED :  0
N/A                         :  0
ERROR !!                    :  0
TOTAL                       :  1

    Pre-Upgrade Check Complete.
    Next Steps: Address all checks flagged as FAIL, ERROR or MANUAL CHECK REQUIRED

    Result output and debug info saved to below bundle for later reference.
    Attach this bundle to Cisco TAC SRs opened to address the flagged checks.

      Result Bundle: /data/techsupport/preupgrade_validator_2026-09-09T02-16-32+0000.tgz

==== Script Version v4.2.0 FIN ====
fab1-apic1# python aci-preupgrade-validation-script.py -d switch_bootflash_usage_check -t "6.0(9e)"          
    ==== 2026-09-09T02-17-06+0000, Script Version v4.2.0  ====

!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!

To use a non-default Login Domain, enter apic#DOMAIN\\USERNAME
Enter username for APIC login          : admin
Enter password for corresponding User  : 

Gathering Node Information...

Current APIC Version...5.2(8h)
Lowest Switch Version...5.2(8h)

Target APIC version is overridden to 6.0(9e)

Collecting VPC Node IDs...

Progress: |████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 checks completed


=== Check Result (failed only) ===

[Check 1/1] Switch Node /bootflash usage...                                                                       FAIL - UPGRADE FAILURE!!
  Pod-ID  Node-ID  Avail (MB)  Required (MB)
  ------  -------  ----------  -------------
  1       105      5437.03     5989.18

  Recommended Action: Insufficient free space to download and extract the target image! Contact Cisco TAC for Support
  Reference Document: https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#switch-node-bootflash-usage



=== Summary Result ===

PASS                        :  0
FAIL - OUTAGE WARNING!!     :  0
FAIL - UPGRADE FAILURE!!    :  1
MANUAL CHECK REQUIRED       :  0
POST UPGRADE CHECK REQUIRED :  0
N/A                         :  0
ERROR !!                    :  0
TOTAL                       :  1

    Pre-Upgrade Check Complete.
    Next Steps: Address all checks flagged as FAIL, ERROR or MANUAL CHECK REQUIRED

    Result output and debug info saved to below bundle for later reference.
    Attach this bundle to Cisco TAC SRs opened to address the flagged checks.

      Result Bundle: /data/techsupport/preupgrade_validator_2026-09-09T02-17-06+0000.tgz

==== Script Version v4.2.0 FIN ====

@monrog2 monrog2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes for several cases where the new dynamic calculation can report PASS despite insufficient bootflash. Each item is documented inline with a concrete remediation and regression-test expectation.

Comment thread aci-preupgrade-validation-script.py Outdated
Comment thread aci-preupgrade-validation-script.py Outdated
Comment thread aci-preupgrade-validation-script.py
Comment thread aci-preupgrade-validation-script.py
Comment thread aci-preupgrade-validation-script.py

@monrog2 monrog2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@lovkeshsharma702 I am requesting these two blocking changes. Both can produce a false PASS during the documented APIC-first upgrade sequence or after an image has been downloaded but still needs extraction.

target_size_32 = fw_sizes.get(switch_target_version)
target_size_64 = fw_sizes.get(switch_target_version_64)

if cversion.older_than(boundary_version) and tversion.older_than(boundary_version):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Blocking] Use sw_cversion for switch-image scenario selection. The upgrade guide requires upgrading the APIC cluster to 6.0(2+) before the switches, so cversion can normally be post-boundary while the switches remain pre-boundary. In that documented sequence, this branch selects 2 * max(target images) instead of the crossing formula and can return a false PASS.

Suggested shape (Python 2.7 compatible):

def switch_bootflash_usage_check(sw_cversion, tversion, **kwargs):
    if not sw_cversion:
        return Result(result=MANUAL, msg="Current switch version not found.", doc_url=doc_url)

    current_is_legacy = sw_cversion.older_than(boundary_version)
    target_is_legacy = tversion.older_than(boundary_version)

    if target_is_legacy:
        required_space = 2 * target_size_32
    elif current_is_legacy:
        switch_current_version = "aci-n9000-dk9.1{}.bin".format(sw_cversion.dot_version)
        current_size = fw_sizes.get(switch_current_version)
        if target_size_32 > current_size:
            required_space = 2 * (target_size_32 + target_size_64 - current_size)
        else:
            required_space = 2 * max(target_size_32, target_size_64)
    else:
        required_space = 2 * max(target_size_32, target_size_64)

Please replace cversion with sw_cversion in the signature, boundary decisions, and current-image filename. Add a regression test for APIC 6.0(3a), switch 5.2(8h), and target 6.1(5e), asserting both FAIL_UF and the reported 8 GB requirement.

dn = re.search(node_regex, eqptcapacityFSPartition['eqptcapacityFSPartition']['attributes']['dn'])
pod = dn.group("pod")
node = dn.group("node")
if node in predownloaded_nodes:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Blocking] Do not exempt downloaded nodes from extraction-space validation. maintUpgJob.dnldStatus == "downloaded" proves image delivery, not successful extraction. Issue #434 reproduces the failure after the 32-bit target is downloaded: extraction still consumes bootflash and can fail. A probe with one KB available and an exact-target downloaded job returns PASS here.

The safest surgical correction is:

-        if node in predownloaded_nodes:
-            continue
         avail = int(eqptcapacityFSPartition["eqptcapacityFSPartition"]["attributes"]["avail"])

Until the API data reliably identifies the exact downloaded file and completed phase, retain the full requirement conservatively rather than granting an unsupported space credit. Please add an exact-target-downloaded test with insufficient remaining space that asserts FAIL_UF, the affected node, and required space. Also update the documentation: downloaded nodes are still evaluated because extraction and later upgrade stages may require additional bootflash.

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