<div dir="ltr"><br><div><div style="font-size:12.8px">I used  <span style="color:rgb(0,0,0);font-family:&#39;Arial Unicode MS&#39;,Arial,sans-serif;line-height:21.6667px;text-align:-webkit-center"><b>Version: 3.6.3.4-1.el7.centos</b> of ovirt engine.I already tried following xml request with run VM but still its not working.<br>From admin panel of oVirt Its completely working but I found issue only with oVirt API (VM start but cloudinit data not accepted).</span></div><div style="font-size:12.8px"><span style="color:rgb(0,0,0);font-family:&#39;Arial Unicode MS&#39;,Arial,sans-serif;line-height:21.6667px;text-align:-webkit-center"><br></span></div><div style="font-size:12.8px"><span style="color:rgb(0,0,0);font-family:&#39;Arial Unicode MS&#39;,Arial,sans-serif;line-height:21.6667px;text-align:-webkit-center"><b>XML Request : </b> </span></div><div style="font-size:12.8px"><span style="color:rgb(0,0,0);font-family:&#39;Arial Unicode MS&#39;,Arial,sans-serif;line-height:21.6667px;text-align:-webkit-center"><br></span></div><div style="font-size:12.8px"><span style="text-align:-webkit-center;line-height:21.6667px"><font color="#000000" face="Arial Unicode MS, Arial, sans-serif"><div style="text-align:left">&lt;action&gt;</div><div style="text-align:left">   &lt;async&gt;false&lt;/async&gt;</div><div style="text-align:left">  &lt;use_cloud_init&gt;true&lt;/use_cloud_init&gt;</div><div style="text-align:left">&lt;vm&gt;</div><div style="text-align:left">  &lt;initialization&gt;</div><div style="text-align:left">     &lt;cloud_init&gt;</div><div style="text-align:left">       &lt;host&gt;</div><div style="text-align:left">         &lt;address&gt;vishal.123456&lt;/address&gt;</div><div style="text-align:left">       &lt;/host&gt;</div><div style="text-align:left">       &lt;regenerate_ssh_keys&gt;true&lt;/regenerate_ssh_keys&gt;</div><div style="text-align:left">       &lt;timezone&gt;Atlantic/Reykjavik&lt;/timezone&gt;</div><div style="text-align:left">       &lt;users&gt;</div><div style="text-align:left">         &lt;user&gt;</div><div style="text-align:left">           &lt;user_name&gt;root&lt;/user_name&gt;</div><div style="text-align:left">           &lt;password&gt;Vishal@131&lt;/password&gt;</div><div style="text-align:left">         &lt;/user&gt;</div><div style="text-align:left">       &lt;/users&gt;</div><div style="text-align:left">       &lt;network_configuration&gt;</div><div style="text-align:left">         &lt;nics&gt;</div><div style="text-align:left">           &lt;nic&gt;</div><div style="text-align:left">             &lt;name&gt;eth1&lt;/name&gt;</div><div style="text-align:left">             &lt;boot_protocol&gt;STATIC&lt;/boot_protocol&gt;</div><div style="text-align:left">             &lt;network&gt;</div><div style="text-align:left">               &lt;ip address=&quot;51.254.56.84&quot; netmask=&quot;255.255.255.255&quot; gateway=&quot;149.202.85.254&quot; /&gt;</div><div style="text-align:left">             &lt;/network&gt;</div><div style="text-align:left">             &lt;on_boot&gt;false&lt;/on_boot&gt;</div><div style="text-align:left">           &lt;/nic&gt;</div><div style="text-align:left">           </div><div style="text-align:left">         &lt;/nics&gt;</div><div style="text-align:left">         &lt;dns&gt;</div><div style="text-align:left">           &lt;servers&gt;</div><div style="text-align:left">             &lt;host&gt;</div><div style="text-align:left">               &lt;address&gt;8.8.8.8&lt;/address&gt;</div><div style="text-align:left">             &lt;/host&gt;</div><div style="text-align:left">           &lt;/servers&gt;</div><div style="text-align:left">           &lt;search_domains&gt;</div><div style="text-align:left">             &lt;host&gt;</div><div style="text-align:left">               &lt;address&gt;8.8.4.4&lt;/address&gt;</div><div style="text-align:left">             &lt;/host&gt;</div><div style="text-align:left">           &lt;/search_domains&gt;</div><div style="text-align:left">         &lt;/dns&gt;</div><div style="text-align:left">       &lt;/network_configuration&gt;</div><div style="text-align:left">       </div><div style="text-align:left"><br></div><div style="text-align:left">     &lt;/cloud_init&gt;</div><div style="text-align:left">  &lt;/initialization&gt;</div><div style="text-align:left">&lt;/vm&gt;</div><div style="text-align:left">   </div><div style="text-align:left">&lt;/action&gt;</div></font></span></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="text-align:left"><font size="2">Regards,</font></div><div style="text-align:left"><font size="2"><b>Arpit Makhiyaviya</b></font></div><div><span style="font-size:12.8000001907349px">Software Engineer</span><br></div><div>+91-79-40038284</div><div>+91-971-437-6669</div><div><a href="http://www.sculptsoft.com" target="_blank"><img src="http://sculptsoft.com/images/logo3.png" width="96" height="24"></a><br></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Mar 30, 2016 at 12:27 AM, Juan Hernández <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">On 03/29/2016 03:07 PM, Arpit Makhiyaviya wrote:<br>
&gt; Thanks for quick response.<br>
&gt; we already knew this and we are passing following xml when calling Start<br>
&gt; action.<br>
&gt;<br>
<br>
What version of the engine are you using exactly? This is a known bug.<br>
The &quot;cloud_init&quot; element is ignored. See here for details:<br>
<br>
  Cloud-Init payload not passed into VM via python SDK<br>
  <a href="https://bugzilla.redhat.com/1305904" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/1305904</a><br>
