2

If I have an Agent A that is installed and running on the platform, can I start an Agent B from within Agent A? (similar to the way volttron-ctl commands work from terminal)

Context: I want to do this because I need Agent B to make a RPC to Agent A, but Agent B needs to know Agent A's peer name in order to make this call (so I could pass this into the config of Agent A if I made it from within Agent B). I just need an alternative to hard coding the peer name each time I want to use Agent B to make an RPC to Agent A, which I'm hoping this will do.

1 Answers1

1

Please take a look at the voltron central agent and the volttron central platform agent.

https://github.com/VOLTTRON/volttron/blob/develop/services/core/VolttronCentralPlatform/vcplatform/agent.py#L821

Basically all instances (platform instances) have a service with a vip identity of control. You will use that to start stop install modify etc the agents on that instance. I would recommend using the volttron central platform agent for this, however you can repeat it if you want.

If you do chose to use the volttron central platform agent then you will want to give your agent the manager authorization as those agents with that privilege are the only ones that can call those rpc methods (in the develop branch).

Craig
  • 949
  • 1
  • 5
  • 13
  • So, as you mentioned, this agent is in the develop branch and not the master branch. Is there anything in the master branch with the ability to store a configuration for another agent? I'm able to start other agents using the Connection module (saw in VCP code), but I can't seem to find anything for remotely storing a configuration from an agent. – Kirtan Patel Feb 09 '17 at 20:16
  • 1
    The develop code will be branched and deployed and released scheduled for the 17th at that time it will be in the master branch – Craig Feb 09 '17 at 20:47
  • I tried this using VC + VCP agent. I start both and they are both running. Then I try calling the 'start_agent' method in VCP agent using RPC but when I try to call it with: self.vip.rpc.call('vcplatformagent-4.0', 'start_agent', uuid).get() I get a VIP Error 113 No route to host vcplatformagent-4.0. Does anything stand out that I'm doing wrong? – Kirtan Patel Sep 27 '17 at 19:26
  • 1
    Check the VIP identity of the platform agent by running "vctl status". The platform agent should have a fixed identity of "platform.agent". Usually you would get the name with `from volttron.platform.agent import known_identities known_identities.VOLTTRON_CENTRAL_PLATFORM` – Kyle Monson Sep 28 '17 at 17:17