11.3.2. Resource Utilization Across All Hosts

This example produces an aggregated resource utilization report across all hosts in the Red Hat Enterprise Virtualization Manager environment. Aggregated usage percentages for CPU and memory are shown with an hourly temporal resolution. This kind of report reveals utilization trends for the entire environment over a long period of time and is useful for capacity planning purposes. The following SQL query defines the report. Ensure the values provided for the history_datetime components of the where clause are substituted with appropriate values for your environment.

Example 11.2. Report query for resource utilization across all hosts

    select extract(hour from history_datetime) as Hour, avg(cpu_usage_percent) as CPU, avg(memory_usage_percent) as Memory
    from v3_0_host_hourly_history_view
    where history_datetime >= '2011-07-01' and history_datetime < '2011-07-31'
    group by extract(hour from history_datetime)
    order by extract(hour from history_datetime)

This query returns a table of data with one row per hour:

Table 11.2. Resource utilization across all hosts example data

Hour CPU Memory
0 39 40
1 38 38
2 37 32
3 35 45
4 35 37
5 36 37

Compose the data into a graph or chart using third party data analysis and visualization tools such as OpenOffice.org Calc and Microsoft Excel. For this example, a line graph showing the total system utilization over time is a useful visualization. Figure 11.2, “Total system utilization line graph” was produced using the Chart Wizard tool in OpenOffice.org Calc.
Total system utilization line graph

Figure 11.2. Total system utilization line graph