<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.sy0
        {mso-style-name:sy0;}
span.me1
        {mso-style-name:me1;}
span.br0
        {mso-style-name:br0;}
span.st0
        {mso-style-name:st0;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 1.0cm 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="LT" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It seems ovirt API lacks of possibility to define storage domain, in which cloned vm (from snapshot) will be created, is it done on purpose, or it is just missing/under development ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Scenario using WEB GUI :<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Create snapshot of any running VM, right-click on snapshot, select “clone”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In pop-up window you can enter new VM name etc, under “resource allocation” section *<b>you can select where it will be created</b>*<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Scenario using python-sdk/ovirt-api<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I was trying to create vm for example like this:<o:p></o:p></span></p>
<p class="MsoNormal">##<o:p></o:p></p>
<p class="MsoNormal">vm_params <span class="sy0">=</span> params.<span class="me1">VM</span><span class="br0">(</span>name<span class="sy0">=</span>vm_from_list +
<span class="st0">'__bak'</span><span class="sy0">,</span> cluster<span class="sy0">=</span>api.<span class="me1">clusters</span>.<span class="me1">get</span><span class="br0">(</span><span class="st0">"Default"</span><span class="br0">)</span><span class="sy0">,</span>
storage_domain<span class="sy0">=</span>api.<span class="me1">storagedomains</span>.<span class="me1">get</span><span class="br0">(</span><span class="st0">"temp"</span><span class="br0">)</span><span class="sy0">,</span> memory<span class="sy0">=</span>vm.<span class="me1">get_memory</span><span class="br0">()</span><span class="sy0">,</span>
snapshots<span class="sy0">=</span>snapshots_param<span class="br0">)<o:p></o:p></span></p>
<p class="MsoNormal">api.<span class="me1">vms</span>.<span class="me1">add</span><span class="br0">(</span>vm_params<span class="br0">)<o:p></o:p></span></p>
<p class="MsoNormal"><span class="br0">##<o:p></o:p></span></p>
<p class="MsoNormal"><span class="br0"># temp is „other“ storage domain, NFS v3<o:p></o:p></span></p>
<p class="MsoNormal"><span class="br0">VM will be still created on same storage as original VM, no matter what domain I will define in params...<o:p></o:p></span></p>
<p class="MsoNormal"><span class="br0"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Also tried other variations, using templates, disk profiles and so on, but nothing has changed where new VM is created.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I know cloning is not intended for backup purpose, but it is workaround probably half of Ovirt users use.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In my case, it is not very smart to do snapshot and create VM (allocate disk space, etc) on same storage domain where there is already running a lot of VMs, environment is already busy.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks !<o:p></o:p></span></p>
</div>
</body>
</html>