<div dir="ltr">Thank you for the response, Sean. But, I have already successfully implemented and deployed dynamic vendordata to an Openstack instance using these really good tutorials. So, my issue is not with Openstack but with cloud-init. Even though dynamic vendordata was implemented back in Openstack Pike, <a href="https://github.com/canonical/cloud-init/pull/777">cloud-init, however, was not handling dynamic vendordata</a> until very recently and they implemented it in Feb 2021! So, even though people were able to send dynamic vendordata to instances they were not able to execute any of that dynamic vendordata using cloud-init.<div><br></div><div>However, even this new implementation from cloud-init comes with issues. I am not able to execute any of the YAML files which I pass through dynamic vendordata. Static vendordata executes perfectly fine though! </div><div><br></div><div>Now coming to the issue, the <span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px">vendordata_dynamic_targets </span>flag in the <span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px">nova.conf </span>follows the syntax:</div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px">vendordata_dynamic_targets=</span><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px">name@<</span>URL> </div><div><br></div><div><b>So, what value should 'name' hold here?</b> Should it be the name you give to the REST service or should it be the name of the package that consumes the vendor_data2.json (cloud-init in this case)?</div><div><br></div><div>I am asking this because <a rel="nofollow" href="https://specs.openstack.org/openstack/nova-specs/specs/newton/implemented/vendordata-reboot.html" style="box-sizing:border-box;text-decoration-line:none;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px">https://specs.openstack.org/openstack/nova-specs/specs/newton/implemented/vendordata-reboot.html</a> mentions that you can multiple REST services to fetch multiple dynamic vendordata's. So, if we set the 'name' attribute to 'cloud-init' then how are we going to differentiate between different REST services, since Nova expects that the key should be unique and repeat key would be ignored (from the specs). For example:</div><div><br></div><div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">vendordata_</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">dynamic_</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">targets=</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">name1@</span><a rel="nofollow" href="http://example.com,name2@http//example2.com" target="_blank" style="color:rgb(0,51,170);text-decoration-line:none;font-family:monospace;font-size:12px">http://example.com,name2@http://example2.com</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">{<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">    "name1": {<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">       </span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px"> "cloud-</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">init": "#cloud-</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">config\</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">n..."<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">    },<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">    "name2": {<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">       </span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px"> "cloud-</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">init": "#cloud-</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">config\</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">n..."<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">    }<br></span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px">}</span></blockquote><div><br></div><div>So, essentially, which among the two options is correct?</div><div><br></div><div>1. in nova.conf: vendordata_dynamic_targets=cloud-init@localhost and my REST service responds with the value of "cloud-init" key to create the following vendor_data2.json</div><div> <span style="background-color:rgba(27,31,35,0.05);color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px">{"cloud-init": "#cloud-config\npackage_upgrade: True\npackages:\n - htop"}</span></div><div><br></div><div>or</div><div><br></div><div>2. in nova.conf: 

vendordata_dynamic_targets=testing@localhost and my REST service responds with the value of "testing" key.</div></div><div><span style="color:rgb(106,115,125);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;background-color:rgba(27,31,35,0.05)">{"testing": {"cloud-init": "#cloud-config\npackage_upgrade: True\npackages:\n - htop"}}</span><br></div><div><span style="color:rgb(106,115,125);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;background-color:rgba(27,31,35,0.05)"><br></span></div><div><span style="color:rgb(106,115,125);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;background-color:rgba(27,31,35,0.05)"><br></span></div><div><span style="color:rgb(106,115,125);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;background-color:rgba(27,31,35,0.05)"><br></span></div><div> I hope to get more eyes on this issue as it otherwise renders dynamic vendordata useless if cloud-init doesn't handle it properly. Thank you for your time!

