<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"><<a href="mailto:masayag@redhat.com" target="_blank">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"><br>
<br>
----- Original Message -----<br>
> From: "Tejesh M" <<a href="mailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>><br>
> To: "users@oVirt.org" <<a href="mailto:users@ovirt.org">users@ovirt.org</a>>, "Moti Asayag" <<a 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>
<br>
> vmDataForCreate.setName(vmName);<br>
> vmDataForCreate.setCluster(clusterData);<br>
> vmDataForCreate.setTemplate(templateData);<br>
> api.getVMs().add(vmDataForCreate);<br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> Thanks & Regards<br>
> Tejesh<br>
><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>Thanks & Regards</div>
<div>Tejesh</div>
</div>