Skip to content

Commit

Permalink
added vr-vmx kind
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jan 22, 2021
1 parent 6ceb5f3 commit 44555c1
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 2 deletions.
16 changes: 16 additions & 0 deletions clab/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,22 @@ func (c *CLab) NewNode(nodeName string, nodeCfg NodeConfig, idx int) error {

node.Cmd = fmt.Sprintf("--num-nics %s --connection-mode %s --hostname %s --variant %s", node.Env["NUM_NICS"], node.Env["CONNECTION_MODE"], node.ShortName, node.NodeType)

case "vr-vmx":
node.Image = c.imageInitialization(&nodeCfg, node.Kind)
node.Group = c.groupInitialization(&nodeCfg, node.Kind)
node.Position = c.positionInitialization(&nodeCfg, node.Kind)
node.User = user

// env vars are used to set launch.py arguments in vrnetlab container
defEnv := map[string]string{
"USERNAME": "admin",
"PASSWORD": "admin@123",
"CONNECTION_MODE": "bridge",
}
node.Env = mergeStringMaps(defEnv, envs)

node.Cmd = fmt.Sprintf("--username %s --password %s --hostname %s --connection-mode %s --trace", node.Env["USERNAME"], node.Env["PASSWORD"], node.ShortName, node.Env["CONNECTION_MODE"])

case "alpine", "linux":
node.Config = c.configInitialization(&nodeCfg, node.Kind)
node.Image = c.imageInitialization(&nodeCfg, node.Kind)
Expand Down
29 changes: 29 additions & 0 deletions docs/lab-examples/vr-vmx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
| | |
| ----------------------------- | ------------------------------------------------------------------------------------ |
| **Description** | A Nokia SR Linux connected back-to-back with Juniper vMX |
| **Components** | [Nokia SR Linux][srl], [Juniper vMX][vmx] |
| **Resource requirements**[^1] | :fontawesome-solid-microchip: 2 <br/>:fontawesome-solid-memory: 8 GB |
| **Topology file** | [vr02.yml][topofile] |
| **Name** | vr02 |
| **Version information**[^2] | `containerlab:0.9.0`, `srlinux:20.6.3-145`, `vr-vmx:20.2R1.10`, `docker-ce:19.03.13` |

## Description
A lab consists of an SR Linux node connected with Juniper vMX via a point-to-point ethernet link. Both nodes are also connected with their management interfaces to the `clab` docker network.

Juniper vMX VM is launched as a container, using [vrnetlab integration](../manual/vrnetlab.md).

<div class="mxgraph" style="max-width:100%;border:1px solid transparent;margin:0 auto; display:block;" data-mxgraph="{&quot;page&quot;:0,&quot;zoom&quot;:1.5,&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;check-visible-state&quot;:true,&quot;resize&quot;:true,&quot;url&quot;:&quot;https://raw.githubusercontent.com/srl-wim/container-lab/diagrams/vr02.drawio&quot;}"></div>

## Use cases
This lab allows users to launch basic interoperability scenarios between Nokia SR Linux and Juniper vMX network operating systems.

The lab directory [contains](https://github.com/srl-wim/container-lab/tree/master/lab-examples/vr02) files with essential configurations which can be used to jumpstart the interop demonstration.

[srl]: https://www.nokia.com/networks/products/service-router-linux-NOS/
[vmx]: https://www.juniper.net/us/en/products-services/routing/mx-series/vmx/
[topofile]: https://github.com/srl-wim/container-lab/tree/master/lab-examples/vr02/vr02.yml

[^1]: Resource requirements are provisional. Consult with the installation guides for additional information.
[^2]: The lab has been validated using these versions of the required tools/components. Using versions other than stated might lead to a non-operational setup process.

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/hellt/drawio-js@main/embed2.js" async></script>
67 changes: 67 additions & 0 deletions docs/manual/kinds/vr-vmx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Juniper vMX

[Juniper vMX](https://www.juniper.net/us/en/products-services/routing/mx-series/vmx/) virtualized router is identified with `vr-vmx` kind in the [topology file](../topo-def-file.md). It is built using [vrnetlab](../vrnetlab.md) project and essentially is a Qemu VM packaged in a docker container format.

vr-vmx nodes launched with containerlab comes up pre-provisioned with SSH, SNMP, NETCONF and gNMI services enabled.

## Managing vr-vmx nodes

!!!note
Containers with vMX inside will take ~7min to fully boot.
You can monitor the progress with `docker logs -f <container-name>`.

Juniper vMX node launched with containerlab can be managed via the following interfaces:

=== "bash"
to connect to a `bash` shell of a running vr-vmx container:
```bash
docker exec -it <container-name/id> bash
```
=== "CLI via SSH"
to connect to the vMX CLI
```bash
ssh admin@<container-name/id>
```
=== "NETCONF"
NETCONF server is running over port 830
```bash
ssh admin@<container-name> -p 830 -s netconf
```
=== "gNMI"
using the best in class [gnmic](https://gnmic.kmrd.dev) gNMI client as an example:
```bash
gnmic -a <container-name/node-mgmt-address> --insecure \
-u admin -p admin@123 \
capabilities
```

!!!info
Default user credentials: `admin:admin@123`

## Interfaces mapping
vr-vmx container can have up to 90 interfaces and uses the following mapping rules:

* `eth0` - management interface connected to the containerlab management network
* `eth1` - first data interface, mapped to first data port of vMX line card
* `eth2+` - second and subsequent data interface

When containerlab launches vr-vmx node, it will assign IPv4/6 address to the `eth0` interface. These addresses can be used to reach management plane of the router.

Data interfaces `eth1+` needs to be configured with IP addressing manually using CLI/management protocols.


## Features and options
### Node configuration
vr-vmx nodes come up with a basic configuration where only the control plane and line cards are provisioned, as well as the `admin` users and management interfaces such as NETCONF, SNMP, gNMI.

## Lab examples
The following labs feature vr-vmx node:

- [SR Linux and Juniper vMX](../../lab-examples/vr-vmx.md)

## Known issues and limitations

* when listing docker containers, vr-vmx container will always report unhealthy status. Do not rely on this status.
* LACP and BPDU packets are not propagated to/from vrnetlab based routers launched with containerlab.
* vMX requires Linux kernel 4.17+
* To check the boot log, use `docker logs -f <node-name>`.
9 changes: 7 additions & 2 deletions docs/manual/vrnetlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Although this approach has many pros, it doesn't allow users to define the VM ba
## Vrnetlab
Vrnetlab essentially allows to package a regular VM inside a container and makes it runnable and accessible as if it was a container image all way long.

To make this work, vrnetlab provides a set of scripts that will build the container image taking a user provided qcow file as an input.
To make this work, vrnetlab provides a set of scripts that will build the container image taking a user provided qcow file as an input. This enables containerlab to build topologies which consist both of native containerized NOSes and the VMs:

<div class="mxgraph" style="max-width:100%;border:1px solid transparent;margin:0 auto; display:block;" data-mxgraph="{&quot;page&quot;:1,&quot;zoom&quot;:1.5,&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;nav&quot;:true,&quot;check-visible-state&quot;:true,&quot;resize&quot;:true,&quot;url&quot;:&quot;https://raw.githubusercontent.com/srl-wim/container-lab/diagrams/vrnetlab.drawio&quot;}"></div>

!!!info
Although multiple vendors are supported in vrnetlab, to make these images work with container-based networking, we needed to fork the project and provide the necessary improvements.
Although multiple vendors are supported in vrnetlab, to make these images work with container-based networking, we needed to [fork](https://github.com/hellt/vrnetlab) the project and provide the necessary improvements.
Thus, the VM based products will appear in the supported list gradually.

### Supported VM products
Expand All @@ -27,5 +27,10 @@ Nokia's virtualized SR OS, aka VSR/VSim has been added to containerlab supported

To build a container image with SR OS inside users should follow [the instructions](https://github.com/hellt/vrnetlab/tree/master/sros#building-the-docker-image) provided and using the code of the forked version of a vrnetlab project.

#### Juniper vMX
Juniper's virtualized MX router - vMX - has been added to containerlab supported kinds under the [vr-vmx](kinds/vr-vmx.md) kind. A [demo lab](../lab-examples/vr-vmx.md) explains the way this kind can be used.

To build a container image with SR OS inside users should follow [the instructions](https://github.com/hellt/vrnetlab/tree/master/vmx#building-the-docker-image) provided and using the code of the forked version of a vrnetlab project.

### Limitations
* LACP and BPDU packets can not be delivered to/from VM's running inside the containers when launched with containerlab.
9 changes: 9 additions & 0 deletions lab-examples/vr02/srl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enter candidate
set / interface ethernet-1/1
set / interface ethernet-1/1 admin-state enable
set / interface ethernet-1/1 subinterface 0
set / interface ethernet-1/1 subinterface 0 ipv4
set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.1.1/24
set / network-instance default
set / network-instance default interface ethernet-1/1.0
commit now
3 changes: 3 additions & 0 deletions lab-examples/vr02/vmx.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
configure
set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.2/24
commit
16 changes: 16 additions & 0 deletions lab-examples/vr02/vr02.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: vr02

topology:
nodes:
srl:
kind: srl
image: srlinux:20.6.3-145
license: license.key
vmx:
kind: vr-vmx
image: vrnetlab/vr-vmx:20.2R1.10
env:
CONNECTION_MODE: vrxcon

links:
- endpoints: ["srl:e1-1", "vmx:eth1"]
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ nav:
- crpd - Juniper cRPD: manual/kinds/crpd.md
- ceos - Arista cEOS: manual/kinds/ceos.md
- vr-sros - Nokia SR OS: manual/kinds/vr-sros.md
- vr-vmx - Juniper vMX: manual/kinds/vr-vmx.md
- Configuration artifacts: manual/conf-artifacts.md
- Network wiring concepts: manual/network.md
- Packet capture & Wireshark: manual/wireshark.md
Expand All @@ -34,6 +35,7 @@ nav:
- External bridge capability: lab-examples/ext-bridge.md
- WAN topology: lab-examples/wan.md
- SR Linux and Nokia SR OS: lab-examples/vr-sros.md
- SR Linux and Juniper vMX: lab-examples/vr-vmx.md

site_author: Roman Dodin
site_description: >-
Expand Down Expand Up @@ -76,6 +78,8 @@ extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/hellt
- icon: fontawesome/brands/twitter
link: https://twitter.com/ntdvps

# Extensions
markdown_extensions:
Expand Down

0 comments on commit 44555c1

Please sign in to comment.