<div dir="ltr">Thanks, that's works for me .<div class="gmail_extra"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><br>On Wed, Mar 30, 2016 at 2:21 PM, Juan Hernández <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br></div></div></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03/30/2016 08:44 AM, Arpit Makhiyaviya wrote:<br>
><br>
> I used *Version: 3.6.3.4-1.el7.centos* of ovirt engine.I already tried<br>
> 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<br>
> with oVirt API (VM start but cloudinit data not accepted).<br>
><br>
<br>
Version 3.6.3.4 is affected by the bug that I mentioned. The result is<br>
that the "cloud_init" element is just ignored. That will be fixed in<br>
version 3.6.5. Meanwhile you can use the workaround suggested in comment<br>
1 of the bug:<br>
<br>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1305904#c1" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1305904#c1</a><br>
<br>
Translated to XML it should look like described by Karim Boumedhel in<br>
comment 7:<br>
<br>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1305904#c7" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=1305904#c7</a><br>
<br>
> *XML Request : *<br>
><br>
> <action><br>
> <async>false</async><br>
> <use_cloud_init>true</use_cloud_init><br>
> <vm><br>
> <initialization><br>
> <cloud_init><br>
> <host><br>
> <address>vishal.123456</address><br>
> </host><br>
> <regenerate_ssh_keys>true</regenerate_ssh_keys><br>
> <timezone>Atlantic/Reykjavik</timezone><br>
> <users><br>
> <user><br>
> <user_name>root</user_name><br>
> <password>Vishal@131</password><br>
> </user><br>
> </users><br>
> <network_configuration><br>
> <nics><br>
> <nic><br>
> <name>eth1</name><br>
> <boot_protocol>STATIC</boot_protocol><br>
> <network><br>
> <ip address="51.254.56.84" netmask="255.255.255.255"<br>
> gateway="149.202.85.254" /><br>
> </network><br>
> <on_boot>false</on_boot><br>
> </nic><br>
><br>
> </nics><br>
> <dns><br>
> <servers><br>
> <host><br>
> <address>8.8.8.8</address><br>
> </host><br>
> </servers><br>
> <search_domains><br>
> <host><br>
> <address>8.8.4.4</address><br>
> </host><br>
> </search_domains><br>
> </dns><br>
> </network_configuration><br>
><br>
><br>
> </cloud_init><br>
> </initialization><br>
> </vm><br>
><br>
> </action><br>
><br>
> Regards,<br>
> *Arpit Makhiyaviya*<br>
> Software Engineer<br>
> +91-79-40038284<br>
> +91-971-437-6669<br>
> <<a href="http://www.sculptsoft.com" rel="noreferrer" target="_blank">http://www.sculptsoft.com</a>><br>
><br>
> On Wed, Mar 30, 2016 at 12:27 AM, Juan Hernández <<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
> <mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>>> wrote:<br>
><br>
> On 03/29/2016 03:07 PM, Arpit Makhiyaviya wrote:<br>
> > Thanks for quick response.<br>
> > we already knew this and we are passing following xml when calling<br>
> Start<br>
> > action.<br>
> ><br>
><br>
> What version of the engine are you using exactly? This is a known bug.<br>
> The "cloud_init" 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>
> "initailization" element directly.<br>
><br>
> > <action><br>
> > <vm><br>
> > <initialization><br>
> > <cloud_init><br>
> > <host><br>
> > <address>vm-cloud-init-restapi</address><br>
> > </host><br>
> > <authorized_keys><br>
> > <authorized_key><br>
> > <user><br>
> > <user_name>root</user_name><br>
> > </user><br>
> > <key>ssh-rsa restapi-cloud-init-ssh-key<br>
> root@localdomain</key><br>
> > </authorized_key><br>
> > </authorized_keys><br>
> > <regenerate_ssh_keys>true</regenerate_ssh_keys><br>
> > <timezone>Atlantic/Reykjavik</timezone><br>
> > <users><br>
> > <user><br>
> > <user_name>root</user_name><br>
> > <password>SuperSecretPassword!</password><br>
> > </user><br>
> > </users><br>
> > <network_configuration><br>
> > <nics><br>
> > <nic><br>
> > <name>eth0</name><br>
> > <boot_protocol>STATIC</boot_protocol><br>
> > <network><br>
> > <ip address="192.168.2.11" netmask="255.255.255.0"<br>
> > gateway="192.168.2.254" /><br>
> > </network><br>
> > <on_boot>true</on_boot><br>
> > </nic><br>
> > <nic><br>
> > <name>eth1</name><br>
> > <boot_protocol>DHCP</boot_protocol><br>
> > <on_boot>true</on_boot><br>
> > </nic><br>
> > </nics><br>
> > <dns><br>
> > <servers><br>
> > <host><br>
> > <address>10.20.30.100</address><br>
> > </host><br>
> > </servers><br>
> > <search_domains><br>
> > <host><br>
> > <address><a href="http://domain.your.rhevm.com" rel="noreferrer" target="_blank">domain.your.rhevm.com</a><br>
> <<a href="http://domain.your.rhevm.com" rel="noreferrer" target="_blank">http://domain.your.rhevm.com</a>><br>
> > <<a href="http://domain.your.rhevm.com" rel="noreferrer" target="_blank">http://domain.your.rhevm.com</a>></address><br>
> > </host><br>
> > </search_domains><br>
> > </dns><br>
> > </network_configuration><br>
> > <files><br>
> > <file><br>
> > <name>/tmp/file1.txt</name><br>
> > <content>line 1<br>
> > line 2<br>
> > and now something special<br>
> > !@#$%^&amp;*()_+</content><br>
> > <type>PLAINTEXT</type><br>
> > </file><br>
> > </files><br>
> > </cloud_init><br>
> > </initialization><br>
> > </vm><br>
> > </action><br>
> ><br>
> > we also found following link . is this related to my issue?<br>
> ><br>
> > <a href="https://gerrit.ovirt.org/#/c/50240/2" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/50240/2</a><br>
> ><br>
> > Regards,<br>
> > *Arpit Makhiyaviya*<br>
> > Software Engineer<br>
> > +91-79-40038284<br>
> > +91-971-437-6669<br>
> > <<a href="http://www.sculptsoft.com" rel="noreferrer" target="_blank">http://www.sculptsoft.com</a>><br>
> ><br>
> > On Tue, Mar 29, 2016 at 6:24 PM, Renout Gerrits <<a href="mailto:mail@renout.nl">mail@renout.nl</a><br>
> <mailto:<a href="mailto:mail@renout.nl">mail@renout.nl</a>><br>
> > <mailto:<a href="mailto:mail@renout.nl">mail@renout.nl</a> <mailto:<a href="mailto:mail@renout.nl">mail@renout.nl</a>>>> wrote:<br>
> ><br>
> > In the more recent versions you have to use<br>
> 'use_cloud_init=True' in<br>
> > the api, which isn't described in most documentation yet. Maybe<br>
> > thats the reason it isn't working?<br>
> ><br>
> > Here's a working snippet:<br>
> ><br>
> > vm = api.vms.get(name=vm_name)<br>
> ><br>
> > action = params.Action(<br>
> > use_cloud_init=True,<br>
> > vm=params.VM(<br>
> > initialization=params.Initialization(<br>
> > regenerate_ssh_keys=True,<br>
> > host_name=vm_fqdn,<br>
> > nic_configurations=params.GuestNicsConfiguration(<br>
> > nic_configuration=[<br>
> > params.GuestNicConfiguration(<br>
> > name="eth0",<br>
> > boot_protocol="static",<br>
> > on_boot=True,<br>
> > ip=params.IP(<br>
> > address=vm_address,<br>
> > netmask=vm_netmask,<br>
> > gateway=vm_gateway,<br>
> > ),<br>
> > ),<br>
> > ],<br>
> > ),<br>
> > ),<br>
> > ),<br>
> > )<br>
> ><br>
> > vm.start(action)<br>
> ><br>
> ><br>
> > On Tue, Mar 29, 2016 at 2:03 PM, Arpit Makhiyaviya<br>
> > <<a href="mailto:arpit.icreate@gmail.com">arpit.icreate@gmail.com</a> <mailto:<a href="mailto:arpit.icreate@gmail.com">arpit.icreate@gmail.com</a>><br>
> <mailto:<a href="mailto:arpit.icreate@gmail.com">arpit.icreate@gmail.com</a> <mailto:<a href="mailto:arpit.icreate@gmail.com">arpit.icreate@gmail.com</a>>>><br>
> wrote:<br>
> ><br>
> > Hello,<br>
> > we are using ovirt api with json data format.<br>
> > we have create vm from template and i want to set<br>
> > ip,macaddress,user and password for that we are using<br>
> cloud_init<br>
> > for that we it can't set any options.<br>
> ><br>
><br>
<span class="HOEnZb"><font color="#888888"><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></div>