434-dynamically-calculate-the-required-free-space-in-switch-bootflash - #441
434-dynamically-calculate-the-required-free-space-in-switch-bootflash#441lovkeshsharma702 wants to merge 15 commits into
Conversation
monrog2
left a comment
There was a problem hiding this comment.
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.
monrog2
left a comment
There was a problem hiding this comment.
@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): |
There was a problem hiding this comment.
[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: |
There was a problem hiding this comment.
[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.
cover dynamic space check.