<div class="xam_msg_class">

                        <br />thanks!<br /><br />Best regards<br />Amedeo Salvati<br /> <br />
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Da</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> &quot;Juan Hernández&quot; jhernand@redhat.com</span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">A</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> &quot;Amedeo Salvati&quot; amedeo@oscert.net, users@ovirt.org</span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Cc</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> </span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Data</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> Wed, 10 Dec 2014 19:12:31 +0100</span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Oggetto</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> Re: [ovirt-users] How to create a vm cloned independent from python sdk</span></div>
<br />
<div>&gt; On 12/10/2014 05:11 PM, Amedeo Salvati wrote:</div><div>&gt; &gt; Hello all,</div><div>&gt; &gt; </div><div>&gt; &gt; I'm trying to create a new VM using python sdk with it's disks</div><div>&gt; &gt; cloned/independent and not on thin provisioning, when I create vm I use</div><div>&gt; &gt; template (that has a preallocated disks), and I use this code to create</div><div>&gt; &gt; a vm:</div><div>&gt; &gt; </div><div>&gt; &gt; api.vms.add(params.VM(name=VMNAME, memory=MEM*GB,</div><div>&gt; &gt; cluster=api.clusters.get(CLUSTER),</div><div>&gt; &gt;                               template=api.templates.get(templatename),</div><div>&gt; &gt; description='PROVA' ))</div><div>&gt; &gt; </div><div>&gt; &gt; if I use web portal I'm able to preallocate/clone disks under resource</div><div>&gt; &gt; allocation tab (New VM -&gt; resource allocation), instead I can't found</div><div>&gt; &gt; same operations on python sdk...</div><div>&gt; &gt; </div><div>&gt; &gt; someone can let me know what params I should pass to api.vms.add to</div><div>&gt; &gt; clone disks?</div><div>&gt; &gt; </div><div>&gt; &gt; Best regards</div><div>&gt; &gt; Amedeo Salvati</div><div>&gt; &gt; </div><div>&gt; </div><div>&gt; To specify that you want to clone the disks (the default is to not clone</div><div>&gt; them) you need an additional &quot;disks&quot; parameter with the &quot;clone=True&quot;</div><div>&gt; attribute:</div><div>&gt; </div><div>&gt;   api.vms.add(</div><div>&gt;     params.VM(</div><div>&gt;       vmname=VMNAME,</div><div>&gt;       memory=MEM*GB,</div><div>&gt;       cluster=...,</div><div>&gt;       template=...,</div><div>&gt;       description=...,</div><div>&gt;       disks=params.Disks(</div><div>&gt;         clone=True</div><div>&gt;       )</div><div>&gt;     )</div><div>&gt;   )</div><div>&gt; </div><div>&gt; -- </div><div>&gt; Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta</div><div>&gt; 3ºD, 28016 Madrid, Spain</div><div>&gt; Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.</div>
                
</div>