Resource Usage Forecast

Overview

The OpenNebula Resource Forecast system provides predictive insights into resource utilization across Hosts and Virtual Machines. By analyzing trends in CPU, memory, network, and disk usage, it allows administrators to proactively manage infrastructure, optimize resource allocation, and prevent performance bottlenecks.

Key Benefits

  • Proactive resource management – Identify potential constraints before they impact performance.
  • Enhanced capacity planning – Make data-driven decisions about infrastructure expansion.
  • Optimized workload scheduling – Improve VM placement based on predictive analysis to minimize resource contention and maintain stability.

When integrated with the OpenNebula Distributed Resource Scheduler (DRS), forecasting enables intelligent workload balancing, helping prevent bottlenecks and improve cluster efficiency.

Types of Forecasts

OpenNebula provides two types of resource forecasts:

Long-Term Forecast

Purpose: Supports capacity planning, hardware provisioning, and resource allocation strategies.

Long-term forecasts are accessible via the CLI and Sunstone. In Sunstone, the Monitoring tab displays predicted trends alongside real-time usage data, aiding administrators in effective planning.

By default, long-term forecasts project resource usage for the next 30 days.

Short-Term Forecast

Purpose: Facilitates immediate operational decisions and dynamic resource adjustments.

Short-term forecasts power the Predictive DRS, optimizing cluster load distribution. To enable predictive scheduling, refer to Distributed Resource Scheduling.

Sunstone’s Monitoring tab also provides short-term forecast data.

By default, short-term forecasts cover the next five minutes.

Forecast Generation

Forecasts rely on OpenNebula’s built-in monitoring system (The OpenNebula Monitoring System). Periodically, monitoring probes analyze real-time CPU, memory, disk, and network metrics to generate predictions. Each Host maintains a local time-series database (/var/tmp/one_db/host.db) storing historical data for forecasting. Similarly, every VM has a dedicated database (/var/tmp/one_db/<VM_ID>.db) that tracks its individual metrics.

The forecast computation process is as follows:

  1. Extracts historical data from databases.
  2. Identifies trends and patterns through statistical analysis.
  3. Applies predictive modeling to estimate future resource consumption.
  4. Updates the OpenNebula monitoring system with generated forecasts.
  5. Makes predictions available via Sunstone, CLI, and Predictive DRS.

Quality and Accuracy

The accuracy of the resource forecast generated by the system depends on:

  • Data history – More historical data improves predictions.
  • Monitoring consistency – Regular data collection enhances reliability.
  • Workload stability – Predictable patterns yield better results.
  • Database retention period – Longer retention helps capture seasonal trends.

Administrators can configure database retention policies to balance storage use and prediction accuracy.

Configuration and Optimization

The Resource Forecast configuration file is located at /var/lib/one/remotes/kvm-probes.d/forecast.conf.

Default configuration:

host:
    db_retention: 4  # Weeks
    forecast_period: 5  # Minutes
    forecast_far_period: 720  # Hours (30 days)

virtualmachine:
    db_retention: 2  # Weeks
    forecast_period: 5  # Minutes
    forecast_far_period: 48  # Hours (2 days)

Administrators can modify retention settings to optimize storage and forecast accuracy.

Storage Considerations

Forecast database size depends on retention and monitoring frequency:

  • Host database: ~2.5 MB per Host (4-week retention, 2-minute intervals)
  • VM database: ~6.5 MB per VM (2-week retention, 30-second intervals)

To optimize storage:

  • Adjust retention based on available capacity.
  • Monitor /var/tmp/one_db/ usage.
  • Tailor settings to workload cycles (daily, weekly, monthly).

Changes take effect immediately, without requiring service restarts.

Usage Tips

  • Start with defaults – Default settings suit most environments.
  • Gradually increase retention – Extend retention if long-term accuracy is needed.
  • Monitor storage usage – Avoid excessive database growth.
  • Align settings with workload patterns – Adjust retention for cyclic workloads.
  • Leverage short-term forecasts for real-time decisions and long-term forecasts for planning.