<div dir="ltr">Hi,<div><br></div><div>AFAIU the get_attr function does not use the values you've passed to Heat in the resource definition, instead it fetches their actual values from Neutron (basically making a 'port show' API call), and Heat does nothing wrt to ordering afterwards.</div><div><br></div><div>Btw AFAIR this is exactly why heat requires a separate network with single IPv4 subnet during tempest tests - the default network created by devstack at some point started to have both IPv4 and IPv6 subnets, and there's no way I know of to get specifically the IPv4 address using get_attr.</div><div><br></div><div>OTOH may be some newer Heat template features like map filters, conditionals and yaql expressions could possibly be utilized for that.. need to investigate :-)</div><div><br></div><div>Cheers,</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 3, 2018 at 6:10 PM, Volodymyr Litovka <span dir="ltr"><<a href="mailto:doka.ua@gmx.com" target="_blank">doka.ua@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi colleagues,<br>
<br>
I have the following HOT configuration of a port:<br>
<br>
  n1-wan:<br>
    type: OS::Neutron::Port<br>
    properties:<br>
      fixed_ips:<br>
        - { subnet: e-subnet1, ip_address: 51.x.x.x }<br>
        - { subnet: e-subnet2, ip_address: 25.x.x.x }<br>
<br>
when I try to extract these values in template using {get_attr}, then, regardless of fixed_ips' order in port definition (either "subnet1, subnet2" or "subnet2, subnet1"), the value of { get_attr: [n1-wan, fixed_ips] } always give the following result:<br>
<br>
output_value:<br>
   - ip_address: 25.x.x.x<br>
      subnet_id: ...<br>
   - ip_address: 51.x.x.x<br>
     subnet_id: ...<br>
<br>
and, thus, { get_attr: [n1-wan, fixed_ips, 1, ip_address ] } gives me 51.x.x.x value.<br>
<br>
So, the question is - how the list of fixed_ips is ordered? Is there way to know for sure index of entry I'm interested in?<br>
<br>
Thank you.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Volodymyr Litovka<br>
  "Vision without Execution is Hallucination." -- Thomas Edison<br>
<br>
<br>
______________________________<wbr>_________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Dr. Pavlo Shchelokovskyy<div>Senior Software Engineer</div><div>Mirantis Inc</div><div><a href="http://www.mirantis.com" target="_blank">www.mirantis.com</a></div></div></div></div></div>
</div>