<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>try asking on <span id="spnR" _e_oncontextmenu="onRwCm(event);" _e_ondblclick="onDblClkReadRcp(event);" _e_onclick="onClkRcp(event);" class="rwRRO" _ao="3" _rf="0" _rt="SMTP" _em="openstack-discuss@lists.openstack.org" title="openstack-discuss@lists.openstack.org" _sa="openstack-discuss@lists.openstack.org" _siptrsp="1" _uri="openstack-discuss@lists.openstack.org" _dn="openstack-discuss@lists.openstack.org">
<img src="  " class="csimg csimgbg jb jbs sprites-unkwn-png" id="imgjb" _e_onclick="onRwCmJb(event);" _e_ondblclick="onDblClkJb(event);" title="Unknown">openstack-discuss@lists.openstack.org</span>
<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Kevin<br>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF646087" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>From:</b> hoanq13@viettel.com.vn [hoanq13@viettel.com.vn]<br>
<b>Sent:</b> Friday, March 22, 2019 4:19 AM<br>
<b>To:</b> openstack-dev@lists.openstack.org<br>
<b>Subject:</b> [vitrage] Problem when execute mistral with get_atrr() function<br>
</font><br>
</div>
<div></div>
<div>
<div style="font-family:times new roman,new york,times,serif; font-size:12pt; color:#000000">
<div>
<p style="background-color:#ffffff; margin:0px">I try doing use case with vitrage notification execute mistral but got a problem:</p>
<p style="background-color:#ffffff; margin:0px"><br>
</p>
<p style="background-color:#ffffff; margin:0px">In my use case, i try evacuate host with 2 instance "vm_1" and "vm_2" on it, when host have alarm -then evacuate instance:<br>
```</p>
<p style="background-color:#ffffff; margin:0px">condition: nova_compute_down_on_host and host_contain_instance<br>
actions:</p>
<p style="background-color:#ffffff; margin:0px">  - action:<br>
      action_type: execute_mistral<br>
      properties:<br>
         workflow: evacuate_vm<br>
         input:<br>
            vm_name: get_attr(instance, name)</p>
<p style="background-color:#ffffff; margin:0px">```</p>
<p style="background-color:#ffffff; margin:0px"><br>
</p>
<p style="background-color:#ffffff; margin:0px">I expect m<span style="font-size:12pt">istral workflow will then be: execute workflow 2 times with input:</span></p>
<p style="background-color:#ffffff; margin:0px">```vm_name: vm_1```  and  ```vm_name: vm_2``` </p>
<p style="background-color:#ffffff; margin:0px"><br>
</p>
<p style="background-color:#ffffff; margin:0px">But i alway get : mistral execute that workflow 2 times with input:</p>
<p style="background-color:#ffffff; margin:0px"><br>
</p>
<p style="background-color:#ffffff; margin:0px">```vm_name: vm_1```  and  ```vm_name: vm_1``` </p>
<div style="background-color:#ffffff"><br>
</div>
<div style="background-color:#ffffff">When i turn on debug log, to see the line "Function get_attr called with template_id..." follow<br>
"<a href="https://github.com/openstack/vitrage/blob/stable/queens/vitrage/evaluator/template_functions/v2/functions.py" style="color:#336699" target="_blank" rel="noopener noreferrer">https://github.com/openstack/vitrage/blob/stable/queens/vitrage/evaluator/template_functions/v2/functions.py</a>"<br>
I saw that line appear only one time!<br>
<br>
I don't know it is bug or not, can u help me? <br>
(my vitrage in queens version)<br>
<br>
Best regards.</div>
<div><br>
</div>
<p style="background-color:#ffffff; margin:0px"><br>
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>