<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">&lt;<a href="mailto:omachace@redhat.com" target="_blank">omachace@redhat.com</a>&gt;</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>
&lt;snippet&gt;<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> &lt;<a href="http://vm.id" rel="noreferrer" target="_blank">http://vm.id</a>&gt;)<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=&#39;eth0&#39;,<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="">
&lt;/snippet&gt;<br>
<br>
Which will result in:<br>
Traceback (most recent call last):<br>
  File &quot;./create_vm.py&quot;, line 94, in &lt;module&gt;<br>
    gateway=vm_gateway,<br>
  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/services.py&quot;, line<br>
18655, in start<br>
    Writer.write_boolean(writer, &#39;async&#39;, async)<br>
  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/writer.py&quot;, line<br>
52, in write_boolean<br>
    return writer.write_element(name, Writer.render_boolean(value))<br>
  File &quot;/usr/lib64/python2.7/site-pac<wbr>kages/ovirtsdk4/writer.py&quot;, line<br>
44, in render_boolean<br>
    raise TypeError(&#39;The \&#39;value\&#39; parameter must be a boolean&#39;)<br>
TypeError: The &#39;value&#39; parameter must be a boolean<br>
<br>
To be honest I don&#39;t have clue where it&#39;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&#39;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>