srl-labs / containerlab

container-based networking labs
https://containerlab.dev
BSD 3-Clause "New" or "Revised" License
1.53k stars 262 forks source link

add `redeploy` command #1010

Open hellt opened 2 years ago

hellt commented 2 years ago

redeploy command answers the need to quickly re-deploy a lab. It should be possible to redeploy a lab with and without keeping the lab directory.

Conceptually, redeploying a lab is a sequence of a destroy and deploy commands.

alexandrehassan commented 2 years ago

I'd like to try and tackle this if possible.

hellt commented 2 years ago

Sure. Thanks Alexandre!

On Thu, 29 Sep 2022 at 23:33, Alexandre Hassan @.***> wrote:

I'd like to try and tackle this if possible.

— Reply to this email directly, view it on GitHub https://github.com/srl-labs/containerlab/issues/1010#issuecomment-1262840392, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLKV5J6LFIC356EKBTQG5LWAYDL7ANCNFSM6AAAAAAQBPARAE . You are receiving this because you authored the thread.Message ID: @.***>

scotho3 commented 2 years ago

@hellt - re: keeping the lab directory, am I correct in these assumptions?

  1. In keeping the directory - the user has made changes, and wants a clean slate to reset the lab
  2. In destroying the directory - the user has made changes in the node.cfg files and wants to rebuild the lab with the new config files
hellt commented 2 years ago

@scotho3

  1. you want to keep a directory if you want some artifacts from it to be picked up when you destroy+deploy it again. Typically, this is related to the configuration that users saved during lab lifetime and they want these configs to be applied once they redeployt the lab. For example, you launched a lab, added some configs to the nodes, saved those configs so that they got written to disk (lab directory). Now you want to redeploy the lab for whatever reason, maybe you want to free up resources and get back to that lab later. You destroy the lab without removing the lab directory. Then you deploy the lab again, and those files from the lab directory will be picked up as startup config.
  2. When you remove the lab dir, all your configs that were persisted before will be flushed. You will start from a completely clean slate.

HTH