<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
<br>
<div class="moz-cite-prefix">Dňa 20.09.2012 11:51, Carlos Martín
Sánchez wrote / napísal(a):<br>
</div>
<blockquote
cite="mid:CAEPYvFKqPriGWaE4q=GDNJJu0R6vdv+hd+_3Si7DgYoTEsnmCA@mail.gmail.com"
type="cite">
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<br>
- time frame defined running state (when VM is deployed, it
can be specified to run and stop it at certain time, i.e.
start daily at 6.00 AM and stop 20.00 PM in working days
only OR deployment of VM for time limited period - i.e. 2
months - and after that period VM will be stopped / deleted
automatically).<br>
</div>
</blockquote>
<div><br>
</div>
<div>This is a good idea, I've opened a ticket [1] and we'll
consider it for next releases.</div>
<div>It could be implemented adding new attributes to the VMs,
and the scheduler would simply compare the requested
deployment/shutdown time with the current date.</div>
<div> </div>
</div>
<br>
</blockquote>
<br>
Nice to hear it :-)<br>
<br>
<blockquote
cite="mid:CAEPYvFKqPriGWaE4q=GDNJJu0R6vdv+hd+_3Si7DgYoTEsnmCA@mail.gmail.com"
type="cite">
<div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
- more detailed granularity for oneacct reports (number of
minutes VM is running, number of CPU cores)<br>
</div>
</blockquote>
<div><br>
</div>
<div>This information is already available, although it requires
some scripting. oneacct was designed to be used to extract raw
accounting data from opennebula, to be as flexible as
possible. The downside to it is that it requires some
processing to make use of the data.<br>
<br>
The specific example you propose can be done in ruby parsing
the json output of oneacct:<br>
<br>
<font face="courier new, monospace">j = JSON.parse(`oneacct
-j`)<br>
<br>
puts "oid,minutes_running,cpus"<br>
<br>
j['HISTORY_RECORDS']['HISTORY'].each do |h|<br>
<div> puts "#{h['OID']},"<<</div>
<div> "#{(h['ETIME'].to_i -
h['STIME'].to_i)/60},"<<</div>
<div>
"#{h['VM']['TEMPLATE']['CPU']}"</div>
end</font></div>
<div><br>
</div>
<div>
<div><font face="courier new, monospace">#
oid,minutes_running,cpus</font></div>
<div><font face="courier new, monospace"># 0,132,1</font></div>
<div><font face="courier new, monospace"># 1,131,1</font></div>
<div><font face="courier new, monospace"># 2,131,1</font></div>
<div><font face="courier new, monospace"># 3,131,1</font></div>
<div><font face="courier new, monospace"># 4,131,1</font></div>
<div><font face="courier new, monospace"># 5,130,1</font></div>
</div>
<div><br>
</div>
<div>I'm aware that this script takes some familiarity with the
OpenNebula data structures, so maybe we could make things
easier... </div>
<div>The first thing that comes to mind is to add an option to
customize the table, something like</div>
<div>'oneacct --columns VID,CPU,MEMORY'</div>
<div><br>
</div>
<div>This could be combined with new columns that require some
processing, like RUNNING_TIME.</div>
<div><br>
</div>
<div>What do you think about this? What other values should we
add?</div>
</div>
</blockquote>
<br>
I think this is enough for now. Maybe next time somebody will have a
new idea to extend it.<br>
I'll try that script (to be honest, I'm not so strong in scripting,
especially in ruby ...)<br>
<br>
Jan<br>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<font size="3" face="Helvetica"> <img alt=""
src="cid:part1.03040807.00050107@atos.net" width="252"
height="15"><br>
<b>Ján Beňadik</b><br>
<font size="2" face="Helvetica"> Managed Services - Solution
Design Architect<br>
mobile: +421 903 691 634<br>
fax: +421 2 6852 8380<br>
<a href="mailto://jan.benadik@atos.net">jan.benadik@atos.net</a><br>
Vinohradnicka 6, 971 01 Prievidza<br>
<a href="http://www.sk.atos.net">www.sk.atos.net</a><br>
__________________________________<br>
<br>
<img alt="" src="cid:part4.02090407.09010408@atos.net"
width="261" height="58"><br>
</font> </font></div>
</body>
</html>