Skip to content
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

reload_at config variable ignored #6

Closed
falz opened this issue Apr 27, 2020 · 7 comments
Closed

reload_at config variable ignored #6

falz opened this issue Apr 27, 2020 · 7 comments

Comments

@falz
Copy link

falz commented Apr 27, 2020

Hi there,

Doing some testing of this on Cisco ME3400 devices as a method to mass upgrade.

We're noticing that the 'reload_at' setting we have in config.yaml is being ignored. We changed the default 00:00 to 06:00, but it still uses 00:00. Other things from our config.yaml are being accepted.

The reload_* portion of config.yaml looks like this (default commented out):

reload_in: false
#reload_in: 10
reload_at: '06:00'

I've tested this on a handful of devices, all me3400, always with the same results. Config syntax above perhaps?

@austind
Copy link
Owner

austind commented Apr 29, 2020

Give the latest commit a shot.

Does the code work otherwise on ME3400s?

@falz
Copy link
Author

falz commented Apr 29, 2020

Yep that did it. And yes seems to work, have tested where the image was already installed from archive (so it was a subdir) and where there was a .bin in the root.

We have scp enabled on them, which also works even though the release notes/instructions imply it shouldn't. Times are pretty much all over the place, here's some samples:

Total time elapsed: 0:17:41.948463
Total time elapsed: 0:22:26.918263
Total time elapsed: 0:26:18.993592
Total time elapsed: 0:31:05.640006
Total time elapsed: 0:46:19.443902

@falz
Copy link
Author

falz commented Apr 30, 2020

Additional comment. Our testing so far is just using this inline from the python3 cli. If we use it in production, it will be called by some code.

Is there a way to set reload_at (or perhaps any other config value) manually in the code to override the config? For example, if we want to upgrade 100 devices we almost certainly don't want to reload them all at the same time.

@austind
Copy link
Owner

austind commented Apr 30, 2020

Pushed another update that allows you to disable reloads by setting both reload_in and reload_at to false in config.yaml.

Then upgrade() will do everything except schedule reload. You can manually call schedule_reload() afterward, specifying either reload_at or reload_in with whatever value you want at runtime.

Later I may add a stagger_reload option that randomizes reloads across a given interval.

@austind
Copy link
Owner

austind commented May 4, 2020

I added a reload_range option to the latest push.

@austind austind closed this as completed May 8, 2020
@falz
Copy link
Author

falz commented May 27, 2020

Sorry to poke on resolved ticket, but in issue 8 I was testing some stuff, and noticed i'm having this same issue again. That testing is in the dev branch, happen to know if this fix happened there?

options i have set (range is set low as a test):

 'reload_at': False,
 'reload_in': 0,
 'reload_range': 5,

.. but the device is scheduled to load just after midnight:
Reload scheduled for 00:01:00 CDT Thu May 28 2020 (in 10 hours and 43 minutes) by netconf

If I'm understanding properly, the settings i have, and desire, is to do an immediate reload.

@austind
Copy link
Owner

austind commented May 28, 2020

Latest dev commit includes several bugfixes in schedule_reload(). Give it a shot.

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

No branches or pull requests

2 participants