Skip to content

Rewrite the 'netlab restart' functionality#3380

Merged
ipspace merged 2 commits into
devfrom
cli-restart
May 12, 2026
Merged

Rewrite the 'netlab restart' functionality#3380
ipspace merged 2 commits into
devfrom
cli-restart

Conversation

@ipspace
Copy link
Copy Markdown
Owner

@ipspace ipspace commented May 11, 2026

The 'netlab restart' functionality was mostly broken and did not work with the 'more recent' additions like non-default snapshot files or explicit lab instances.

This commit completely rewrites the top-level 'netlab restart' workflow and hopefully makes the code and documentation match.

Closes #3359 and replaces #3354

The 'netlab restart' functionality was mostly broken and did not
work with the 'more recent' additions like non-default snapshot files
or explicit lab instances.

This commit completely rewrites the top-level 'netlab restart' workflow
and hopefully makes the code and documentation match.

Closes #3359 and replaces #3354
@ipspace
Copy link
Copy Markdown
Owner Author

ipspace commented May 11, 2026

@sjhloco -- in the end, I rewrote the whole stuff. The old code was obsolete and way too trivial (I remember someone asking for it and me hacking it together in a minute or two). Would love to hear whether it works for you.

@DanPartelly -- do you want to look at this?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites the netlab restart command flow to reliably restart a lab by loading the snapshot (optionally from a selected instance) to discover the original topology file, then running netlab down followed by netlab up. It also adds a platform integration test and updates the user documentation to reflect the new behavior.

Changes:

  • Reimplemented netsim/cli/restart.py to load the snapshot, stop the lab, and restart using the original topology path stored in the snapshot; added --instance support.
  • Added a platform integration CLI test that exercises netlab restart.
  • Updated restart documentation and help/usage text to match the revised workflow and options.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
netsim/cli/restart.py New restart workflow: parse args, load snapshot to find original topology, call down.run() then up.run() with reconstructed args.
tests/platform-integration/cli/11-restart.yml Adds an integration scenario that brings up a lab and runs netlab restart, validating OSPF adjacency afterward.
docs/netlab/restart.md Updates command description and usage/options to document snapshot/instance-aware restart behavior.

Comment thread netsim/cli/restart.py
Comment thread netsim/cli/restart.py
Comment thread docs/netlab/restart.md
Comment thread netsim/cli/restart.py Outdated
@sjhloco
Copy link
Copy Markdown

sjhloco commented May 11, 2026

@sjhloco -- in the end, I rewrote the whole stuff. The old code was obsolete and way too trivial (I remember someone asking for it and me hacking it together in a minute or two). Would love to hear whether it works for you.

Yes that now works, thanks a lot for fixing 👍

@ipspace
Copy link
Copy Markdown
Owner Author

ipspace commented May 12, 2026

Yes that now works, thanks a lot for fixing 👍

Thanks for the confirmation, merging...

@ipspace ipspace merged commit 177f37d into dev May 12, 2026
14 of 16 checks passed
@ipspace ipspace deleted the cli-restart branch May 12, 2026 05:07
ipspace added a commit that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] netlab restart is broken

3 participants