<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr"><blockquote style="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;" data-mce-style="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;"><b>From: </b>"Tejesh M" <tejeshmk@gmail.com><br><b>To: </b>"Moti Asayag" <masayag@redhat.com><br><b>Cc: </b>"users@oVirt.org" <users@ovirt.org>, "Omer Frenkel" <ofrenkel@redhat.com><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="ltr">Thanks Moti.<br></div><div class="gmail_extra"><br><div><br></div><div class="gmail_quote">On Wed, Mar 5, 2014 at 7:06 PM, Moti Asayag <span dir="ltr"><<a href="mailto:masayag@redhat.com" target="_blank" data-mce-href="mailto:masayag@redhat.com">masayag@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><br><br> ----- Original Message -----<br> > From: "Tejesh M" <<a href="mailto:tejeshmk@gmail.com" target="_blank" data-mce-href="mailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>><br> > To: "users@oVirt.org" <<a href="mailto:users@ovirt.org" target="_blank" data-mce-href="mailto:users@ovirt.org">users@ovirt.org</a>>, "Moti Asayag" <<a href="mailto:masayag@redhat.com" target="_blank" data-mce-href="mailto:masayag@redhat.com">masayag@redhat.com</a>><br> > Sent: Wednesday, 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 Web Admin portal, the default<br> > provisioning is Clone. But while doing the same via API its is doing Thin<br> > provisioning. Can someone share there view.<br> ><br> ><br> > org.ovirt.engine.sdk.entities.Template templateData = new Template();<br> > templateData.setName(templateName);<br> > org.ovirt.engine.sdk.entities.Cluster clusterData = new Cluster();<br> > clusterData.setName(clusterName);<br> > org.ovirt.engine.sdk.entities.VM vmDataForCreate = new VM();<br><br><br> Try with those lines:<br><br> Disks disks = new Disks();<br> disks.setClone(true);<br> vm.setDisks(disks);<br><br> Adding Omer to confirm.<br></blockquote></div></div></blockquote><div>yes, should work<br></div><blockquote style="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;" data-mce-style="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="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"> > vmDataForCreate.setName(vmName);<br> > vmDataForCreate.setCluster(clusterData);<br> > vmDataForCreate.setTemplate(templateData);<br> > api.getVMs().add(vmDataForCreate);<br><span class="HOEnZb"><span style="color: #888888;" data-mce-style="color: #888888;" color="#888888">><br> > --<br> > Thanks & Regards<br> > Tejesh<br> ><br> </span></span></blockquote></div><br><br clear="all"><br>-- <br><div>Thanks & Regards</div><div>Tejesh</div></div></blockquote><div><br></div></div></body></html>