<div dir="ltr">Hi Alexey,<div><br></div><div>That sounds like a good use case. If I understand it correctly, the use case can be accomplished by doing two things:</div><div><br></div><div>1. Writing a Vitrage datasource driver that whenever it receives an alarm, pulls Vitrage's API. I'd recommend having the datasource driver pulling periodically, and a push simply requests an immediate refresh of that data. That way, the data is available as soon as you create the datasource driver. </div><div><br></div><div>That would mean your datasource driver inherits from both the PushedDataSourceDriver and PollingDataSourceDriver classes. <span style="font-family:'helvetica neue',helvetica,arial,sans-serif;line-height:1.5">Pulling data has been in Congress since day 1, and all but one of our drivers pull data, so there are plenty of examples in congress/datasources. </span><span style="line-height:1.5"> Push is new functionality that Masahito added in Mitaka. </span></div><div><br></div><div><span style="font-family:'helvetica neue',helvetica,arial,sans-serif">Here are the docs on writing a datasource driver. I'd start with pulling the data from Vitrage and adding the push functionality once that is working (using the request_refresh() method from the PushedDataSourceDriver base class to force the poller to immediately pull the data).</span><br></div><div><br></div><div><a href="http://docs.openstack.org/developer/congress/cloudservices.html">http://docs.openstack.org/developer/congress/cloudservices.html</a><br></div><div><br></div><div>2. Writing a policy that uses the information about the host alarm that the datasource driver pulled. Below are 2 examples, where I'm assuming that the vitrage datasource driver creates a table called host_alarm within Congress.</div><div><br></div><div>- reactive policy like "whenever the host alarm is ON, pause all the VMs on that host". </div><div> Something like:</div><div> execute[nova:pause(vm)] :- vitrage:host_alarm(host), nova:servers(id=vm, hostId=host)</div><div><br></div><div>- monitoring policy: "whenever the host alarm is ON, all the VMs on that host belong to the violation table"</div><div> violation(vm) :- vitrage:host_alarm(host), nova:servers(id=vm, hostId=host)</div><div><br></div><div>Here are the docs on writing such policies.</div><div>Basic policy:</div><div><a href="http://docs.openstack.org/developer/congress/policy.html">http://docs.openstack.org/developer/congress/policy.html</a></div><div><br></div><div>Reactive policy:</div><div><a href="http://docs.openstack.org/developer/congress/enforcement.html#manual-reactive-enforcement">http://docs.openstack.org/developer/congress/enforcement.html#manual-reactive-enforcement</a></div><div><br></div><div>Tim </div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, May 12, 2016 at 1:45 AM Masahito MUROI <<a href="mailto:muroi.masahito@lab.ntt.co.jp">muroi.masahito@lab.ntt.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alexey,<br>
<br>
Thanks for clarified! I understood your use-case.<br>
<br>
Anyway, as Tim mentioned before, implementing Vitrage driver seems to be<br>
a good first step to integrate both.<br>
<br>
best regards,<br>
Masahito<br>
<br>
On 2016/05/10 20:00, Weyl, Alexey (Nokia - IL) wrote:<br>
> Hi Masahito,<br>
><br>
> In addition, I wanted to add that the reason Congress needs to get the data from Vitrage by a pushing mechanism and not via polling, is so there won't be a delay from when the event occurs and when Congress receives it. Using polling, it will take a number of seconds (the polling interval time, 30 seconds by default) until Congress will receive the data.<br>
><br>
> The reason of course why we need it, is to make the whole process work much faster, and be consistent with other projects such as OPNFV Doctor (that wants events to happen in less than 1 second).<br>
><br>
> Alexey<br>
><br>
>> -----Original Message-----<br>
>> From: Weyl, Alexey (Nokia - IL) [mailto:<a href="mailto:alexey.weyl@nokia.com" target="_blank">alexey.weyl@nokia.com</a>]<br>
>> Sent: Tuesday, May 10, 2016 1:45 PM<br>
>> To: OpenStack Development Mailing List (not for usage questions)<br>
>> Subject: Re: [openstack-dev] [vitrage] [congress] Vitrage-Congress<br>
>> Collaboration<br>
>><br>
>> Hi Masahito,<br>
>><br>
>> Thanks for your question.<br>
>><br>
>> There are two main reasons why we need to get alarms from Vitrage<br>
>> initially.<br>
>><br>
>> First, there are alarms that Vitrage generates ("deduced alarms") based<br>
>> on its user-defined templates and topology. Also, there are alarms that<br>
>> come from external sources outside of OpenStack, which Aodh and other<br>
>> projects do not hold. This information could also be valuable for<br>
>> Congress regardless of the RCA functionality.<br>
>><br>
>> Second, since Vitrage retrieves alarms from multiple sources, the RCA<br>
>> API takes as input the Vitrage-Id of the alarm. To know what that ID<br>
>> is, you will need to first get the Alarms from Vitrage.<br>
>><br>
>> Does this make sense? Would there be a different flow you think could<br>
>> work?<br>
>><br>
>> Best Regards,<br>
>> Alexey<br>
>><br>
>>> -----Original Message-----<br>
>>> From: Masahito MUROI [mailto:<a href="mailto:muroi.masahito@lab.ntt.co.jp" target="_blank">muroi.masahito@lab.ntt.co.jp</a>]<br>
>>> Sent: Tuesday, May 10, 2016 11:00 AM<br>
>>> To: <a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a><br>
>>> Subject: Re: [openstack-dev] [vitrage] [congress] Vitrage-Congress<br>
>>> Collaboration<br>
>>><br>
>>> Hi Alexey,<br>
>>><br>
>>> This use case sounds interesting. To be clarified it, I have a<br>
>>> question.<br>
>>><br>
>>> On 2016/05/10 0:17, Weyl, Alexey (Nokia - IL) wrote:<br>
>>>> Hi Tim,<br>
>>>><br>
>>>> I agree – creating a datasource from Vitrage to Congress is the<br>
>>>> first step, and we should have some concrete use case in mind to<br>
>>>> help guide this process.<br>
>>>><br>
>>>> The most straightforward use case I would suggest is when there is<br>
>> a<br>
>>>> problem on an instance that is caused by some problem on the<br>
>>>> physical host. Then:<br>
>>>><br>
>>>> ·Vitrage will notify about an alarm on the instance, which Congress<br>
>>>> will receive<br>
>>>><br>
>>> Why does Congress need to receive the alarm? DataSouce Driver pulls<br>
>>> data from Vitrage, so it looks like Congress should only pull the<br>
>>> cause of the failure from Vitrage.<br>
>>><br>
>>> Best regards,<br>
>>> Masahito<br>
>>><br>
>>>> ·Congress can then call the Vitrage RCA API. The response will<br>
>> state<br>
>>>> that the cause of the instance alarm is the host alarm.<br>
>>>><br>
>>>> ·Congress policy can define that in such a case, the instance<br>
>> should<br>
>>>> be migrated to (or healed on) a different physical host<br>
>>>><br>
>>>> Does this seem like a good first step for you?<br>
>>>><br>
>>>> Thanks,<br>
>>>><br>
>>>> Alexey<br>
>>>><br>
>>>> *From:*Tim Hinrichs [mailto:<a href="mailto:tim@styra.com" target="_blank">tim@styra.com</a>]<br>
>>>> *Sent:* Saturday, May 07, 2016 2:43 AM<br>
>>>> *To:* OpenStack Development Mailing List (not for usage questions)<br>
>>>> *Subject:* Re: [openstack-dev] [vitrage] [congress] Vitrage-<br>
>> Congress<br>
>>>> Collaboration<br>
>>>><br>
>>>> Hi Alexey,<br>
>>>><br>
>>>> Thanks for the overview of how you see a Congress-Vitrage<br>
>>>> integration being valuable.<br>
>>>><br>
>>>> I'd imagine that the right first step in this integration would be<br>
>>>> creating a new datasource driver within Congress to pull data from<br>
>>>> Vitrage. It doesn't need to pull all the data in your list to<br>
>>>> start, but enough so that we can try writing policy over that data.<br>
>>>> It's helpful to have a policy in mind that you want to write and<br>
>>>> then set up the datasource driver to grab enough of the Vitrage<br>
>> data<br>
>>>> to write that policy. Here are the relevant docs.<br>
>>>><br>
>>>> Datasource drivers<br>
>>>><br>
>>>> <a href="http://docs.openstack.org/developer/congress/cloudservices.html" rel="noreferrer" target="_blank">http://docs.openstack.org/developer/congress/cloudservices.html</a><br>
>>>><br>
>>>> Writing policy<br>
>>>><br>
>>>> <a href="http://docs.openstack.org/developer/congress/policy.html" rel="noreferrer" target="_blank">http://docs.openstack.org/developer/congress/policy.html</a><br>
>>>><br>
>>>> Let me know if you have any questions,<br>
>>>><br>
>>>> Tim<br>
>>>><br>
>>>> On Wed, May 4, 2016 at 11:51 PM Weyl, Alexey (Nokia - IL)<br>
>>>> <<a href="mailto:alexey.weyl@nokia.com" target="_blank">alexey.weyl@nokia.com</a> <mailto:<a href="mailto:alexey.weyl@nokia.com" target="_blank">alexey.weyl@nokia.com</a>>> wrote:<br>
>>>><br>
>>>> Hi to all Vitrage and Congress contributors,<br>
>>>><br>
>>>> We had a good introduction meeting in Austin and we (Vitrage)<br>
>>> think<br>
>>>> that we can have a good collaboration between the projects.<br>
>>>><br>
>>>> Vitrage, as an Openstack Root Cause Analysis (RCA) Engine,<br>
>>>> builds<br>
>>> a<br>
>>>> topology graph of all the entities in the system (physical,<br>
>>> virtual<br>
>>>> and application) from different datasources. It thus can enrich<br>
>>>> Congress by providing more data about what is happening in the<br>
>>>> system. Additionally, the Vitrage RCA and deduce alarms &<br>
>> states<br>
>>>> mechanism can enhance the visibility of faults and how they<br>
>>>> inter-relate. By using this information Congress could then<br>
>>> execute<br>
>>>> different policies and perform more accurate actions.<br>
>>>><br>
>>>> Another good property of Vitrage is that it can receive data<br>
>> also<br>
>>>> from non-openstack sources, like Nagios, which monitor the<br>
>>> physical<br>
>>>> resources, including Switches (which are not modeled today in<br>
>>>> OpenStack).<br>
>>>><br>
>>>> There are many ways in which Congress-Vitrage combination would<br>
>>> be<br>
>>>> helpful. To take just one example:<br>
>>>> a. If a physical Switch is down, Vitrage can raise deduced<br>
>>>> alarms<br>
>>> on<br>
>>>> the connected hosts and on the virtual machines affected by<br>
>> this<br>
>>>> change in switch state.<br>
>>>> b. Congress will then be notified by Vitrage about these<br>
>> alarms,<br>
>>>> which can set off Congress policies of migration.<br>
>>>> c. Furthermore, due to the RCA functionality, Congress will be<br>
>>> aware<br>
>>>> that the Switch error is the source of the problem, and can<br>
>>>> determine the best place to create new instances of the VMs so<br>
>>> that<br>
>>>> this switch fault will not impact the new instances.<br>
>>>><br>
>>>> As you can see, for each fault, we can use Vitrage to link it<br>
>> to<br>
>>>> other faults, and create alarms to reflect them. This is all<br>
>> done<br>
>>>> via Vitrage Templates, so the system is configurable to the<br>
>>>> needs<br>
>>> of<br>
>>>> the user. Thus many more cases such as the example above could<br>
>> be<br>
>>>> thought of.<br>
>>>><br>
>>>> To summarize, Vitrage can enrich Congress with the following<br>
>> four<br>
>>>> features:<br>
>>>> a. RCA<br>
>>>> b. Deduced alarms<br>
>>>> c. Physical, virtual and application layers<br>
>>>> d. Graph structure and topology of the system that defines the<br>
>>>> connections and relationships between all entities on which we<br>
>>> can<br>
>>>> run quick graph algorithms to decide different actions to<br>
>>>> perform<br>
>>>><br>
>>>> If you can think of additional use cases that can be used here,<br>
>>>> please share ☺<br>
>>>><br>
>>>> For more data about Vitrage and its insights please take a look<br>
>>> here:<br>
>>>> <a href="https://wiki.openstack.org/wiki/Vitrage" rel="noreferrer" target="_blank">https://wiki.openstack.org/wiki/Vitrage</a><br>
>>>><br>
>>>> Best Regards,<br>
>>>> Alexey Weyl<br>
>>>><br>
>>>><br>
>>><br>
><br>
> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<br>
<br>
--<br>
室井 雅仁(Masahito MUROI)<br>
Software Innovation Center, NTT<br>
Tel: +81-422-59-4539<br>
<br>
<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div>