<div dir="ltr">Thanks Moti.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 7:06 PM, Moti Asayag <span dir="ltr">&lt;<a href="mailto:masayag@redhat.com" target="_blank">masayag@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Tejesh M&quot; &lt;<a href="mailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>&gt;<br>
&gt; To: &quot;users@oVirt.org&quot; &lt;<a href="mailto:users@ovirt.org">users@ovirt.org</a>&gt;, &quot;Moti Asayag&quot; &lt;<a href="mailto:masayag@redhat.com">masayag@redhat.com</a>&gt;<br>
&gt; Sent: Wednesday, March 5, 2014 1:01:18 PM<br>
&gt; Subject: Clone a Template using API<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; While creating VM from Template via Web Admin portal, the default<br>
&gt; provisioning is Clone. But while doing the same via API its is doing Thin<br>
&gt; provisioning. Can someone share there view.<br>
&gt;<br>
&gt;<br>
&gt;   org.ovirt.engine.sdk.entities.Template templateData = new Template();<br>
&gt;           templateData.setName(templateName);<br>
&gt;           org.ovirt.engine.sdk.entities.Cluster clusterData = new Cluster();<br>
&gt;           clusterData.setName(clusterName);<br>
&gt;           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>
<br>
&gt;           vmDataForCreate.setName(vmName);<br>
&gt;           vmDataForCreate.setCluster(clusterData);<br>
&gt;           vmDataForCreate.setTemplate(templateData);<br>
&gt;          api.getVMs().add(vmDataForCreate);<br>
<span class="HOEnZb"><font color="#888888">&gt;<br>
&gt; --<br>
&gt; Thanks &amp; Regards<br>
&gt; Tejesh<br>
&gt;<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>Thanks &amp; Regards</div>
<div>Tejesh</div>
</div>