<div dir="ltr"><div><div><div><div>Hi David,<br><br></div>the last line in params for server's user_data seems wrong. I really doubt you literally have template parameter named "OS::Nova::FloatingIP".<br></div>Instead you'd have to use get_attr on the OS::Nova::FloatingIP resource you presumably already created in the template somewhere (you are using it in the 'association' resource) like that [1]:<br><br></div>$FLOATING_IP: { get_attr: [floating_ip, ip ] }<br><br>[1] <a href="http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Nova::FloatingIP-attr-ip">http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Nova::FloatingIP-attr-ip</a><br><br></div>Cheers,<br><br></div><div class="gmail_extra"><br clear="all"><div><div class="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>
<br><div class="gmail_quote">On Mon, May 9, 2016 at 3:04 PM, Davíð Örn Jóhannsson <span dir="ltr"><<a href="mailto:davidoj@siminn.is" target="_blank">davidoj@siminn.is</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>I’m trying to access the floating ip assigned to an instance created with a heat template and write it to file during creation of the instance, my approach is not working and I’m wondering if anyone has any suggestions on how I could archive this.</div>
<div><br>
</div>
<div>    server:</div>
<div>        type: OS::Nova::Server</div>
<div>        properties:</div>
<div>            name: { get_param: server_name }</div>
<div>            image: { get_param: image }</div>
<div>            flavor: { get_param: flavor }</div>
<div>            key_name: { get_param: key_name }</div>
<div>            scheduler_hints:</div>
<div>                group: {get_param: server_group }</div>
<div>            admin_user: { get_param: admin_user }</div>
<div>            networks:</div>
<div>              - port: { get_resource: test_data_server_port }</div>
<div>            user_data_format: RAW</div>
<div>            user_data:</div>
<div>                str_replace:</div>
<div>                    template: |</div>
<div>                        #!/bin/bash -v</div>
<div>                        echo '127.0.0.1 $SERVER_NAME' >> /etc/hosts</div>
<div>                        echo $PROJECT_ID > /etc/project_id</div>
<div>                        echo $FLOATING_IP > /etc/floating_ip</div>
<div>                        </div>
<div>                    params:</div>
<div>                        $SERVER_NAME: { get_param: server_name }</div>
<div>                        $PROJECT_ID: { get_param: 'OS::project_id' }</div>
<div>                        $FLOATING_IP: { get_param: 'OS::Nova::FloatingIP' }</div>
<div><br>
</div>
<div>    test_data_server_port:</div>
<div>        type: OS::Neutron::Port</div>
<div>        properties:</div>
<div>            network_id: { get_param: private_net_id }</div>
<div>            security_groups: [{ get_param: test_security_group }, default]</div>
<div>            replacement_policy: AUTO</div>
<div>            </div>
<div>    association:</div>
<div>        type: OS::Nova::FloatingIPAssociation</div>
<div>        properties:</div>
<div>            floating_ip: { get_resource: floating_ip }</div>
<div>            server_id: { get_resource: test_server }</div>
</div>
<div>
<div></div>
</div>
</div>

<br>_______________________________________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org">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-bin/mailman/listinfo/openstack</a><br>
<br></blockquote></div><br></div>