-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding support for vJunos-switch #1553
Conversation
Hi @akielaries |
I used 23.1R1.8 image to try it out and something is not right when the login is attempted
It freezes waiting for a prompt to appear and maybe the prompt doesn't match or never appears |
Hello @hellt, I added some updates to the docs but I was unable to recreate this issue on my end with the script waiting for a CLI prompt in both 23.1R1.8 and latest 23.2R1.14. I tested this a few different times with both images.
And then it goes on to configure the node based on the startup-config file passed in. Perhaps instead of the script waiting for the node name + ">" it can wait for just the prompt indicator ">". |
Ah okay I finally was able to replicate this on around the 5th try on the 23.1R1.8 image. Let me see how to fix this! The issue likely lies in vrnetlab, I will open a new PR for this fix in that repo. Interacting with the Junos CLI to configure is tricky since expected prompts can get lost in log messages on boot. |
I got further with the skipped prompt watch you had done, but got stuck down the road again
Going to try the latest image |
Let me dig into this some more, my apologies! I am thinking the ideal way to get around interfering with the boot up messages is to wait for the FPC to come online to determine if our node is actually booted or not, this is the best indicator. See this:
The final messages we see just before the FPC does come online are the final messages related to boot (all related to encryption/hash verification) which ideally would signify our VM has completed bootup. Within the if match: # got a match!
if ridx == 0: # login
self.logger.info("VM started")
# Login
self.wait_write("\r", None)
self.wait_write("admin", wait="login:")
self.wait_write(self.password, wait="Password:")
self.wait_write("\r", wait=None)
self.logger.info("Login completed")
# self.wait_write("show chassis fpc", "Online")
# "show chassis fpc"
# if 'Onlining' or 'Present' in output
# FPC coming online, try again in a bit
# elif 'Online' in output
# FPC is online!, VM is booted, continue
# run startup config
self.startup_config() Instead of continuing to run |
@akielaries I think that you maybe want to merge your startup-config to a file that you mount as a disk. That way you don't have to rely on wonky wait_write. |
@hellt This sounds great, I agree. Let me see if I can possibly append the existing juniper.conf file that I am attaching to the VM in the first place with some user configuration passed in from containerlab. This will get rid of the need for the |
Hello, I mentioned in the hellt/vrnetlab#140 PR that I was able to get around the janky send/wait logic of the Junos CLI by appending the initial *.conf file that houses vrnetlab configs with the additional user config passed in from containerlab. I tested this on the latest 23.2R1.14 image and 23.1R1.8. |
thanks @akielaries |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1553 +/- ##
==========================================
- Coverage 48.62% 48.59% -0.03%
==========================================
Files 132 133 +1
Lines 12688 12774 +86
==========================================
+ Hits 6170 6208 +38
- Misses 5818 5863 +45
- Partials 700 703 +3
|
This PR goes in hand with hellt/vrnetlab#138 for adding support for Juniper's vJunos-switch, a virtual instance of an EX2914. I added the below file I used to test as a lab-example
Apologies for the double PR