<div dir="ltr">Hi Juan,<br><br>Yes, the above script is working fine.<br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><span>-- <br></span>Regards
<br>Shanil
</div></div>
<br><div class="gmail_quote">On Tue, Sep 16, 2014 at 7:49 PM, Juan Hernandez <span dir="ltr">&lt;<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 09/12/2014 07:04 AM, Shanil S wrote:<br>
&gt; Hi Juan,<br>
&gt;<br>
</span><div><div class="h5">&gt; I tried the following<br>
&gt;<br>
&gt; &lt;action&gt;<br>
&gt;   &lt;vm&gt;<br>
&gt;     &lt;initialization&gt;<br>
&gt;       &lt;cloud_init&gt;<br>
&gt;         ...<br>
&gt;        &lt;files&gt;<br>
&gt;           &lt;file&gt;<br>
&gt;             &lt;name&gt;ignored&lt;/name&gt;<br>
&gt;             &lt;content&gt;&lt;![CDATA[write_files:<br>
&gt;     -content: |<br>
&gt;         Some Content for my file<br>
&gt;     path: /tmp/myfile<br>
&gt;     permissions: &#39;0644&#39;]]&gt;&lt;/content&gt;<br>
&gt;             &lt;type&gt;plaintext&lt;/type&gt;<br>
&gt;           &lt;/file&gt;<br>
&gt;         &lt;/files&gt;<br>
&gt;       &lt;/cloud_init&gt;<br>
&gt;   &lt;custom_script&gt;&lt;![CDATA[<br>
&gt; write_files:<br>
&gt;     -content: |<br>
&gt;         Some Content for my file<br>
&gt;     path: /tmp/myfile<br>
&gt;     permissions: &#39;0644&#39;]]&lt;/custom_script&gt;<br>
&gt;<br>
&gt;<br>
&gt; But in that time i go the following errors from the api<br>
&gt; Request syntactically incorrect. See the link description below for the<br>
&gt; correct usage:start a virtual machine in the system identified by the<br>
&gt; given idPOST<br>
&gt; Content-Typeapplication/xml|json<br>
&gt;<br>
&gt;<br>
&gt; If i change the xml format like<br>
&gt;<br>
&gt; &lt;action&gt;<br>
&gt;   &lt;vm&gt;<br>
&gt;     &lt;initialization&gt;<br>
&gt;       &lt;cloud_init&gt;<br>
&gt;         ...<br>
&gt;        &lt;files&gt;<br>
&gt;           &lt;file&gt;<br>
&gt;             &lt;name&gt;ignored&lt;/name&gt;<br>
&gt;             &lt;content&gt;&lt;![CDATA[write_files:<br>
&gt;     -content: |<br>
&gt;         Some Content for my file<br>
&gt;     path: /tmp/myfile<br>
&gt;     permissions: &#39;0644&#39;]]&gt;&lt;/content&gt;<br>
&gt;             &lt;type&gt;plaintext&lt;/type&gt;<br>
&gt;           &lt;/file&gt;<br>
&gt;         &lt;/files&gt;<br>
&gt;       &lt;/cloud_init&gt;<br>
&gt;   &lt;custom_script&gt;<br>
&gt; write_files:<br>
&gt;     -content: |<br>
&gt;         Some Content for my file<br>
&gt;     path: /tmp/myfile<br>
&gt;     permissions: &#39;0644&#39;&lt;/custom_script&gt;<br>
&gt;<br>
&gt; the cloud init part won&#39;t work even though we didn&#39;t get any errors from<br>
&gt; the api. Could you please check it ?<br>
&gt;<br>
<br>
</div></div>The attached example script worked correctly for me. Be careful with the<br>
indentation of the &quot;write_files&quot; section, as it the format is YAML and<br>
it is sensitive to indentation.<br>
<br>
Also putting the file in /tmp may be bad idea, specially if you want it<br>
to persist after rebooting the machine.<br>
<span class="im HOEnZb"><br>
&gt;<br>
&gt; On Thu, Sep 11, 2014 at 6:16 PM, Juan Hernandez &lt;<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
</span><div class="HOEnZb"><div class="h5">&gt; &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 09/11/2014 12:51 PM, Shanil S wrote:<br>
&gt;     &gt; Hi Juan,<br>
&gt;     &gt;<br>
&gt;     &gt; Also, i tried the following custom script from the ovirt panel and its<br>
&gt;     &gt; working<br>
&gt;     &gt;<br>
&gt;     &gt; #cloud-config<br>
&gt;     &gt; write_files:<br>
&gt;     &gt;     -content: |<br>
&gt;     &gt;         # THIS IS MY TEXT FILE<br>
&gt;     &gt;         Some Content for my file<br>
&gt;     &gt;     path: /tmp/myfile<br>
&gt;     &gt;     permissions: &#39;0644&#39;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; but the same content script i tried from the ovir api call  like<br>
&gt;     &gt;<br>
&gt;     &gt; &lt;custom_script&gt;#cloud-config<br>
&gt;     &gt; write_files:<br>
&gt;     &gt;     -content: |<br>
&gt;     &gt;         # THIS IS MY TEXT FILE<br>
&gt;     &gt;         Some Content for my file<br>
&gt;     &gt;     path: /tmp/myfile<br>
&gt;     &gt;     permissions: &#39;0644&#39; &lt;/custom_script&gt;<br>
&gt;     &gt;    &lt;/initialization&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; But its not working, may be this is a bug in the  ovirt api function call ?<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     Currently the &quot;custom_script&quot; element doesn&#39;t work in combination with<br>
&gt;     &quot;cloud-init&quot;. To make it work you will have to use the &quot;files&quot; element:<br>
&gt;<br>
&gt;     &lt;action&gt;<br>
&gt;       &lt;vm&gt;<br>
&gt;         &lt;initialization&gt;<br>
&gt;           &lt;cloud_init&gt;<br>
&gt;             ...<br>
&gt;             &lt;files&gt;<br>
&gt;               &lt;file&gt;<br>
&gt;                 &lt;name&gt;this is ignored&lt;/name&gt;<br>
&gt;                 &lt;content&gt;&lt;![CDATA[your script]]&gt;&lt;/content&gt;<br>
&gt;                 &lt;type&gt;plaintext&lt;/type&gt;<br>
&gt;               &lt;/file&gt;<br>
&gt;             &lt;/files&gt;<br>
&gt;           &lt;/cloud_init&gt;<br>
&gt;         &lt;/initialization&gt;<br>
&gt;       &lt;/vm&gt;<br>
&gt;     &lt;/action&gt;<br>
&gt;<br>
&gt;     As I wrote before there is a bug related to this:<br>
&gt;<br>
&gt;     <a href="https://bugzilla.redhat.com/1138564" target="_blank">https://bugzilla.redhat.com/1138564</a><br>
&gt;<br>
&gt;     If that bug is fixed (unlikely according to the last comments) then the<br>
&gt;     &quot;custom_script&quot; element will start working, but for know I suggest you<br>
&gt;     include your custom script in both places:<br>
&gt;<br>
&gt;     &lt;action&gt;<br>
&gt;       &lt;vm&gt;<br>
&gt;         &lt;initialization&gt;<br>
&gt;           &lt;cloud_init&gt;<br>
&gt;             ...<br>
&gt;             &lt;files&gt;<br>
&gt;               &lt;file&gt;<br>
&gt;                 &lt;name&gt;this is ignored&lt;/name&gt;<br>
&gt;                 &lt;content&gt;&lt;![CDATA[your script]]&gt;&lt;/content&gt;<br>
&gt;                 &lt;type&gt;plaintext&lt;/type&gt;<br>
&gt;               &lt;/file&gt;<br>
&gt;             &lt;/files&gt;<br>
&gt;           &lt;/cloud_init&gt;<br>
&gt;           &lt;custom_script&gt;&lt;![CDATA[your script]]&gt;&lt;/custom_script&gt;<br>
&gt;         &lt;/initialization&gt;<br>
&gt;       &lt;/vm&gt;<br>
&gt;     &lt;/action&gt;<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; --<br>
&gt;     &gt; Regards<br>
&gt;     &gt; Shanil<br>
&gt;     &gt;<br>
&gt;     &gt; On Thu, Sep 11, 2014 at 3:36 PM, Shanil S &lt;<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a> &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;<br>
</div></div><span class="im HOEnZb">&gt;     &gt; &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a> &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     Hi Juan,<br>
&gt;     &gt;<br>
</span><div class="HOEnZb"><div class="h5">&gt;     &gt;     Okay sure..<br>
&gt;     &gt;     The following xml i used<br>
&gt;     &gt;<br>
&gt;     &gt;     &lt;action&gt;<br>
&gt;     &gt;             &lt;vm&gt;<br>
&gt;     &gt;                 &lt;os&gt;<br>
&gt;     &gt;                     &lt;boot dev=&#39;cdrom&#39;/&gt;<br>
&gt;     &gt;                 &lt;/os&gt;<br>
&gt;     &gt;                 &lt;initialization&gt;<br>
&gt;     &gt;          &lt;cloud_init&gt;<br>
&gt;     &gt;          &lt;host&gt;<br>
&gt;     &gt;              &lt;address&gt;test2&lt;/address&gt;<br>
&gt;     &gt;            &lt;/host&gt;<br>
&gt;     &gt;<br>
&gt;     &gt;           &lt;users&gt;<br>
&gt;     &gt;              &lt;user&gt;<br>
&gt;     &gt;                &lt;user_name&gt;root&lt;/user_name&gt;<br>
&gt;     &gt;                &lt;password&gt;test&lt;/password&gt;<br>
&gt;     &gt;              &lt;/user&gt;<br>
&gt;     &gt;            &lt;/users&gt;<br>
&gt;     &gt;           &lt;network_configuration&gt;<br>
&gt;     &gt;           &lt;nics&gt;<br>
&gt;     &gt;<br>
&gt;     &gt;                &lt;nic&gt;<br>
&gt;     &gt;                     &lt;interface&gt;virtio&lt;/interface&gt;<br>
&gt;     &gt;                  &lt;name&gt;eth0&lt;/name&gt;<br>
&gt;     &gt;                  &lt;boot_protocol&gt;none&lt;/boot_protocol&gt;<br>
&gt;     &gt;                  &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
&gt;     &gt;                &lt;/nic&gt;<br>
&gt;     &gt;              &lt;/nics&gt;<br>
&gt;     &gt;              &lt;dns&gt;<br>
&gt;     &gt;                &lt;servers&gt;<br>
&gt;     &gt;                  &lt;host&gt;<br>
&gt;     &gt;                    &lt;address&gt;x.x.x.x&lt;/address&gt;<br>
&gt;     &gt;                  &lt;/host&gt;<br>
&gt;     &gt;                &lt;/servers&gt;<br>
&gt;     &gt;              &lt;/dns&gt;<br>
&gt;     &gt;            &lt;/network_configuration&gt;<br>
&gt;     &gt;          &lt;/cloud_init&gt;<br>
&gt;     &gt;         &lt;custom_script&gt; #cloud-config<br>
&gt;     &gt;<br>
&gt;     &gt;     phone_home:<br>
&gt;     &gt;     url: <a href="http://x.x.com/api/xx/api_receive.php" target="_blank">http://x.x.com/api/xx/api_receive.php</a><br>
&gt;     &gt;<br>
&gt;     &gt;     &lt;/custom_script&gt;<br>
&gt;     &gt;        &lt;/initialization&gt;<br>
&gt;     &gt;             &lt;/vm&gt;<br>
&gt;     &gt;         &lt;/action&gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     --<br>
&gt;     &gt;     Regards<br>
&gt;     &gt;     Shanil<br>
&gt;     &gt;<br>
&gt;     &gt;     On Thu, Sep 11, 2014 at 1:48 PM, Juan Hernandez<br>
&gt;     &lt;<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt;     &gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;         On 09/11/2014 06:54 AM, Shanil S wrote:<br>
&gt;     &gt;         &gt; Hi Juan,<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; It seems the it doesn&#39;t contains the &quot;phone_home &quot;<br>
&gt;     section in<br>
&gt;     &gt;         the  cat<br>
&gt;     &gt;         &gt; /mnt/openstack/latest/user_data<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; the following is the output<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; #cloud-config<br>
&gt;     &gt;         &gt; ssh_pwauth: true<br>
&gt;     &gt;         &gt; disable_root: 0<br>
&gt;     &gt;         &gt; output:<br>
&gt;     &gt;         &gt;   all: &#39;&gt;&gt; /var/log/cloud-init-output.log&#39;<br>
&gt;     &gt;         &gt; user: root<br>
&gt;     &gt;         &gt; password: admin123<br>
&gt;     &gt;         &gt; chpasswd:<br>
&gt;     &gt;         &gt;   expire: false<br>
&gt;     &gt;         &gt; runcmd:<br>
&gt;     &gt;         &gt; - &#39;sed -i &#39;&#39;/^datasource_list: /d&#39;&#39;<br>
&gt;     /etc/cloud/cloud.cfg; echo<br>
&gt;     &gt;         &gt; &#39;&#39;datasource_list:<br>
&gt;     &gt;         &gt;   [&quot;NoCloud&quot;, &quot;ConfigDrive&quot;]&#39;&#39; &gt;&gt; /etc/cloud/cloud.cfg&#39;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; but if i try with the<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; &lt;files&gt;<br>
&gt;     &gt;         &gt;           &lt;file&gt;<br>
&gt;     &gt;         &gt;             &lt;name&gt;ignored&lt;/name&gt;<br>
&gt;     &gt;         &gt;             &lt;content&gt;&lt;![CDATA[runcmd:<br>
&gt;     &gt;         &gt;  - echo &#39;Test script !&#39; &gt; /iwashere_test.txt<br>
&gt;     &gt;         &gt; ]]&gt;&lt;/content&gt;<br>
&gt;     &gt;         &gt;             &lt;type&gt;plaintext&lt;/type&gt;<br>
&gt;     &gt;         &gt;           &lt;/file&gt;<br>
&gt;     &gt;         &gt;         &lt;/files&gt;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; then it will create the /iwashere_test.txt and write the<br>
&gt;     &gt;         contents and in<br>
&gt;     &gt;         &gt; that time the cat /mnt/openstack/latest/user_data is<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; cat /mnt/openstack/latest/user_data<br>
&gt;     &gt;         &gt; #cloud-config<br>
&gt;     &gt;         &gt; ssh_pwauth: true<br>
&gt;     &gt;         &gt; disable_root: 0<br>
&gt;     &gt;         &gt; output:<br>
&gt;     &gt;         &gt;   all: &#39;&gt;&gt; /var/log/cloud-init-output.log&#39;<br>
&gt;     &gt;         &gt; user: root<br>
&gt;     &gt;         &gt; password: admin123<br>
&gt;     &gt;         &gt; chpasswd:<br>
&gt;     &gt;         &gt;   expire: false<br>
&gt;     &gt;         &gt; runcmd:<br>
&gt;     &gt;         &gt; - &#39;sed -i &#39;&#39;/^datasource_list: /d&#39;&#39;<br>
&gt;     /etc/cloud/cloud.cfg; echo<br>
&gt;     &gt;         &gt; &#39;&#39;datasource_list:<br>
&gt;     &gt;         &gt;   [&quot;NoCloud&quot;, &quot;ConfigDrive&quot;]&#39;&#39; &gt;&gt; /etc/cloud/cloud.cfg&#39;<br>
&gt;     &gt;         &gt; runcmd:<br>
&gt;     &gt;         &gt;  - echo &#39;Test script !&#39; &gt; /iwashere_test.txt<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt; so, i think the custom script section is not working, i am<br>
&gt;     &gt;         attaching the<br>
&gt;     &gt;         &gt; vm log as a screenshot.<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;         Can you share the XML document that you sent to the RESTAPI in<br>
&gt;     &gt;         order to<br>
&gt;     &gt;         populate the &quot;phone_home&quot; section?<br>
&gt;     &gt;<br>
&gt;     &gt;         &gt; On Wed, Sep 10, 2014 at 2:07 PM, Juan Hernandez<br>
&gt;     &lt;<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
</div></div><span class="im HOEnZb">&gt;     &gt;         &gt; &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;         &gt;<br>
</span><div class="HOEnZb"><div class="h5">&gt;     &gt;         &gt;     On 09/10/2014 06:44 AM, Shanil S wrote:<br>
&gt;     &gt;         &gt;     &gt; Hi Juan,<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt; What i am planning to do is to make work the following<br>
&gt;     &gt;         script<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt; #cloud-config<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt; # phone_home: if this dictionary is present, then the<br>
&gt;     &gt;         phone_home<br>
&gt;     &gt;         &gt;     &gt; # cloud-config module will post specified data back to<br>
&gt;     &gt;         the given<br>
&gt;     &gt;         &gt;     &gt; # url<br>
&gt;     &gt;         &gt;     &gt; # default: none<br>
&gt;     &gt;         &gt;     &gt; # phone_home:<br>
&gt;     &gt;         &gt;     &gt; #  url: <a href="http://my.foo.bar/$INSTANCE/" target="_blank">http://my.foo.bar/$INSTANCE/</a><br>
&gt;     &gt;         &gt;     &gt; #  post: all<br>
&gt;     &gt;         &gt;     &gt; #  tries: 10<br>
&gt;     &gt;         &gt;     &gt; #<br>
&gt;     &gt;         &gt;     &gt; phone_home:<br>
&gt;     &gt;         &gt;     &gt;  url: <a href="http://my.example.com/$INSTANCE_ID/" target="_blank">http://my.example.com/$INSTANCE_ID/</a><br>
&gt;     &gt;         &gt;     &gt;  post: [ pub_key_dsa, pub_key_rsa, pub_key_ecdsa,<br>
&gt;     &gt;         instance_id ]<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;<br>
&gt;      (<a href="http://cloudinit.readthedocs.org/en/latest/topics/examples.html#run-commands-on-first-boot" target="_blank">http://cloudinit.readthedocs.org/en/latest/topics/examples.html#run-commands-on-first-boot</a>)<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt; but it wasn&#39;t working when i tried, i hope to post the<br>
&gt;     &gt;         above values to<br>
&gt;     &gt;         &gt;     &gt; the specific url and get the posted details.<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     I think it should work, but it depends completely on<br>
&gt;     &gt;         cloud-init itself.<br>
&gt;     &gt;         &gt;     I&#39;d suggest you check the content of the generated<br>
&gt;     cloud-init<br>
&gt;     &gt;         &gt;     configuration file (as described in a previous mail). If<br>
&gt;     &gt;         it contains the<br>
&gt;     &gt;         &gt;     &quot;phone_home&quot; section then you can discard a problem with<br>
&gt;     &gt;         oVirt, and<br>
&gt;     &gt;         &gt;     focus on clud-init.<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt; On Wed, Sep 10, 2014 at 10:02 AM, Shanil S<br>
&gt;     &gt;         &lt;<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a> &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a> &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt; &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;&gt;&gt;<br>
&gt;     &gt;         &gt;     &gt; &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt; &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a> &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;     Hi Juan,<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;     Okay.. Thanks.. its working.<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;     I would like to execute other page something<br>
&gt;     like test_script.php by<br>
&gt;     &gt;         &gt;     &gt;     posting some values to it using the cloud<br>
&gt;     init, Is it possible to do<br>
&gt;     &gt;         &gt;     &gt;     it ?<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;     --<br>
&gt;     &gt;         &gt;     &gt;     Regards<br>
&gt;     &gt;         &gt;     &gt;     Shanil<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;     On Fri, Sep 5, 2014 at 10:08 PM, Juan<br>
&gt;     Hernandez &lt;<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt;     &gt;         &gt;     &gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         On 09/05/2014 12:55 PM, Shanil S wrote:<br>
&gt;     &gt;         &gt;     &gt;         &gt; Hi Juan,<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt; Thanks for your reply.<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt; I tried with the above but i was unable to<br>
&gt;     &gt;         find the<br>
&gt;     &gt;         &gt;     &#39;iwashere.txt&#39; after<br>
&gt;     &gt;         &gt;     &gt;         &gt; executing the above xml.<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         I repeated the test, this time with 3.4,<br>
&gt;     and it<br>
&gt;     &gt;         worked<br>
&gt;     &gt;         &gt;     fine for<br>
&gt;     &gt;         &gt;     &gt;         me. As<br>
&gt;     &gt;         &gt;     &gt;         the formatting of the XML is very<br>
&gt;     important I&#39;d<br>
&gt;     &gt;         suggest<br>
&gt;     &gt;         &gt;     that you<br>
&gt;     &gt;         &gt;     &gt;         take<br>
&gt;     &gt;         &gt;     &gt;         the attached script (instead of copy &amp; paste<br>
&gt;     &gt;         from the mail),<br>
&gt;     &gt;         &gt;     &gt;         change the<br>
&gt;     &gt;         &gt;     &gt;         password and VM id and run it.<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         There are two kind of things that can go wrong<br>
&gt;     &gt;         here. One<br>
&gt;     &gt;         &gt;     is that the<br>
&gt;     &gt;         &gt;     &gt;         engine/VDSM combination may not be generating<br>
&gt;     &gt;         the right<br>
&gt;     &gt;         &gt;     file. To<br>
&gt;     &gt;         &gt;     &gt;         verify<br>
&gt;     &gt;         &gt;     &gt;         this start the VM with the attached<br>
&gt;     script, and<br>
&gt;     &gt;         once it is<br>
&gt;     &gt;         &gt;     &gt;         started go to<br>
&gt;     &gt;         &gt;     &gt;         the hypervisor where it is running and<br>
&gt;     find the<br>
&gt;     &gt;         corresponding<br>
&gt;     &gt;         &gt;     &gt;         qemu process:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;           # ps -ef | grep -- &#39;-name myvm&#39;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         This will give you a very long command line.<br>
&gt;     &gt;         That command line<br>
&gt;     &gt;         &gt;     &gt;         should<br>
&gt;     &gt;         &gt;     &gt;         include a &quot;-drive&quot; option containing the full<br>
&gt;     &gt;         path of the<br>
&gt;     &gt;         &gt;     disk image<br>
&gt;     &gt;         &gt;     &gt;         generated by the engine/VDSM, something<br>
&gt;     like this:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;           -drive<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;<br>
&gt;      file=/var/run/vdsm/payload/b5f087d4-022d-4d5f-8a1e-268c562c7bb1.b6fcddff571bb8c2028c61b623d172a6.img<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         To inspect its content make a copy (just in<br>
&gt;     &gt;         case) and<br>
&gt;     &gt;         &gt;     mount it:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;           # cp -drive<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;<br>
&gt;      file=/var/run/vdsm/payload/b5f087d4-022d-4d5f-8a1e-268c562c7bb1.b6fcddff571bb8c2028c61b623d172a6.img<br>
&gt;     &gt;         &gt;     &gt;         /root/my.img<br>
&gt;     &gt;         &gt;     &gt;           # mount -o loop,ro /root/my.img /mnt<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         Inspect the content:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;           # find /mnt<br>
&gt;     &gt;         &gt;     &gt;           /mnt/openstack<br>
&gt;     &gt;         &gt;     &gt;           /mnt/openstack/content<br>
&gt;     &gt;         &gt;     &gt;           /mnt/openstack/content/0000<br>
&gt;     &gt;         &gt;     &gt;           /mnt/openstack/latest<br>
&gt;     &gt;         &gt;     &gt;           /mnt/openstack/latest/meta_data.json<br>
&gt;     &gt;         &gt;     &gt;           /mnt/openstack/latest/user_data<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         The content of the custom-script should be at<br>
&gt;     &gt;         the end of the<br>
&gt;     &gt;         &gt;     &gt;         &quot;user_data&quot;<br>
&gt;     &gt;         &gt;     &gt;         file, so take a look at that:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;           # cat /mnt/openstack/latest/user_data<br>
&gt;     &gt;         &gt;     &gt;           #cloud-config<br>
&gt;     &gt;         &gt;     &gt;           ssh_pwauth: true<br>
&gt;     &gt;         &gt;     &gt;           disable_root: 0<br>
&gt;     &gt;         &gt;     &gt;           output:<br>
&gt;     &gt;         &gt;     &gt;             all: &#39;&gt;&gt; /var/log/cloud-init-output.log&#39;<br>
&gt;     &gt;         &gt;     &gt;           user: root<br>
&gt;     &gt;         &gt;     &gt;           password: mypassword<br>
&gt;     &gt;         &gt;     &gt;           chpasswd:<br>
&gt;     &gt;         &gt;     &gt;             expire: false<br>
&gt;     &gt;         &gt;     &gt;           runcmd:<br>
&gt;     &gt;         &gt;     &gt;           - &#39;sed -i &#39;&#39;/^datasource_list: /d&#39;&#39;<br>
&gt;     &gt;         &gt;     /etc/cloud/cloud.cfg; echo<br>
&gt;     &gt;         &gt;     &gt;         &#39;&#39;datasource_list:<br>
&gt;     &gt;         &gt;     &gt;             [&quot;NoCloud&quot;, &quot;ConfigDrive&quot;]&#39;&#39; &gt;&gt;<br>
&gt;     &gt;         /etc/cloud/cloud.cfg&#39;<br>
&gt;     &gt;         &gt;     &gt;           runcmd:<br>
&gt;     &gt;         &gt;     &gt;            - echo &quot;I was here!&quot; &gt; /iwashere.txt<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         If your custom script isn&#39;t there then<br>
&gt;     there is some<br>
&gt;     &gt;         &gt;     problem in the<br>
&gt;     &gt;         &gt;     &gt;         engine/VDSM side, otherwise the problem is<br>
&gt;     &gt;         probably in<br>
&gt;     &gt;         &gt;     cloud-init<br>
&gt;     &gt;         &gt;     &gt;         itself, and we will need someone with more<br>
&gt;     &gt;         knowledge of<br>
&gt;     &gt;         &gt;     &gt;         cloud-init to<br>
&gt;     &gt;         &gt;     &gt;         debug it.<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         Don&#39;t forget to umount the file when finished:<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;           # umount /mnt<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt; On Fri, Sep 5, 2014 at 3:00 PM, Juan<br>
&gt;     Hernandez<br>
&gt;     &gt;         &gt;     &lt;<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;<br>
&gt;     &gt;         &gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt; &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;&gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt; &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;<br>
&gt;     &gt;         &gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt; &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;<br>
&gt;     &gt;         &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     On 09/05/2014 10:46 AM, Sven Kieske<br>
&gt;     wrote:<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; Am 05.09.2014 10:27, schrieb Juan<br>
&gt;     Hernandez:<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt; Trying to make an example for this I<br>
&gt;     &gt;         discovered that<br>
&gt;     &gt;         &gt;     &gt;         the &quot;custom_script&quot;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt; element is currently ignored if the<br>
&gt;     &gt;         &quot;cloud_init&quot;<br>
&gt;     &gt;         &gt;     &gt;         element is present.<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt; Instead we are taking the content of<br>
&gt;     &gt;         the first &quot;file&quot;<br>
&gt;     &gt;         &gt;     &gt;         element from the<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt; &quot;cloud_init&quot; element and appending it<br>
&gt;     &gt;         to the<br>
&gt;     &gt;         &gt;     cloud-init<br>
&gt;     &gt;         &gt;     &gt;         configuration<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt; file. I believe that this is a<br>
&gt;     bug, as<br>
&gt;     &gt;         it breaks<br>
&gt;     &gt;         &gt;     &gt;         backwards compatibility:<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt;   <a href="https://bugzilla.redhat.com/1138564" target="_blank">https://bugzilla.redhat.com/1138564</a><br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; Thanks for the report, I just proposed<br>
&gt;     &gt;         this as a<br>
&gt;     &gt;         &gt;     blocker<br>
&gt;     &gt;         &gt;     &gt;         for the 3.4.4<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; release as it is a clear regression.<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; Also I rely on this functionality<br>
&gt;     in my<br>
&gt;     &gt;         3.3. setup<br>
&gt;     &gt;         &gt;     and I<br>
&gt;     &gt;         &gt;     &gt;         want to upgrade<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; to 3.4 so I can&#39;t upgrade until<br>
&gt;     this is<br>
&gt;     &gt;         fixed and<br>
&gt;     &gt;         &gt;     released.<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     Agree, I set the bug as a blocker<br>
&gt;     for 3.4.4.<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;&gt; However, you can exploit this bug<br>
&gt;     to do<br>
&gt;     &gt;         what you<br>
&gt;     &gt;         &gt;     want.<br>
&gt;     &gt;         &gt;     &gt;         This is an example:<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; Well I guess this is a pretty bad<br>
&gt;     idea,<br>
&gt;     &gt;         because it<br>
&gt;     &gt;         &gt;     will<br>
&gt;     &gt;         &gt;     &gt;         just work<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt; until the bug is fixed?<br>
&gt;     &gt;         &gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;         &gt;     No, what I proposed in the example is to<br>
&gt;     &gt;         put the custom<br>
&gt;     &gt;         &gt;     &gt;         script in both<br>
&gt;     &gt;         &gt;     &gt;         &gt;     the first &quot;file&quot; inside &quot;clud_init&quot;<br>
&gt;     and in the<br>
&gt;     &gt;         &gt;     &gt;         &quot;custom_script&quot; element.<br>
&gt;     &gt;         &gt;     &gt;         &gt;     That should work with the current status<br>
&gt;     &gt;         and also<br>
&gt;     &gt;         &gt;     if/when<br>
&gt;     &gt;         &gt;     &gt;         we fix the<br>
&gt;     &gt;         &gt;     &gt;         &gt;     bug.<br>
&gt;     &gt;         &gt;     &gt;         &gt;<br>
&gt;     &gt;         &gt;     &gt;<br>
&gt;     &gt;         &gt;<br>
&gt;     &gt;<br>
&gt;<br>
<br>
--<br>
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta<br>
3ºD, 28016 Madrid, Spain<br>
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.<br>
</div></div></blockquote></div><br></div>