<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;"> "Juan Hernández" 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;"> "Amedeo Salvati" 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>> On 12/10/2014 05:11 PM, Amedeo Salvati wrote:</div><div>> > Hello all,</div><div>> > </div><div>> > I'm trying to create a new VM using python sdk with it's disks</div><div>> > cloned/independent and not on thin provisioning, when I create vm I use</div><div>> > template (that has a preallocated disks), and I use this code to create</div><div>> > a vm:</div><div>> > </div><div>> > api.vms.add(params.VM(name=VMNAME, memory=MEM*GB,</div><div>> > cluster=api.clusters.get(CLUSTER),</div><div>> > template=api.templates.get(templatename),</div><div>> > description='PROVA' ))</div><div>> > </div><div>> > if I use web portal I'm able to preallocate/clone disks under resource</div><div>> > allocation tab (New VM -> resource allocation), instead I can't found</div><div>> > same operations on python sdk...</div><div>> > </div><div>> > someone can let me know what params I should pass to api.vms.add to</div><div>> > clone disks?</div><div>> > </div><div>> > Best regards</div><div>> > Amedeo Salvati</div><div>> > </div><div>> </div><div>> To specify that you want to clone the disks (the default is to not clone</div><div>> them) you need an additional "disks" parameter with the "clone=True"</div><div>> attribute:</div><div>> </div><div>> api.vms.add(</div><div>> params.VM(</div><div>> vmname=VMNAME,</div><div>> memory=MEM*GB,</div><div>> cluster=...,</div><div>> template=...,</div><div>> description=...,</div><div>> disks=params.Disks(</div><div>> clone=True</div><div>> )</div><div>> )</div><div>> )</div><div>> </div><div>> -- </div><div>> Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta</div><div>> 3ºD, 28016 Madrid, Spain</div><div>> Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.</div>
                
</div>