How to create a vm cloned independent from python sdk

--_=__=_XaM3_.1418227873.2A.366751.42.13104.52.42.007.806599816 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =0A Hello all,=0A I'm trying to create a new VM using python sdk with= it's disks cloned/independent and not on thin provisioning, when I creat= e vm I use template (that has a preallocated disks), and I use this code = to create a vm:=0A api.vms.add(params.VM(name=3DVMNAME, memory=3DMEM*GB= , cluster=3Dapi.clusters.get(CLUSTER),=0A = template=3Dapi.templates.get(templatename), description=3D'PROVA' ))=0A = if I use web portal I'm able to preallocate/clone disks under resource = allocation tab (New VM -> resource allocation), instead I can't found sam= e operations on python sdk...=0A someone can let me know what params I = should pass to api.vms.add to clone disks?=0A Best regards=0A Amedeo = Salvati=0A --_=__=_XaM3_.1418227873.2A.366751.42.13104.52.42.007.806599816 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable =0A<div class=3D"xam_msg_class">=0A=0A =0A<div class=3D"xam_msg_class">= =0A=0A<div class=3D"xam_msg_class">=0A=0A <font size=3D"2">Hello all,<b= r /><br />I'm trying to create a new VM using python sdk with it's disks = cloned/independent and not on thin provisioning, when I create vm I use t= emplate (that has a preallocated disks), and I use this code to create a = vm:<br /><br />api.vms.add(params.VM(name=3DVMNAME, memory=3DMEM*GB, clus= ter=3Dapi.clusters.get(CLUSTER), <br />=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 template=3D= api.templates.get(templatename), description=3D'PROVA' ))<br /><br />if I= use web portal I'm able to preallocate/clone disks under resource alloca= tion tab (New VM -> resource allocation), instead I can't found same o= perations on python sdk... <br /><br />someone can let me know what param= s I should pass to api.vms.add to clone disks?<br /><br />Best regards<br= />Amedeo Salvati</font>=0A =0A</div>=0A=0A=0A</div>=0A=0A =0A</div>=0A= --_=__=_XaM3_.1418227873.2A.366751.42.13104.52.42.007.806599816--

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

--_=__=_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--
participants (2)
-
Amedeo Salvati
-
Juan Hernández