------=_Part_21629094_1323599865.1394090419099
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
----- Original Message -----
From: "Tejesh M" <tejeshmk(a)gmail.com>
To: "Moti Asayag" <masayag(a)redhat.com>
Cc: "users(a)oVirt.org" <users(a)ovirt.org>, "Omer Frenkel"
<ofrenkel(a)redhat.com>
Sent: Thursday, March 6, 2014 7:40:47 AM
Subject: Re: Clone a Template using API
Thanks Moti.
On Wed, Mar 5, 2014 at 7:06 PM, Moti Asayag < masayag(a)redhat.com
> wrote:
> ----- Original Message -----
> > From: "Tejesh M" < tejeshmk(a)gmail.com >
> > To: "users(a)oVirt.org" < users(a)ovirt.org >, "Moti
Asayag" <
> > masayag(a)redhat.com >
> > Sent: Wednesday, March 5, 2014 1:01:18 PM
> > Subject: Clone a Template using API
> >
> > Hi,
> >
> > While creating VM from Template via Web Admin portal, the default
> > provisioning is Clone. But while doing the same via API its is doing Thin
> > provisioning. Can someone share there view.
> >
> >
> > org.ovirt.engine.sdk.entities.Template templateData = new Template();
> > templateData.setName(templateName);
> > org.ovirt.engine.sdk.entities.Cluster clusterData = new Cluster();
> > clusterData.setName(clusterName);
> > org.ovirt.engine.sdk.entities.VM vmDataForCreate = new VM();
> Try with those lines:
> Disks disks = new Disks();
> disks.setClone(true);
> vm.setDisks(disks);
> Adding Omer to confirm.
yes, should work
> > vmDataForCreate.setName(vmName);
> > vmDataForCreate.setCluster(clusterData);
> > vmDataForCreate.setTemplate(templateData);
> > api.getVMs().add(vmDataForCreate);
> >
> > --
> > Thanks & Regards
> > Tejesh
> >
--
Thanks & Regards
Tejesh
------=_Part_21629094_1323599865.1394090419099
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><body><div style=3D"font-family: times new roman, new york,
times, se=
rif; font-size: 12pt; color:
#000000"><div><br></div><div><br></div><hr
id=
=3D"zwchr"><blockquote style=3D"border-left:2px solid
#1010FF;margin-left:5=
px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-de=
coration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-=
mce-style=3D"border-left: 2px solid #1010FF; margin-left: 5px; padding-left=
: 5px; color: #000; font-weight: normal; font-style: normal; text-decoratio=
n: none; font-family: Helvetica,Arial,sans-serif; font-size:
12pt;"><b>From=
: </b>"Tejesh M" &lt;tejeshmk(a)gmail.com&gt;<br><b>To:
</b>"Moti Asayag" <=
;masayag(a)redhat.com&gt;<br><b>Cc: </b>"users(a)oVirt.org"
&lt;users(a)ovirt.org=
>, "Omer Frenkel"
&lt;ofrenkel(a)redhat.com&gt;<br><b>Sent: </b>Thursday, =
March 6, 2014 7:40:47 AM<br><b>Subject: </b>Re: Clone a Template using
API<=
br><div><br></div><div dir=3D"ltr">Thanks
Moti.<br></div><div class=3D"gmai=
l_extra"><br><div><br></div><div
class=3D"gmail_quote">On Wed, Mar 5, 2014 =
at 7:06 PM, Moti Asayag <span dir=3D"ltr"><<a
href=3D"mailto:masayag@red=
hat.com" target=3D"_blank"
data-mce-href=3D"mailto:masayag@redhat.com">masa=
yag(a)redhat.com</a>&gt;</span> wrote:<br><blockquote
class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data=
-mce-style=3D"margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left=
: 1ex;"><br><br> ----- Original Message -----<br> > From:
"Tejesh M" <=
;<a href=3D"mailto:tejeshmk@gmail.com" target=3D"_blank"
data-mce-href=3D"m=
ailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>><br> >
To: "users@oV=
irt.org" <<a href=3D"mailto:users@ovirt.org"
target=3D"_blank" data-mce-=
href=3D"mailto:users@ovirt.org">users@ovirt.org</a>>, "Moti
Asayag" <=
<a href=3D"mailto:masayag@redhat.com" target=3D"_blank"
data-mce-href=3D"ma=
ilto:masayag@redhat.com">masayag@redhat.com</a>><br> >
Sent: Wednesda=
y, March 5, 2014 1:01:18 PM<br> > Subject: Clone a Template using API<br=
><br> > Hi,<br> ><br> >
While creating VM from Template via W=
eb Admin portal, the default<br>
> provisioning is Clone. But while doin=
g the same via API its is doing Thin<br> > provisioning. Can someone sha=
re there view.<br> ><br> ><br> >
org.ovirt.engine.sdk.entit=
ies.Template templateData =3D new Template();<br> >
=
templateData.setName(templateName);<br> >
&=
nbsp; org.ovirt.engine.sdk.entities.Cluster clusterData =3D n=
ew Cluster();<br> >
clusterData.setNa=
me(clusterName);<br> >
org.ovirt.engi=
ne.sdk.entities.VM vmDataForCreate =3D new VM();<br><br><br> Try with
those=
lines:<br><br>
Disks disks =3D n=
ew Disks();<br>
disks.setClone(tr=
ue);<br>
vm.setDisks(disks);<br><=
br> Adding Omer to
confirm.<br></blockquote></div></div></blockquote><div>y=
es, should work<br></div><blockquote style=3D"border-left:2px solid
#1010FF=
;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:=
normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-siz=
e:12pt;" data-mce-style=3D"border-left: 2px solid #1010FF; margin-left: 5px=
; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; =
text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: =
12pt;"><div class=3D"gmail_extra"><div
class=3D"gmail_quote"><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc
solid;p=
adding-left:1ex" data-mce-style=3D"margin: 0 0 0 .8ex; border-left: 1px #cc=
c solid; padding-left: 1ex;"> >
vmDat=
aForCreate.setName(vmName);<br> >
vmD=
ataForCreate.setCluster(clusterData);<br> >
=
vmDataForCreate.setTemplate(templateData);<br> >
&n=
bsp; api.getVMs().add(vmDataForCreate);<br><span
class=3D"HOEn=
Zb"><span style=3D"color: #888888;" data-mce-style=3D"color:
#888888;" colo=
r=3D"#888888">><br> > --<br> > Thanks
& Regards<br> > Tejes=
h<br> ><br>
</span></span></blockquote></div><br><br
clear=3D"all"><br>-=
- <br><div>Thanks &
Regards</div><div>Tejesh</div></div></blockquote><d=
iv><br></div></div></body></html>
------=_Part_21629094_1323599865.1394090419099--