<div dir="ltr">Adding to what Rubén said, <span style="font-family:arial,sans-serif;font-size:13px">VirtualMachine::get_</span><span style="font-family:arial,sans-serif;font-size:13px">requirements will report the needed storage when we address this issue: </span><a href="http://dev.opennebula.org/issues/2402">http://dev.opennebula.org/issues/2402</a></div>

<div class="gmail_extra"><br clear="all"><div><div dir="ltr">--<br><div>Carlos Martín, MSc<br>Project Engineer</div><div>OpenNebula - Flexible Enterprise Cloud Made Simple<br><div><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a href="http://twitter.com/opennebula" target="_blank">@OpenNebula</a></span><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></span></div>

</div></div></div>
<br><br><div class="gmail_quote">On Thu, Jun 12, 2014 at 11:56 AM, Ruben S. Montero <span dir="ltr"><<a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi Stuart<div><br></div><div>That code, as you suggest in your first email, is actually in the scheduler. You are probably interested in VirtualMachineXML class, specially</div><div><br></div><div>Computation on the storage needed by the VM[1]:</div>



<div>  * IT considers the DS and specific mechanisms of the CLONE and LN operations (i.e. if the storage needed to CLONE and LN takes space from the system_ds or the image ds)</div><div>  * The updated version of the get_requirements function is also in that class [2]</div>



<div>  * Available capacity of the DS is inititalized here [3] (DatastoreXML class)</div><div><br></div><div>The actual scheduling is do in two-phases:</div><div><br></div><div>  * Datastores are filtered based on capacity (using previous functions) and requirements [4]</div>



<div>  * System DS + Host are jointly scheduled later, the DS part is [5]</div><div><br></div><div>[1]<a href="https://github.com/OpenNebula/one/blob/master/src/scheduler/src/pool/VirtualMachineXML.cc#L306" target="_blank">https://github.com/OpenNebula/one/blob/master/src/scheduler/src/pool/VirtualMachineXML.cc#L306</a><br>



</div><div><br></div><div>[2] <a href="https://github.com/OpenNebula/one/blob/master/src/scheduler/src/pool/VirtualMachineXML.cc#L272" target="_blank">https://github.com/OpenNebula/one/blob/master/src/scheduler/src/pool/VirtualMachineXML.cc#L272</a></div>



<div><br></div><div>[3] <a href="https://github.com/OpenNebula/one/blob/master/src/scheduler/src/pool/DatastoreXML.cc#L35" target="_blank">https://github.com/OpenNebula/one/blob/master/src/scheduler/src/pool/DatastoreXML.cc#L35</a></div>



<div><br></div><div>[4] <a href="https://github.com/OpenNebula/one/blob/master/src/scheduler/src/sched/Scheduler.cc#L751" target="_blank">https://github.com/OpenNebula/one/blob/master/src/scheduler/src/sched/Scheduler.cc#L751</a></div>

<div>

<br></div><div>[5] <a href="https://github.com/OpenNebula/one/blob/master/src/scheduler/src/sched/Scheduler.cc#L1051" target="_blank">https://github.com/OpenNebula/one/blob/master/src/scheduler/src/sched/Scheduler.cc#L1051</a></div>

<div>

<br></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sun, Jun 8, 2014 at 10:24 AM, Stuart Longland <span dir="ltr"><<a href="mailto:stuartl@vrt.com.au" target="_blank">stuartl@vrt.com.au</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 05/06/14 12:32, Stuart Longland wrote:<br>
> What I observe though, is that the disk storage always returns 0.  My<br>
> plan was to expand on this by adding an extra parameter (int& cache),<br>
> and I'd use whatever code is present to calculate disk requirements to<br>
> figure out how much to cache and thus, calculate the cache output.<br>
<br>
</div>I've gone digging further back into the git repository to see if there<br>
was previously code that calculated the disk requirements.<br>
<br>
It seems not.  The file in question was added back in 2008, "Initial<br>
commit of ONE code", and those lines are largely unchanged today<br>
according to `git blame`.  So I guess it was a place-holder that never<br>
got filled in, perhaps because it hasn't been needed until now.<br>
<br>
The data needed on the host is going to largely depend on what kind of<br>
datastore is being used.  Plain files using SSH for transfer is going to<br>
require space for full images on the hosts, whereas datastores using<br>
centralised storage won't require any (unless cached).<br>
<br>
I think it makes sense to have the system work out an estimate for how<br>
much storage might be needed on the host to run the VM.  Now it's a<br>
question of do I re-use the "disk" parameter, meaning required "local<br>
disk on host" including cache, or do I create another variable as I was<br>
planning?<br>
<br>
Regards,<br>
<div><div>--<br>
Stuart Longland<br>
Systems Engineer<br>
     _ ___<br>
\  /|_) |                           T: <a href="tel:%2B61%207%203535%209619" value="+61735359619" target="_blank">+61 7 3535 9619</a><br>
 \/ | \ |     38b Douglas Street    F: <a href="tel:%2B61%207%203535%209699" value="+61735359699" target="_blank">+61 7 3535 9699</a><br>
   SYSTEMS    Milton QLD 4064       <a href="http://www.vrt.com.au" target="_blank">http://www.vrt.com.au</a><br>
<br>
<br>
_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.opennebula.org" target="_blank">Dev@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><div><div>-- <br></div></div>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<div>

OpenNebula - Flexible Enterprise Cloud Made Simple<br>

<a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula</div></div>
</font></span></div>
<br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.opennebula.org">Dev@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org</a><br>
<br></blockquote></div><br></div>