<div class="xam_msg_class">
<div style="font: normal 13px Arial; color:rgb(31, 28, 27);">Hy guys,<br><br>after some headache I was able to use cloud-init via python-sdk (thanks to Juan), and I hope no one will fight anymore with them :D, so if you want I think it's better to document with a simple example it's use on web page available at:<br><br>http://www.ovirt.org/Features/Cloud-Init_Integration<br><br>below simple change that you can integrate on web page:<br><br>- fix api design example of usage for files xml, on the web page you can find:<br><br>...<br> <files><br> <file><br> <name>/tmp/testFile1.txt</name><br> <content>temp content</content><br> <type>PLAINTEXT</type><br> </file><br> </files><br>...<br><br>but on params.File there aren't any "type" parameter only "type_" so you can change xml with:<br><br>...<br> <files><br> <file><br> <name>/tmp/testFile1.txt</name><br> <content>temp content</content><br> <type_>PLAINTEXT</type_><br> </file><br> </files><br>...<br><br>- insert an example of using cloud-init via python-sdk (I hope java-sdk haven't big differences).<br><br>for this you can insert on web page an example of setting via cloud-init: hostname, reset root password and write a simple text file, and finally simple python code is:<br><br>...<br>scontent = "write_files:\n- content: |\n #simple file\n PIPPO=\"ciao\"\n path: /etc/pippo.txt"<br>action = params.Action(<br> vm=params.VM(<br> initialization=params.Initialization(<br> cloud_init=params.CloudInit(<br> host=params.Host(address="rheltest029"),<br> users=params.Users(<br> user=[params.User(user_name="root", password="pippolo")]<br> ),<br> files=params.Files(<br> file=[params.File(name="/etc/pippo.txt", content=scontent, type_="PLAINTEXT")]<br> )<br> )<br> )<br> )<br>)<br>vm.start( action )<br>...<br><br>HTH<br>Amedeo Salvati</div>
</div>