<div dir="ltr">Thanks for pointing me in the right direction. That works :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 31, 2016 at 12:45 PM, Ondra Machacek <span dir="ltr"><<a href="mailto:omachace@redhat.com" target="_blank">omachace@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 08/31/2016 12:36 PM, Renout Gerrits wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
I have some troubles starting a VM with cloud-init via the ovirtsdk4.<br>
<br>
<snippet><br>
vm = vms_service.list(search=vm_nam<wbr>e)[0]<br></span>
vm_service = vms_service.vm_service(<a href="http://vm.id" rel="noreferrer" target="_blank">vm.id</a> <<a href="http://vm.id" rel="noreferrer" target="_blank">http://vm.id</a>>)<span class=""><br>
<br>
vm_service.start(<br>
types.Action(<br>
use_cloud_init=True,<br>
),<br>
types.Vm(<br>
types.Initialization(<br>
regenerate_ssh_keys=True,<br>
host_name=vm_fqdn,<br>
nic_configurations=[<br>
types.NicConfiguration(<br>
boot_protocol=types.BootProtoc<wbr>ol.STATIC,<br>
name='eth0',<br>
on_boot=True,<br>
ip=types.Ip(<br>
address=vm_address,<br>
netmask=vm_netmask,<br>
gateway=vm_gateway,<br>
),<br>
),<br>
],<br>
),<br>
),<br>
)<br>
</span></blockquote>
<br>
You have to use named parameters:<br>
like:<br>
<br>
action=types.Action(..)<br>
vm=types.Vm(..)<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
</snippet><br>
<br>
Which will result in:<br>
Traceback (most recent call last):<br>
File "./create_vm.py", line 94, in <module><br>
gateway=vm_gateway,<br>
File "/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/services.py", line<br>
18655, in start<br>
Writer.write_boolean(writer, 'async', async)<br>
File "/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/writer.py", line<br>
52, in write_boolean<br>
return writer.write_element(name, Writer.render_boolean(value))<br>
File "/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/writer.py", line<br>
44, in render_boolean<br>
raise TypeError('The \'value\' parameter must be a boolean')<br>
TypeError: The 'value' parameter must be a boolean<br>
<br>
To be honest I don't have clue where it's going wrong or where to look.<br>
>From what I can see there are two values which must be a boolean and<br>
they are.<br>
<br>
Does anybody know what's going wrong or has a working snippet?<br>
<br>
Thanks,<br>
Renout<br>
<br>
<br></span>
______________________________<wbr>_________________<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<wbr>/listinfo/users</a><br>
<br>
</blockquote>
</blockquote></div><br></div>