Rewrite the 'netlab restart' functionality#3380
Conversation
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
|
@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? |
There was a problem hiding this comment.
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.pyto load the snapshot, stop the lab, and restart using the original topology path stored in the snapshot; added--instancesupport. - 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. |
Yes that now works, thanks a lot for fixing 👍 |
Thanks for the confirmation, merging... |
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