</div><div><br></div><div><br></div><div><i><br></i></div><div><i>Manish Mahalwal</i></div><div><i>MathWorks</i></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 16 Apr 2021 at 20:00, Sean Mooney <<a href="mailto:smooney@redhat.com">smooney@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 15/04/2021 15:53, Manish Mahalwal wrote:<br>
> Hi All,<br>
><br>
> I am working with OpenStack Pike and cloud-init 21.1. I am able to <br>
> successfully pass dynamic vendor data to the config drive of an <br>
> instance. However, cloud-init 21.1 just reads all the 'x' bytes of the <br>
> vendor_data2.json but it doesn't execute the contents of the json. <br>
> Although, static vendor data works perfectly fine and the YAML file in <br>
> the JSON is executed as expected by cloud-init 21.1<br>
><br>
> * Now, the person who wrote the code for handling dynamic vendordata <br>
> in cloud-init (<a href="https://github.com/canonical/cloud-init/pull/777" rel="noreferrer" target="_blank">https://github.com/canonical/cloud-init/pull/777</a> <br>
> <<a href="https://github.com/canonical/cloud-init/pull/777" rel="noreferrer" target="_blank">https://github.com/canonical/cloud-init/pull/777</a>>) says that the JSON <br>
> cloud-init expects is of the form:<br>
><br>
>     {"cloud-init": "#cloud-config\npackage_upgrade: True\npackages:\n<br>
>     - black\nfqdn: <a href="http://cloud-overridden-by-vendordata2.example.org" rel="noreferrer" target="_blank">cloud-overridden-by-vendordata2.example.org</a>."}<br>
><br>
><br>
<br>
the reference implementation for the dynamic vendor data  backend was<br>
<a href="https://github.com/mikalstill/vendordata" rel="noreferrer" target="_blank">https://github.com/mikalstill/vendordata</a> and it was a feature developed <br>
specificaly for rackspace.<br>
<br>
the data format that service should return is<br>
<br>
# {<br>
<br>
# "hostname": "foo",<br>
<br>
# "image-id": "75a74383-f276-4774-8074-8c4e3ff2ca64",<br>
<br>
# "instance-id": "2ae914e9-f5ab-44ce-b2a2-dcf8373d899d",<br>
<br>
# "metadata": {},<br>
<br>
# "project-id": "039d104b7a5c4631b4ba6524d0b9e981",<br>
<br>
# "user-data": null<br>
<br>
# }<br>
# An example of this data:<br>
<br>
<br>
<br>
<a href="https://github.com/mikalstill/vendordata/blob/master/app.py#L34-L42" rel="noreferrer" target="_blank">https://github.com/mikalstill/vendordata/blob/master/app.py#L34-L42</a><br>
<br>
this blog post explains how it should work<br>
<a href="https://www.madebymikal.com/nova-vendordata-deployment-an-excessively-detailed-guide/" rel="noreferrer" target="_blank">https://www.madebymikal.com/nova-vendordata-deployment-an-excessively-detailed-guide/</a><br>
<br>
<br>
<br>
> * I believe that the JSON should have another outer key (as mentioned <br>
> here <br>
> <a href="https://specs.openstack.org/openstack/nova-specs/specs/newton/implemented/vendordata-reboot.html" rel="noreferrer" target="_blank">https://specs.openstack.org/openstack/nova-specs/specs/newton/implemented/vendordata-reboot.html</a> <br>
> <<a href="https://specs.openstack.org/openstack/nova-specs/specs/newton/implemented/vendordata-reboot.html" rel="noreferrer" target="_blank">https://specs.openstack.org/openstack/nova-specs/specs/newton/implemented/vendordata-reboot.html</a>>) <br>
> which is the name of the microservice specified in nova.conf file and <br>
> that the inner key should be cloud-init.<br>
><br>
> In nova.conf:<br>
> vendordata_dynamic_targets=name1@<a href="http://example.com" rel="noreferrer" target="_blank">http://example.com</a>,name2@<a href="http://example2.com" rel="noreferrer" target="_blank">http://example2.com</a> <br>
> <<a href="http://example.com" rel="noreferrer" target="_blank">http://example.com</a>,name2@http//<a href="http://example2.com" rel="noreferrer" target="_blank">example2.com</a>><br>
><br>
>     {<br>
>         "name1": {<br>
>      "cloud-init": "#cloud-config\n..."<br>
>         },<br>
>         "name2": {<br>
>      "cloud-init": "#cloud-config\n..."<br>
>         }<br>
>     }<br>
><br>
><br>
><br>
><br>
> >>Who is right and who is wrong?<br>
><br>
> To read more on this please go through the following: <br>
> <a href="https://bugs.launchpad.net/cloud-init/+bug/1841104" rel="noreferrer" target="_blank">https://bugs.launchpad.net/cloud-init/+bug/1841104</a> <br>
> <<a href="https://bugs.launchpad.net/cloud-init/+bug/1841104" rel="noreferrer" target="_blank">https://bugs.launchpad.net/cloud-init/+bug/1841104</a>><br>
><br>
<br>
</blockquote></div>