Skip to content

Commit 98492a8

Browse files
kaelemchellt
andauthored
Add support for Cisco Catalyst 9000v (#225)
* Add minimum nics arg to VM class & add dummy nic generation feature for Cat9kv support. * Add removal of .xml files from docker/ directory. * add copy of vswitch.xml file if present (for cat9kv). * Add initial support for Cisco Cat9kv * Remove image install process. * Remove ASIC image tagging * Correct hostname in bootstrap & startup configurations. * formatting * Fix directory creation for when vswitch.xml file is added via binds * Add supplement qemu PCI args for dummy nics * format with ruff add no-install-recommends --------- Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
1 parent 7ee2dbd commit 98492a8

File tree

6 files changed

+454
-3
lines changed

6 files changed

+454
-3
lines changed

cat9kv/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
VENDOR=Cisco
2+
NAME=cat9kv
3+
IMAGE_FORMAT=qcow2
4+
IMAGE_GLOB=*.qcow2
5+
6+
# match versions like:
7+
# csr1000v-universalk9.16.03.01a.qcow2
8+
# csr1000v-universalk9.16.04.01.qcow2
9+
VERSION=$(shell echo $(IMAGE) | sed -e 's/.\+[^0-9]\([0-9]\+\.[0-9]\+\.[0-9]\+[a-z]\?\)\([^0-9].*\|$$\)/\1/')
10+
11+
-include ../makefile-sanity.include
12+
-include ../makefile.include

cat9kv/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Cisco Catalyst 9000V
2+
3+
This is the vrnetlab image for the Cisco Catalyst 9000v (cat9kv, c9000v).
4+
5+
The Cat9kv emulates two types of ASICs that are found in the common Catalyst 9000 hardware platforms, either:
6+
7+
- UADP (Cisco Unified Access Data Plane)
8+
- Cisco Silicon One Q200 (referred to as Q200 for short)
9+
10+
The Q200 is a newer ASIC, however doen't support as many features as the UADP ASIC emulation.
11+
12+
> Insufficient RAM will not allow the node to boot correctly.
13+
14+
Eight interfaces will always appear regardless if you have defined any links in the `*.clab.yaml` topology file. The Cat9kv requires 8 interfaces at minimum to boot, so dummy interfaces are created if there are an insufficient amount of interfaces (links) defined.
15+
16+
## Building the image
17+
18+
Copy the Cat9kv .qcow2 file in this directory and you can perform `make docker-image`. On average the image takes approxmiately ~4 minutes to build as an initial install process occurs.
19+
20+
The UADP and Q200 use the same .qcow2 image. The default image created is the UADP image.
21+
22+
To configure the Q200 image or enable a higher throughput dataplane for UADP; you must supply the relevant `vswitch.xml` file. You can place that file in this directory and build the image.
23+
24+
> You can obtain a `vswitch.xml` file from the relevant CML node definiton file.
25+
26+
Known working versions:
27+
28+
- cat9kv-prd-17.12.01prd9.qcow2 (UADP & Q200)
29+
30+
## Usage
31+
32+
You can define the image easily and use it in a topolgy. As mentioned earlier no links are requried to be defined.
33+
34+
```yaml
35+
# topology.clab.yaml
36+
name: mylab
37+
topology:
38+
nodes:
39+
cat9kv:
40+
kind: cisco_cat9kv
41+
image: vrnetlab/vr-cat9kv:<tag>
42+
```
43+
44+
You can also supply a vswitch.xml file using `binds`. Below is an example topology file.
45+
46+
```yaml
47+
# topology.clab.yaml
48+
name: mylab
49+
topology:
50+
nodes:
51+
cat9kv:
52+
kind: cisco_cat9kv
53+
image: vrnetlab/vr-cat9kv:<tag>
54+
binds:
55+
- /path/to/vswitch.xml:/vswitch.xml
56+
```
57+
58+
### Interface naming
59+
60+
Currently a maximum of 8 data-plane interfaces are supported. 9 interfaces total if including the management interface.
61+
62+
- `eth0` - Node management interface
63+
- `eth1` - First dataplane interface (GigabitEthernet1/0/1).
64+
- `ethX` - Subsequent dataplane interfaces will count onwards from 1. For example, the third dataplane interface will be `eth3`
65+
66+
You can also use interface aliases of `GigabitEthernet1/0/x` or `Gi1/0/x`
67+
68+
### Environment Variables
69+
70+
| Environment Variable | Default |
71+
| --------------------- | ------------- |
72+
| VCPU | 4 |
73+
| RAM | 18432 |
74+
75+
### Example
76+
77+
```yaml
78+
name: my-example-lab
79+
topology:
80+
nodes:
81+
my-cat9kv:
82+
kind: cisco_cat9kv
83+
image: vrnetlab/vr-cat9kv:17.12.01
84+
env:
85+
VCPU: 6
86+
RAM: 12288
87+
```
88+
89+
## System requirements
90+
91+
| | UADP (Default)| Q200 |
92+
| --------- | ------------- | ----- |
93+
| vCPU | 4 | 4 |
94+
| RAM (MB) | 18432 | 12288 |
95+
| Disk (GB) | 4 | 4 |

cat9kv/docker/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM public.ecr.aws/docker/library/debian:bookworm-slim
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update -qy \
6+
&& apt-get install -y --no-install-recommends \
7+
bridge-utils \
8+
iproute2 \
9+
socat \
10+
qemu-kvm \
11+
qemu-utils \
12+
python3 \
13+
tcpdump \
14+
inetutils-ping \
15+
ssh \
16+
telnet \
17+
procps \
18+
genisoimage \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
ARG VERSION
22+
ENV VERSION=${VERSION}
23+
ARG IMAGE
24+
COPY $IMAGE* /
25+
COPY *.py /
26+
# for vSwitch.xml file (specifies ASIC emulation parameters), won't throw error if vswitch.xml isn't present
27+
COPY vswitch.xm[l] /img_dir/conf/
28+
29+
EXPOSE 22 161/udp 830 5000 10000-10099
30+
HEALTHCHECK CMD ["/healthcheck.py"]
31+
ENTRYPOINT ["/launch.py"]

0 commit comments

Comments
 (0)