<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>as for execution of arbitrary code across the OpenStack cluster - I was thinking of mcollective + fact filters:<br><br></div>1) we need to start using mcollective facts [0] [2] - we don't use/configure this currently<br></div>2) use mcollective execute_shell_command agent (or any other agent) with fact filter [1]<br><br>So, for example, if we have mcollective fact called "node_roles":<br></div></div>node_roles: "compute ceph-osd"<br></div><br><div><div><div>Then we can execute shell cmd on all compute nodes like this:<br><br>mco rpc execute_shell_command execute cmd="/some_script.sh" -F "node_role=/compute/"<br><code></code><code class=""></code></div><div></div><div><br></div><div>Of course, we can use more complicated filters to run commands more precisely.<br></div><div><br>[0] <a href="https://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML">https://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML</a><br>[1] <a href="https://docs.puppetlabs.com/mcollective/reference/ui/filters.html#fact-filters">https://docs.puppetlabs.com/mcollective/reference/ui/filters.html#fact-filters</a><br>[2] <a href="https://docs.puppetlabs.com/mcollective/reference/plugins/facts.html">https://docs.puppetlabs.com/mcollective/reference/plugins/facts.html</a><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 10, 2014 at 6:04 PM, Dmitriy Shulyak <span dir="ltr"><<a href="mailto:dshulyak@mirantis.com" target="_blank">dshulyak@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi folks,<div><br></div><div>Some of you may know that there is ongoing work to achieve kindof data-driven orchestration </div><div>for Fuel. If this is new to you, please get familiar with spec:</div><div><br></div><div><a href="https://review.openstack.org/#/c/113491/" target="_blank">https://review.openstack.org/#/c/113491/</a><br></div><div><br></div><div>Knowing that running random command on nodes will be probably most usable type of</div><div>orchestration extension, i want to discuss our solution for this problem.</div><div><br></div><div>Plugin writer will need to do two things:</div><div><br></div><div>1. Provide custom task.yaml (i am using /etc/puppet/tasks, but this is completely configurable,</div><div>    we just need to reach agreement) </div><div><br></div><div>  /etc/puppet/tasks/echo/task.yaml</div><div>  </div><div>  with next content:</div><div>  </div><div>   type: exec</div><div>   cmd: echo 1 </div><div><br></div><div>2. Provide control plane with orchestration metadata</div><div><br></div><div>/etc/fuel/tasks/echo_task.yaml</div><div><br></div><div>controller:</div><div> -</div><div>  task: echo</div><div>  description: Simple echo for you</div><div>  priority: 1000</div><div>compute:</div><div><div>-</div><div>  task: echo</div><div>  description: Simple echo for you</div><div>  priority: 1000</div></div><div><br></div><div>This is done in order to separate concerns of orchestration logic and tasks.</div><div><br></div><div>From plugin writer perspective it is far more usable to provide exact command in orchestration metadata itself, like:</div><div><br></div><div><div>/etc/fuel/tasks/echo_task.yaml</div><div><br></div><div>controller:</div><div> -</div><div>  task: echo</div><div>  description: Simple echo for you</div><div>  priority: 1000</div></div><div>  cmd: echo 1</div><div>  type: exec</div><div><br></div><div>compute:</div><div>-</div><div><div><div> task: echo</div><div>  description: Simple echo for you</div><div>  priority: 1000</div></div><div>  cmd: echo 1</div><div>  type: exec</div></div><div><br></div><div>I would prefer to stick to the first, because there is benefits of using one interface between all tasks executors (puppet, exec, maybe chef), which will improve debuging and development process.</div><div><br></div><div>So my question is first - good enough? Or second is essential type of plugin to support?</div><div><br></div><div>If you want additional implementation details check:</div><div><a href="https://review.openstack.org/#/c/118311/" target="_blank">https://review.openstack.org/#/c/118311/</a><br></div><div><a href="https://review.openstack.org/#/c/113226/" target="_blank">https://review.openstack.org/#/c/113226/</a><br></div><div><br></div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>