<br>
That will be fixed in version 3.6.5. If you have a version 3.6.2 or<br>
newer then you can use the workaround described there, using the<br>
&quot;initailization&quot; element directly.<br>
<br>
&gt; &lt;action&gt;<br>
&gt; &lt;vm&gt;<br>
&gt;   &lt;initialization&gt;<br>
&gt;      &lt;cloud_init&gt;<br>
&gt;        &lt;host&gt;<br>
&gt;          &lt;address&gt;vm-cloud-init-restapi&lt;/address&gt;<br>
&gt;        &lt;/host&gt;<br>
&gt;        &lt;authorized_keys&gt;<br>
&gt;          &lt;authorized_key&gt;<br>
&gt;            &lt;user&gt;<br>
&gt;              &lt;user_name&gt;root&lt;/user_name&gt;<br>
&gt;            &lt;/user&gt;<br>
&gt;            &lt;key&gt;ssh-rsa restapi-cloud-init-ssh-key root@localdomain&lt;/key&gt;<br>
&gt;          &lt;/authorized_key&gt;<br>
&gt;        &lt;/authorized_keys&gt;<br>
&gt;        &lt;regenerate_ssh_keys&gt;true&lt;/regenerate_ssh_keys&gt;<br>
&gt;        &lt;timezone&gt;Atlantic/Reykjavik&lt;/timezone&gt;<br>
&gt;        &lt;users&gt;<br>
&gt;          &lt;user&gt;<br>
&gt;            &lt;user_name&gt;root&lt;/user_name&gt;<br>
&gt;            &lt;password&gt;SuperSecretPassword!&lt;/password&gt;<br>
&gt;          &lt;/user&gt;<br>
&gt;        &lt;/users&gt;<br>
&gt;        &lt;network_configuration&gt;<br>
&gt;          &lt;nics&gt;<br>
&gt;            &lt;nic&gt;<br>
&gt;              &lt;name&gt;eth0&lt;/name&gt;<br>
&gt;              &lt;boot_protocol&gt;STATIC&lt;/boot_protocol&gt;<br>
&gt;              &lt;network&gt;<br>
&gt;                &lt;ip address=&quot;192.168.2.11&quot; netmask=&quot;255.255.255.0&quot;<br>
&gt; gateway=&quot;192.168.2.254&quot; /&gt;<br>
&gt;              &lt;/network&gt;<br>
&gt;              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
&gt;            &lt;/nic&gt;<br>
&gt;            &lt;nic&gt;<br>
&gt;              &lt;name&gt;eth1&lt;/name&gt;<br>
&gt;              &lt;boot_protocol&gt;DHCP&lt;/boot_protocol&gt;<br>
&gt;              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
&gt;            &lt;/nic&gt;<br>
&gt;          &lt;/nics&gt;<br>
&gt;          &lt;dns&gt;<br>
&gt;            &lt;servers&gt;<br>
&gt;              &lt;host&gt;<br>
&gt;                &lt;address&gt;10.20.30.100&lt;/address&gt;<br>
&gt;              &lt;/host&gt;<br>
&gt;            &lt;/servers&gt;<br>
&gt;            &lt;search_domains&gt;<br>
&gt;              &lt;host&gt;<br>
&gt;                &lt;address&gt;<a href="http://domain.your.rhevm.com" rel="noreferrer" target="_blank">domain.your.rhevm.com</a><br>
&gt; &lt;<a href="http://domain.your.rhevm.com" rel="noreferrer" target="_blank">http://domain.your.rhevm.com</a>&gt;&lt;/address&gt;<br>
&gt;              &lt;/host&gt;<br>
&gt;            &lt;/search_domains&gt;<br>
&gt;          &lt;/dns&gt;<br>
&gt;        &lt;/network_configuration&gt;<br>
&gt;        &lt;files&gt;<br>
&gt;          &lt;file&gt;<br>
&gt;            &lt;name&gt;/tmp/file1.txt&lt;/name&gt;<br>
&gt;            &lt;content&gt;line 1<br>
&gt; line 2<br>
&gt; and now something special<br>
&gt; !@#$%^&amp;amp;*()_+&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; we also found following link . is this related to my issue?<br>
&gt;<br>
&gt; <a href="https://gerrit.ovirt.org/#/c/50240/2" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/50240/2</a><br>
&gt;<br>
&gt; Regards,<br>
&gt; *Arpit Makhiyaviya*<br>
&gt; Software Engineer<br>
&gt; +91-79-40038284<br>
&gt; +91-971-437-6669<br>
&gt; &lt;<a href="http://www.sculptsoft.com" rel="noreferrer" target="_blank">http://www.sculptsoft.com</a>&gt;<br>
&gt;<br>
&gt; On Tue, Mar 29, 2016 at 6:24 PM, Renout Gerrits &lt;<a href="mailto:mail@renout.nl">mail@renout.nl</a><br>
&gt; &lt;mailto:<a href="mailto:mail@renout.nl">mail@renout.nl</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     In the more recent versions you have to use &#39;use_cloud_init=True&#39; in<br>
&gt;     the api, which isn&#39;t described in most documentation yet. Maybe<br>
&gt;     thats the reason it isn&#39;t working?<br>
&gt;<br>
&gt;     Here&#39;s a working snippet:<br>
&gt;<br>
&gt;     vm = api.vms.get(name=vm_name)<br>
&gt;<br>
&gt;     action = params.Action(<br>
&gt;         use_cloud_init=True,<br>
&gt;         vm=params.VM(<br>
&gt;           initialization=params.Initialization(<br>
&gt;             regenerate_ssh_keys=True,<br>
&gt;             host_name=vm_fqdn,<br>
&gt;             nic_configurations=params.GuestNicsConfiguration(<br>
&gt;               nic_configuration=[<br>
&gt;                 params.GuestNicConfiguration(<br>
&gt;                   name=&quot;eth0&quot;,<br>
&gt;                   boot_protocol=&quot;static&quot;,<br>
&gt;                   on_boot=True,<br>
&gt;                   ip=params.IP(<br>
&gt;                     address=vm_address,<br>
&gt;                     netmask=vm_netmask,<br>
&gt;                     gateway=vm_gateway,<br>
&gt;                     ),<br>
&gt;                   ),<br>
&gt;                 ],<br>
&gt;               ),<br>
&gt;             ),<br>
&gt;           ),<br>
&gt;         )<br>
&gt;<br>
&gt;     vm.start(action)<br>
&gt;<br>
&gt;<br>
&gt;     On Tue, Mar 29, 2016 at 2:03 PM, Arpit Makhiyaviya<br>
&gt;     &lt;<a href="mailto:arpit.icreate@gmail.com">arpit.icreate@gmail.com</a> &lt;mailto:<a href="mailto:arpit.icreate@gmail.com">arpit.icreate@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         Hello,<br>
&gt;         we are using ovirt api with json data format.<br>
&gt;         we have create vm from template and i want to set<br>
&gt;         ip,macaddress,user and password for that we are using cloud_init<br>
&gt;         for that we it can&#39;t set any options.<br>
&gt;<br>
<span class="HOEnZb"><font color="#888888"><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>
</font></span></blockquote></div><br></div>