
--_=__=_XaM3_.1418285849.2A.437975.42.26253.52.42.007.1887602006 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =0A thanks!=0A Best regards=0A Amedeo Salvati=0A=0A Da "Juan Hern= =C3=A1ndez" jhernand@redhat.com=0A=0A A "Amedeo Salvati" amedeo@oscert.= net, users@ovirt.org=0A=0A Cc=0A=0A Data Wed, 10 Dec 2014 19:12:31 +0= 100=0A=0A Oggetto Re: [ovirt-users] How to create a vm cloned independe= nt from python sdk=0A=0A > On 12/10/2014 05:11 PM, Amedeo Salvati wrote= :=0A=0A > > Hello all,=0A=0A > >=0A=0A > > I'm trying to create a n= ew VM using python sdk with it's disks=0A=0A > > cloned/independent and= not on thin provisioning, when I create vm I use=0A=0A > > template (t= hat has a preallocated disks), and I use this code to create=0A=0A > > = a vm:=0A=0A > >=0A=0A > > api.vms.add(params.VM(name=3DVMNAME, memory= =3DMEM*GB,=0A=0A > > cluster=3Dapi.clusters.get(CLUSTER),=0A=0A > > t= emplate=3Dapi.templates.get(templatename),=0A=0A > > description=3D'PRO= VA' ))=0A=0A > >=0A=0A > > if I use web portal I'm able to preallocat= e/clone disks under resource=0A=0A > > allocation tab (New VM -> resour= ce allocation), instead I can't found=0A=0A > > same operations on pyth= on sdk...=0A=0A > >=0A=0A > > someone can let me know what params I s= hould pass to api.vms.add to=0A=0A > > clone disks?=0A=0A > >=0A=0A =
Best regards=0A=0A > > Amedeo Salvati=0A=0A > >=0A=0A >=0A=0A = To specify that you want to clone the disks (the default is to not cl= one=0A=0A > them) you need an additional "disks" parameter with the "cl= one=3DTrue"=0A=0A > attribute:=0A=0A >=0A=0A > api.vms.add(=0A=0A = params.VM(=0A=0A > vmname=3DVMNAME,=0A=0A > memory=3DMEM*GB,=0A=0A= cluster=3D...,=0A=0A > template=3D...,=0A=0A > description=3D...= ,=0A=0A > disks=3Dparams.Disks(=0A=0A > clone=3DTrue=0A=0A > )=0A=0A= )=0A=0A > )=0A=0A >=0A=0A > --=0A=0A > Direcci=C3=B3n Comerc= ial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta=0A=0A > 3=C2=BAD,= 28016 Madrid, Spain=0A=0A > Inscrita en el Reg. Mercantil de Madrid =E2= =80=93 C.I.F. B82657941 - Red Hat S.L.=0A --_=__=_XaM3_.1418285849.2A.437975.42.26253.52.42.007.1887602006 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
<div>> > api.vms.add(params.VM(name=3DVMNAME, memory=3DMEM*GB,</di= v><div>> > cluster=3Dapi.clusters.get(CLUSTER),</div><div>> >= template=3Dapi.templates.get(templatename)= ,</div><div>> > description=3D'PROVA' ))</div><div>> > </div>= <div>> > if I use web portal I'm able to preallocate/clone disks un= der resource</div><div>> > allocation tab (New VM -> resource al= location), instead I can't found</div><div>> > same operations on p= ython sdk...</div><div>> > </div><div>> > someone can let me = know what params I should pass to api.vms.add to</div><div>> > clon= e disks?</div><div>> > </div><div>> > Best regards</div><div>= > > Amedeo Salvati</div><div>> > </div><div>> </div><div>&= gt; To specify that you want to clone the disks (the default is to not cl= one</div><div>> them) you need an additional "disks" paramet= er with the "clone=3DTrue"</div><div>> attribute:</div><div>= > </div><div>> api.vms.add(</div><div>> params.VM(</div><d= iv>> vmname=3DVMNAME,</div><div>> memory=3DMEM*GB,</div= <div>> cluster=3D...,</div><div>> template=3D...,</div= <div>> description=3D...,</div><div>> disks=3Dparams.D= isks(</div><div>> clone=3DTrue</div><div>> )</div><di= v>> )</div><div>> )</div><div>> </div><div>> -- </div><=
=0A<div class=3D"xam_msg_class">=0A=0A <br />thanks!<br /><br />Best re= gards<br />Amedeo Salvati<br />=C2=A0<br />=0A<div><span style=3D"font-fa= mily:Arial; font-size:11px; color:#5F5F5F;">Da</span><span style=3D"font-= family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> "Ju= an Hern=C3=A1ndez" jhernand@redhat.com</span></div>=0A<div><span sty= le=3D"font-family:Arial; font-size:11px; color:#5F5F5F;">A</span><span st= yle=3D"font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px= ;"> "Amedeo Salvati" amedeo@oscert.net, users@ovirt.org</span><= /div>=0A<div><span style=3D"font-family:Arial; font-size:11px; color:#5F5= F5F;">Cc</span><span style=3D"font-family:Arial; font-size:12px; color:#5= F5F5F; padding-left:5px;"> </span></div>=0A<div><span style=3D"font-famil= y:Arial; font-size:11px; color:#5F5F5F;">Data</span><span style=3D"font-f= amily:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> Wed, 10 D= ec 2014 19:12:31 +0100</span></div>=0A<div><span style=3D"font-family:Ari= al; font-size:11px; color:#5F5F5F;">Oggetto</span><span style=3D"font-fam= ily:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> Re: [ovirt-= users] How to create a vm cloned independent from python sdk</span></div>= =0A<br />=0A<div>> On 12/10/2014 05:11 PM, Amedeo Salvati wrote:</div>= <div>> > Hello all,</div><div>> > </div><div>> > I'm tr= ying to create a new VM using python sdk with it's disks</div><div>> &= gt; cloned/independent and not on thin provisioning, when I create vm I u= se</div><div>> > template (that has a preallocated disks), and I us= e this code to create</div><div>> > a vm:</div><div>> > </div= div>> Direcci=C3=B3n Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea= 3, planta</div><div>> 3=C2=BAD, 28016 Madrid, Spain</div><div>> In= scrita en el Reg. Mercantil de Madrid =E2=80=93 C.I.F. B82657941 - Red Ha= t S.L.</div>=0A =0A</div>=0A --_=__=_XaM3_.1418285849.2A.437975.42.26253.52.42.007.1887602006--