[stordis-toc]
Introduction
This article explains how to import a Community SONiC Virtual Switch (SONiC-VS) image into Cisco Modeling Labs (CML) and run it as a custom node. The procedure covers image download, conversion, node definition creation, image upload, and basic post-deployment validation.
Download the SONiC-VS Image
SONiC Virtual Switch images are published as builds. The most important is that we need to download the SONiC .vhdx image.
Please refer to article at our support side how to download pre-built SONiC image -Â
Convert the Image to QCOW2
Cisco CML requires disk images in qcow2 format.
Use qemu-img to convert the image:
qemu-img convert -p -f vhdx -O qcow2 sonic-vs.vhdx sonic-vs-202311.441687.qcow2
After conversion, verify the image integrity:
qemu-img check sonic-vs-202311.441687.qcow2
Expected output:Â
No errors were found on the image.Create a SONiC Node Definition in CML
CML requires a node definition YAML file that describes the VM characteristics.
STEP 1: Create a new node definition. To do that, enter the "Node Definition" section and click the "ADD" Button.
There you will have a few fields to fill. Please follow these instructions below:
GENERAL
- ID - Type the ID of the Node Definition, for example of Community SONiC - CM-SONiC-VS
- Nature - choose "switch"Â
USER INTERFACE
- Prefix - for example of Community SONiC - CMSVS - You can type whatever you want to.
- Icon - switch
- Label - for example of Community SONiC - CM-SONIC-VS - You can type whatever you want to.
Linux Native Simulation
- Domain Driver - KVM
- Simulation Driver - Server
- Disk driver - VirtIO
- Memory - 4096
- CPUs - 4
- CPU Limit - 100
- Network Driver - E1000
Estimated Resource Usage
- CPUs - 4
- RAM - 4096
Interfaces
- Has a Loopback interface - YES
- Loopback name - lo
- Number of serial ports - 1
- Minimal number of physical interfaces - 9
-
Default number of physical interfaces - 9
- interface 0 - eth0
- interface 1 - Ethernet0
- interface 2 - Ethernet4
- interface 3 - Ethernet8
- interface 4 - Ethernet12
- interface 5 - Ethernet16
- interface 6 - Ethernet20
- interface 7 - Ethernet24
Boot
- Timeout - 480
Property Inheritance
After all of that configuration, please click the bottom "UPLOAD" at the end of this page.
Upload the SONiC Image to CML
Now you need to upload the SONiC image that you just converted to the Cisco CML. To do that, simply follow these steps.Â
STEP 1: Click the "MANAGE" Button in the Image Definitions section
Add SONiC Node to a CML Lab
Once the image is uploaded:
STEP 1: Open an existing lab or create a new one
STEP 2: Drag the SONiC Virtual Switch node into the topology
STEP 3: Connect it to other nodes(Ethernet 4 to Ethernet 8 for this example)
STEP 4: Start the lab
Wait until the node reaches the sonic login prompt.
Create a Minimal SONiC Configuration and Verify Connectivity
To verify connectivity you need to configure the SONiC first to properly test the connectivity.
First switch:
sudo config interface ip add Ethernet4 192.168.10.1/24
Second switch:
sudo config interface ip add Ethernet8 192.168.10.2/24
use ping command to verify Layer 3 connectivity.
Congratulations!
You have successfully set up Community SONiC VS image in the Cisco CML environment. Now you can proceed with your tests.
Happy networking!
Â
Useful links:
Where to download the SONiC Virtual Switch (VS) community pre-built image?
Â
Â
Â
Â
Comments 0
Comments
Please sign in to leave a comment.