restart command#
The node's lifecycle command set consists of start, stop, and restart commands that allow users to individually control the lifecycle of the nodes in a deployed lab. The most common use case is to restart or stop+start the nodes that are stuck in some bad shape or require a reboot while keeping their dataplane interfaces intact.
With these commands you don't need to respin the whole topology when all you need is to restart a few nodes.
Description#
The restart command restarts one or more nodes in a deployed lab by performing a lifecycle-aware stop+start operation.
For running nodes, containerlab parks dataplane interfaces before stop and restores them on start. For already stopped nodes, containerlab performs the start/restore phase.
All command line arguments can be also provided via environment variables (CLI flags take precedence). The environment variable names are constructed by prepending
CLAB_to the flag name, then adding the command path and ending with the flag name in its full form, all in uppercase and with hyphens replaced by underscores.For example, the
--max-workersflag for thedeploycommand can be set viaCLAB_DEPLOY_MAX_WORKERSenvironment variable. OrCLAB_INSPECT_ALL=1to set--allflag for theinspectcommand. OrCLAB_TOPO=srlinux.dev/clab-srl clab dep -cto deploy a lab with the topology passed via environment variable.
Usage#
containerlab [global-flags] restart [local-flags]
Flags#
topology | name#
Use the global --topo | -t flag to reference the lab topology file, or use the global --name flag to reference an already deployed lab by name.
One of --topo or --name is required.
node#
Use local --node | -n to select nodes to restart.
The flag is repeatable and also supports comma-separated values:
containerlab restart -t mylab.clab.yml --node r1 --node r2
containerlab restart -t mylab.clab.yml --node r1,r2
If --node is omitted, all nodes in the selected lab are restarted.
Limitations#
Node lifecycle operations (stop, start, restart) currently support only a subset of nodes:
- only veth dataplane links are supported
- root-namespace-based nodes are not supported
- nodes with
auto-removeenabled are not supported - only single-container nodes are supported
network-mode: container:<...>users/providers are not supported