aristanetworks/EosSdk

Run agents/daemons in a specific VRF

denysaleksandrov opened this issue · 2 comments

Is it possible to run an agent in a specific VRF?

I sync data with an external aggregator via HTTP, and it works pretty well on switches where that external resource is reachable via default netns/vrf. But on devices where we use MGMT netns/vrf and the default routing table is just empty, my agent fails with the following errors:

===== Output from /mnt/flash/IntfCounters.py [] (PID=23289) started Mar  9 20:31:07.581556 ===
Using EOS SDK 2.6.0
2020-03-09 20:31:08.231676 Using external Socket tbl://sysdb/+n
2020-03-09 20:31:08.231840 Using externally set fd: 6
Init.
Current timeout 10.0 called
Exception reached onNotificationException: Swig::DirectorMethodException("SWIG director method error. Error detected when calling 'TimeoutHandler.on_timeout'")

I suppose it fails when it tries to open a socket to an IP address, which is not reachable from the default netns/vrf.

Hey @denysaleksandrov -- I think you want to use the vrf_mgr->socket_at(...) function to open a connection in a VRF (https://github.com/aristanetworks/EosSdk/blob/master/eos/vrf.h#L108).

@rmadsen thanks.
I send data using "requests." Need to find out how to force "requests" to use an existing socket to transmit data.