From 3f93fbb1c4c3343c96fc14ab85c7805a365dc149 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Fri, 19 Feb 2021 10:40:10 +0000 Subject: [PATCH 1/2] aligned kinds --- cmd/generate.go | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/cmd/generate.go b/cmd/generate.go index edf53a866..c7a845d5b 100644 --- a/cmd/generate.go +++ b/cmd/generate.go @@ -1,18 +1,3 @@ -/* -Copyright © 2020 NAME HERE - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package cmd import ( @@ -30,12 +15,17 @@ import ( ) var interfaceFormat = map[string]string{ - "srl": "e1-%d", - "ceos": "eth%d", - "linux": "eth$d", - "bridge": "veth%d", + "srl": "e1-%d", + "ceos": "eth%d", + "crpd": "eth%d", + "sonic-vs": "eth%d", + "linux": "eth%d", + "bridge": "veth%d", + "vr-sros": "eth%d", + "vr-vmx": "eth%d", + "vr-xrv9k": "eth%d", } -var supportedKinds = []string{"srl", "ceos", "linux", "bridge", "sonic", "crpd"} +var supportedKinds = []string{"srl", "ceos", "linux", "bridge", "sonic-vs", "crpd", "vr-sros", "vr-vmx", "vr-xrv9k"} const ( defaultSRLType = "ixr6" From 8267c48b2fda0e1dffc2f6051a0bd2e658164bd5 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Fri, 19 Feb 2021 10:48:20 +0000 Subject: [PATCH 2/2] add max-workers flag support to generate command #280 --- cmd/generate.go | 1 + docs/cmd/generate.md | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cmd/generate.go b/cmd/generate.go index c7a845d5b..fc159deca 100644 --- a/cmd/generate.go +++ b/cmd/generate.go @@ -121,6 +121,7 @@ func init() { generateCmd.Flags().StringVarP(&groupPrefix, "group-prefix", "", defaultGroupPrefix, "prefix used in group names") generateCmd.Flags().StringVarP(&file, "file", "", "", "file path to save generated topology") generateCmd.Flags().BoolVarP(&deploy, "deploy", "", false, "deploy a fabric based on the generated topology file") + generateCmd.Flags().UintVarP(&maxWorkers, "max-workers", "", 0, "limit the maximum number of workers creating nodes and virtual wires") } func generateTopologyConfig(name, network, ipv4range, ipv6range string, images map[string]string, licenses map[string]string, nodes ...nodesDef) ([]byte, error) { diff --git a/docs/cmd/generate.md b/docs/cmd/generate.md index 859b907ce..3142df832 100644 --- a/docs/cmd/generate.md +++ b/docs/cmd/generate.md @@ -70,6 +70,11 @@ When `--deploy` flag is present, the lab deployment process starts using the gen The generated definition file is first saved by the path set with `--file` or, if file path is not set, by the default path of `.yml`. Then the equivalent of the `deploy -t --reconfigure` command is executed. +#### max-workers +With `--max-workers` flag it is possible to limit the amout of concurrent workers that create containers or wire virtual links. By default the number of workers equals the number of nodes/links to create. + +If during the deployment of a large scaled lab you see errors about max number of opened files reached, limit the max workers with this flag. + #### file With `--file` flag its possible to save the generated topology definition in a file by a given path.