Open kzorba opened 2 years ago
@kzorba If you don’t need grains you could disable grains on your minion.
@network-shark Thanks for the input, unfortunately I don't see any option that allows you to do that on the minion. Any references?
@kzorba
From the Saltstack docs , there is a blacklist grains option .
grains_blacklist:
- cpu_flags
- zmq*
- ipv[46]
Let me know if it is working for you never have to use it.
Hello @network-shark, I had seen this option and I just tested it. It works as I expected, the grains collections happen like before but the specific items you put in this option are filtered out afterwards. No effect in my problem, the router is overwhelmed with get-interface-information netconf requests. I believe the way to go is to use 'provider' option in napalm proxy minion, overriding napalm_base with my implementation.
@kzorba Ok , maybe the naming here is a bit odd. For me blacklisting is that it should not be executed anyway. But maybe this is more a salt issue / feature request.
One last thing you could check what @mirceaulinic did with salt-sproxy --cache-grains
https://salt-sproxy.readthedocs.io/en/latest/opts.html
There is a option --cache-grains This argument has been defaulted to True
Even if you are not using it , maybe it helps how he implemented it.
Caching of interface_list in get_facts
In junos driver when get_facts() is called a
get-interface-information
rpc call is issued that can be a very expensive operation in some cases (eg BNG devices). Caching of interface_list in facts can greatly benefit performance.When NAPALM is used in a Salt(stack) environment during proxy minion startup
get_facts()
is called multiple times. On some devices, like BNG boxes, theget-interface-information
is a very expensive operation and can cause the minion to wait multiple minutes to be able to start receiving and servicing requests from the salt master after its boot. While a lot of other facts are cached smartly in the underlying PyEZ library, NAPALM does not cache interface_lists. A PR will follow with a fix to enable further discussion. This caching mechanism could also benefitget_interfaces()
.Setup
Install Salt v3002.7 and NAPALM 3.3.1, configure a proxy minion to target a BNG box with thousands on sessions terminated on it.
napalm version
Network operating system version
Tested with:
Problem is most probably there with other (or all) recent JunOS versions.
Steps to Reproduce the Issue
Configure a Salt proxy minion targeting a BNG box with many sessions of users. Watch the startup process of the minion and observe the many times
get-interfaces-information
rpc is called viaget_facts()
that cause the minion to wait even for 10s of minutes.