Skip to content

fix: support viptela-* image naming in get_cml_sdwan_image_definition#146

Open
ken130480 wants to merge 1 commit into
cisco-open:mainfrom
ken130480:fix/viptela-image-naming-fallback
Open

fix: support viptela-* image naming in get_cml_sdwan_image_definition#146
ken130480 wants to merge 1 commit into
cisco-open:mainfrom
ken130480:fix/viptela-image-naming-fallback

Conversation

@ken130480
Copy link
Copy Markdown

Problem

When SD-WAN images are registered in CML manually (via the REST API or UI) rather than through sdwan-lab setup, they often use the legacy viptela-* naming convention:

  • viptela-vmanage-20.12.7.1
  • viptela-smart-20.12.7.1
  • viptela-edge-20.12.7.1-vbond
  • viptela-edge-20.12.7.1

The get_cml_sdwan_image_definition() function constructs the expected ID as {node_definition}-{software_version} (e.g. cat-sdwan-manager-20.12.7.1) and does an exact match. If the images exist but use viptela-* IDs, the function raises:

Requested SD-WAN Manager software image version 20.12.7.1 is not found in CML.
Use setup task to upload the correct images or use any available image: []

The [] is misleading — the images are present, just under different IDs. The function finds zero available versions because it only lists IDs for the correct node_definition_id, then tries to parse versions using the cat-sdwan-* prefix format, which does not match viptela-* IDs.

Fix

Add a version-string fallback inside the else branch. If the exact cat-sdwan-* ID is not found, scan existing_image_definitions for any ID containing the requested software_version string. This matches viptela-* IDs (which embed the version number) as well as any other non-standard naming that includes the version.

The fallback only activates when the primary exact match fails, so there is no behaviour change for standard deployments.

Testing

Validated in production: CML 2.10.0 with SD-WAN images registered using viptela-* IDs. sdwan-lab deploy 20.12.7.1 successfully finds all four image definitions (vManage, vSmart, vBond, vEdge) and proceeds to full lab deployment.

Notes

  • Non-breaking: exact match is still tried first; fallback only runs on miss
  • The fix applies equally to all four SD-WAN node types
  • Existing controller/validator version-decrement logic is preserved for the case where neither check succeeds

When SD-WAN images are registered in CML manually (via the REST API or UI)
rather than through sdwan-lab setup, they often use the legacy viptela-*
naming convention (e.g. viptela-vmanage-20.12.7.1) instead of the expected
cat-sdwan-manager-20.12.7.1 format. The exact-match check then fails and
sys.exit() fires with a misleading message even though the images are present
under different IDs.

Add a version-string fallback inside the else branch: if the cat-sdwan-*
exact match misses, scan existing_image_definitions for any ID containing
the requested software_version string. This matches viptela-* IDs as well
as any other non-standard naming that embeds the version number.

The fallback is non-breaking: exact match is tried first; the fallback only
runs on a miss; the existing controller/validator version-decrement logic is
preserved for the case where neither check succeeds.

Validated in production: CML 2.10.0 with viptela-* images, sdwan-lab deploy
20.12.7.1 successfully onboards all four SD-WAN node types.
@tzarski0
Copy link
Copy Markdown
Contributor

tzarski0 commented Jun 2, 2026

hi @ken130480, it's hard to support manual image names as each user can configure a different name. You can convert the images in the UI or reupload using setup task. Since we've reworked the code, could you please update the PR? I can review it then.

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