<div dir="ltr"><br><div><div style="font-size:12.8px">I used <span style="color:rgb(0,0,0);font-family:'Arial Unicode MS',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:'Arial Unicode MS',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:'Arial Unicode MS',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:'Arial Unicode MS',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"><action></div><div style="text-align:left"> <async>false</async></div><div style="text-align:left"> <use_cloud_init>true</use_cloud_init></div><div style="text-align:left"><vm></div><div style="text-align:left"> <initialization></div><div style="text-align:left"> <cloud_init></div><div style="text-align:left"> <host></div><div style="text-align:left"> <address>vishal.123456</address></div><div style="text-align:left"> </host></div><div style="text-align:left"> <regenerate_ssh_keys>true</regenerate_ssh_keys></div><div style="text-align:left"> <timezone>Atlantic/Reykjavik</timezone></div><div style="text-align:left"> <users></div><div style="text-align:left"> <user></div><div style="text-align:left"> <user_name>root</user_name></div><div style="text-align:left"> <password>Vishal@131</password></div><div style="text-align:left"> </user></div><div style="text-align:left"> </users></div><div style="text-align:left"> <network_configuration></div><div style="text-align:left"> <nics></div><div style="text-align:left"> <nic></div><div style="text-align:left"> <name>eth1</name></div><div style="text-align:left"> <boot_protocol>STATIC</boot_protocol></div><div style="text-align:left"> <network></div><div style="text-align:left"> <ip address="51.254.56.84" netmask="255.255.255.255" gateway="149.202.85.254" /></div><div style="text-align:left"> </network></div><div style="text-align:left"> <on_boot>false</on_boot></div><div style="text-align:left"> </nic></div><div style="text-align:left"> </div><div style="text-align:left"> </nics></div><div style="text-align:left"> <dns></div><div style="text-align:left"> <servers></div><div style="text-align:left"> <host></div><div style="text-align:left"> <address>8.8.8.8</address></div><div style="text-align:left"> </host></div><div style="text-align:left"> </servers></div><div style="text-align:left"> <search_domains></div><div style="text-align:left"> <host></div><div style="text-align:left"> <address>8.8.4.4</address></div><div style="text-align:left"> </host></div><div style="text-align:left"> </search_domains></div><div style="text-align:left"> </dns></div><div style="text-align:left"> </network_configuration></div><div style="text-align:left"> </div><div style="text-align:left"><br></div><div style="text-align:left"> </cloud_init></div><div style="text-align:left"> </initialization></div><div style="text-align:left"></vm></div><div style="text-align:left"> </div><div style="text-align:left"></action></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"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></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>
> Thanks for quick response.<br>
> we already knew this and we are passing following xml when calling 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 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>></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>>> wrote:<br>
><br>
> In the more recent versions you have to use '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>>> 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 cloud_init<br>
> for that we it can't set any options.<br>
><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>