-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ var kinds = []string{ | |
"ceos", | ||
"crpd", | ||
"sonic-vs", | ||
"vr-ftosv", | ||
"vr-n9kv", | ||
"vr-sros", | ||
"vr-vmx", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Dell FTOSv (OS10) / ftosv | ||
|
||
Dell FTOSv (OS10) virtualized router/switch is identified with `vr-ftosv` 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-ftosv nodes launched with containerlab comes up pre-provisioned with SSH and SNMP services enabled. | ||
|
||
## Managing vr-ftosv nodes | ||
|
||
!!!note | ||
Containers with FTOS10v inside will take ~2-4min to fully boot. | ||
You can monitor the progress with `docker logs -f <container-name>`. | ||
|
||
Dell FTOS10v node launched with containerlab can be managed via the following interfaces: | ||
|
||
=== "bash" | ||
to connect to a `bash` shell of a running vr-ftosv container: | ||
```bash | ||
docker exec -it <container-name/id> bash | ||
``` | ||
=== "CLI" | ||
to connect to the Dell FTOSv CLI | ||
```bash | ||
ssh admin@<container-name/id> | ||
``` | ||
|
||
!!!info | ||
Default user credentials: `admin:admin` | ||
|
||
## Interfaces mapping | ||
vr-ftosv container can have different number of available interfaces which depends on platform used under FTOS10 virtualization .qcow2 disk and container image built using [vrnetlab](../vrnetlab.md) project. Interfaces uses the following mapping rules (in topology file): | ||
|
||
* `eth0` - management interface connected to the containerlab management network | ||
* `eth1` - first data interface, mapped to first data port of FTOS10v line card | ||
* `eth2+` - second and subsequent data interface | ||
|
||
When containerlab launches vr-ftosv 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-ftosv nodes come up with a basic configuration where only `admin` user and management interfaces such as SSH provisioned. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright 2020 Nokia | ||
// Licensed under the BSD 3-Clause License. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
package vr_ftosv | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/srl-labs/containerlab/nodes" | ||
"github.com/srl-labs/containerlab/runtime" | ||
"github.com/srl-labs/containerlab/types" | ||
"github.com/srl-labs/containerlab/utils" | ||
) | ||
|
||
func init() { | ||
nodes.Register(nodes.NodeKindVrFTOSV, func() nodes.Node { | ||
return new(vrFtosv) | ||
}) | ||
} | ||
|
||
type vrFtosv struct { | ||
cfg *types.NodeConfig | ||
mgmt *types.MgmtNet | ||
runtime runtime.ContainerRuntime | ||
} | ||
|
||
func (s *vrFtosv) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error { | ||
s.cfg = cfg | ||
for _, o := range opts { | ||
o(s) | ||
} | ||
// env vars are used to set launch.py arguments in vrnetlab container | ||
defEnv := map[string]string{ | ||
"CONNECTION_MODE": nodes.VrDefConnMode, | ||
"USERNAME": "admin", | ||
"PASSWORD": "admin", | ||
"DOCKER_NET_V4_ADDR": s.mgmt.IPv4Subnet, | ||
"DOCKER_NET_V6_ADDR": s.mgmt.IPv6Subnet, | ||
} | ||
s.cfg.Env = utils.MergeStringMaps(defEnv, s.cfg.Env) | ||
|
||
if s.cfg.Env["CONNECTION_MODE"] == "macvtap" { | ||
// mount dev dir to enable macvtap | ||
s.cfg.Binds = append(s.cfg.Binds, "/dev:/dev") | ||
} | ||
|
||
s.cfg.Cmd = fmt.Sprintf("--username %s --password %s --hostname %s --connection-mode %s --trace", | ||
s.cfg.Env["USERNAME"], s.cfg.Env["PASSWORD"], s.cfg.ShortName, s.cfg.Env["CONNECTION_MODE"]) | ||
return nil | ||
} | ||
func (s *vrFtosv) Config() *types.NodeConfig { return s.cfg } | ||
func (s *vrFtosv) PreDeploy(configName, labCADir, labCARoot string) error { | ||
utils.CreateDirectory(s.cfg.LabDir, 0777) | ||
return nil | ||
} | ||
func (s *vrFtosv) Deploy(ctx context.Context) error { | ||
_, err := s.runtime.CreateContainer(ctx, s.cfg) | ||
return err | ||
} | ||
func (s *vrFtosv) PostDeploy(ctx context.Context, ns map[string]nodes.Node) error { | ||
return nil | ||
} | ||
|
||
func (s *vrFtosv) GetImages() map[string]string { | ||
return map[string]string{ | ||
nodes.ImageKey: s.cfg.Image, | ||
} | ||
} | ||
|
||
func (s *vrFtosv) Destroy(ctx context.Context) error { return nil } | ||
func (s *vrFtosv) WithMgmtNet(mgmt *types.MgmtNet) { s.mgmt = mgmt } | ||
func (s *vrFtosv) WithRuntime(r runtime.ContainerRuntime) { s.runtime = r } | ||
func (s *vrFtosv) GetRuntime() runtime.ContainerRuntime { return s.runtime } | ||
|
||
func (s *vrFtosv) Delete(ctx context.Context) error { | ||
return s.runtime.DeleteContainer(ctx, s.Config().LongName) | ||
} | ||
|
||
func (s *vrFtosv) SaveConfig(ctx context.Context) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
"vr-pan", | ||
"vr-ros", | ||
"vr-n9kv", | ||
"vr-ftosv", | ||
"linux", | ||
"bridge", | ||
"ovs-bridge", | ||
|