<div dir="ltr">Thanks for quick response.<div>we already knew this and we are passing following xml when calling Start action.</div><div><br></div><div><div><action></div><div><vm></div><div> <initialization></div><div> <cloud_init></div><div> <host></div><div> <address>vm-cloud-init-restapi</address></div><div> </host></div><div> <authorized_keys></div><div> <authorized_key></div><div> <user></div><div> <user_name>root</user_name></div><div> </user></div><div> <key>ssh-rsa restapi-cloud-init-ssh-key root@localdomain</key></div><div> </authorized_key></div><div> </authorized_keys></div><div> <regenerate_ssh_keys>true</regenerate_ssh_keys></div><div> <timezone>Atlantic/Reykjavik</timezone></div><div> <users></div><div> <user></div><div> <user_name>root</user_name></div><div> <password>SuperSecretPassword!</password></div><div> </user></div><div> </users></div><div> <network_configuration></div><div> <nics></div><div> <nic></div><div> <name>eth0</name></div><div> <boot_protocol>STATIC</boot_protocol></div><div> <network></div><div> <ip address="192.168.2.11" netmask="255.255.255.0" gateway="192.168.2.254" /></div><div> </network></div><div> <on_boot>true</on_boot></div><div> </nic></div><div> <nic></div><div> <name>eth1</name></div><div> <boot_protocol>DHCP</boot_protocol></div><div> <on_boot>true</on_boot></div><div> </nic></div><div> </nics></div><div> <dns></div><div> <servers></div><div> <host></div><div> <address>10.20.30.100</address></div><div> </host></div><div> </servers></div><div> <search_domains></div><div> <host></div><div> <address><a href="http://domain.your.rhevm.com">domain.your.rhevm.com</a></address></div><div> </host></div><div> </search_domains></div><div> </dns></div><div> </network_configuration></div><div> <files></div><div> <file></div><div> <name>/tmp/file1.txt</name></div><div> <content>line 1</div><div>line 2</div><div>and now something special</div><div>!@#$%^&amp;*()_+</content></div><div> <type>PLAINTEXT</type></div><div> </file></div><div> </files></div><div> </cloud_init></div><div> </initialization></div><div></vm></div><div></action></div></div><div><br></div><div>we also found following link . is this related to my issue?</div><div><br></div><div><a href="https://gerrit.ovirt.org/#/c/50240/2">https://gerrit.ovirt.org/#/c/50240/2</a><br></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 Tue, Mar 29, 2016 at 6:24 PM, Renout Gerrits <span dir="ltr"><<a href="mailto:mail@renout.nl" target="_blank">mail@renout.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>In the more recent versions you have to use 'use_cloud_init=True' in the api, which isn't described in most documentation yet. Maybe thats the reason it isn't working?<br><br></div>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><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 29, 2016 at 2:03 PM, Arpit Makhiyaviya <span dir="ltr"><<a href="mailto:arpit.icreate@gmail.com" target="_blank">arpit.icreate@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div>we are using ovirt api with json data format.</div><div>we have create vm from template and i want to set ip,macaddress,user and password for that we are using cloud_init for that we it can't set any options.</div><div><br></div><div><br clear="all"><div><div><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><a href="tel:%2B91-79-40038284" value="+917940038284" target="_blank">+91-79-40038284</a></div><div>+91-971-437-6669</div><div><a href="http://www.sculptsoft.com" target="_blank"><img src="http://sculptsoft.com/images/logo3.png" height="24" width="96"></a><br></div></div></div></div></div></div>
</div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div>