sonic-kvm-testbed_skill

This skill helps you deploy, configure, and tear down a SONiC KVM testbed with cEOS peers for pytest-based network tests.
  • Python

2.5k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

3 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill sonic-kvm-testbed

  • _meta.json464 B
  • SKILL.md5.9 KB

Overview

This skill deploys and manages a local SONiC sonic-mgmt KVM virtual testbed with converged cEOS neighbors and a sonic-vs DUT. It automates provisioning of T0, T1, and T1-LAG topologies on a single host for pytest-based network validation. Use it to create, verify, run tests against, troubleshoot, and tear down a repeatable virtual SONiC lab.

How this skill works

The skill orchestrates a KVM VM for the sonic-vs DUT and Docker containers for cEOS neighbors, PTF traffic generator, and the sonic-mgmt framework. It configures a management bridge (br1), imports images, launches containers/VMs with testbed-cli.sh, deploys minigraph, and verifies BGP and container status. It includes fix scripts to reapply critical inventory and credential changes that revert during operations.

When to use it

  • Set up a local KVM-based SONiC testbed for functional or integration pytest runs
  • Deploy T0, T1, or T1-LAG topologies with converged cEOS neighbors on one host
  • Troubleshoot testbed-cli.sh add-topo or deploy-mg failures and configuration reverts
  • Tear down and redeploy testbeds repeatedly during development or CI debugging
  • Run sonic-mgmt test cases against a virtual SONiC switch (sonic-vs) without physical hardware

Best practices

  • Run the provided fix-configs script before every testbed operation to restore critical settings
  • Use docker import for cEOS images (do not use docker load) and store images locally
  • Set max_fp_num to 127 in vm_host vars to avoid port/FP limits on larger topologies
  • Remove vars/topo_<TOPO>.yml.bak before add-topo to prevent KeyError in the converger
  • Enable use_converged_peers in vtestbed.yaml only with the required sonic-mgmt master PR
  • Persist the br1 management bridge across reboots via netplan or system network config

Example use cases

  • Deploy vms-kvm-t0 topology to validate BGP and ACL behavior with a single cEOS converged peer
  • Launch vms-kvm-t1-lag for LAG and partial spine convergence testing with 24 raw neighbors
  • Reproduce and debug deploy-mg failures locally by inspecting DUT boot user and sudo setup
  • Run pytest suites from sonic-mgmt container against sonic-vs DUT for feature validation
  • Tear down and rebuild a testbed to test automation scripts or CI gating changes

FAQ

Ubuntu 20.04/22.04/24.04 with KVM enabled, Docker, membership in docker/kvm/libvirt groups, 20–30+ GB RAM depending on topology, and sshpass installed.

Why do I need to run a fix-configs script every time?

Critical configuration files revert during git or testbed operations; the fix script reapplies inventory, credential, and docker registry fixes required for reliable deploys.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational