Hi,<div><br></div><div>I completely forgot that you can actually customize the columns of the table now [1]</div><div><br></div><div><div>$ mkdir -p ./.one/cli/</div><div>$ cp /etc/one/cli/oneacct.yaml ./.one/cli/</div></div>
<div><br></div><div>And then just edit the :default attribute to show the ones you need</div><div><br></div><div><br></div><div>Regards</div><div><br></div><div>[1] <a href="http://opennebula.org/documentation:rel3.6:cli">http://opennebula.org/documentation:rel3.6:cli</a><br clear="all">
--<br>Carlos Martín, MSc<br>Project Engineer<br>OpenNebula - The Open-source Solution for Data Center Virtualization<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>
<br>
<br><br><div class="gmail_quote">On Thu, Sep 20, 2012 at 2:21 PM, Jan Benadik <span dir="ltr"><<a href="mailto:jan.benadik@atos.net" target="_blank">jan.benadik@atos.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
<br>
<div>Dňa 20.09.2012 11:51, Carlos Martín
Sánchez wrote / napísal(a):<br>
</div><div class="im">
<blockquote 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></div>
Nice to hear it :-)<div class="im"><br>
<br>
<blockquote 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></div>
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 ...)<div class="im"><br>
<br>
Jan<br>
<br>
<div>-- <br>
<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 face="Helvetica"> Managed Services - Solution
Design Architect<br>
mobile: <a href="tel:%2B421%20903%20691%20634" value="+421903691634" target="_blank">+421 903 691 634</a><br>
fax: <a href="tel:%2B421%202%206852%208380" value="+421268528380" target="_blank">+421 2 6852 8380</a><br>
<a href="mailto://jan.benadik@atos.net" target="_blank">jan.benadik@atos.net</a><br>
Vinohradnicka 6, 971 01 Prievidza<br>
<a href="http://www.sk.atos.net" target="_blank">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>
</div></div>
</blockquote></div><br></div>