Course: CS493 Virtualization
Authors: Soponloe Sovann, Sophana Phat, Vanhong Luy
Date: January 2026
This project implements and compares two VM consolidation strategies in cloud datacenters:
- FFD Baseline - Traditional First-Fit Decreasing algorithm (reactive)
- ML-Enhanced - Predictive consolidation using Exponential Weighted Moving Average (EWMA)
The goal is to demonstrate how machine learning-based workload prediction can reduce energy consumption and SLA violations compared to traditional reactive approaches.
- Workload Prediction: EWMA-based predictor forecasts future VM resource usage
- Smart Migration: ML agent makes proactive consolidation decisions
- Three Workload Scenarios: Steady, Peak, and Variable load patterns
- Comprehensive Metrics: Energy consumption, SLA violations, migration count
- Visual Analytics: Automated generation of comparison charts
ml_consolidation_testing.py
├── WorkloadPredictor # ML component for workload forecasting
├── MLConsolidationAgent # Decision-making engine
├── VM # Virtual machine simulation
├── Host # Physical server simulation
├── Datacenter # Control plane orchestrator
└── ExperimentRunner # Test framework
- Prediction Phase: ML predictor analyzes past workload patterns (5-step history)
- Decision Phase: Agent classifies hosts as underloaded/overloaded based on predictions
- Execution Phase: Best-fit placement algorithm migrates VMs to optimize resource usage
- Power Management: Empty hosts are powered down to save energy
Based on 300-step simulations with 10 hosts and 25 VMs:
| Metric | Steady Load | Peak Load | Variable Load | Average |
|---|---|---|---|---|
| Energy Savings | +3.03% | -0.80% | +3.13% | +1.78% |
| SLA Improvement | +30.65% | +10.64% | +41.38% | +27.56% |
ML approach reduces SLA violations by 27.56% on average
Best performance in variable workload scenarios (+41.38% SLA improvement)
Peak load scenario shows negative energy savings due to aggressive migrations
Trade-off: ML makes more migrations but prevents more SLA violations
python --version # Requires Python 3.7+
pip install -r requirements.txtpython run_experiments.pyThis will:
- Run FFD baseline and ML approach across 3 scenarios
- Generate results in
results/folder - Create comparison charts automatically
# Text report
cat results/report.txt
# JSON data
cat results/results.json
# Charts (open in image viewer)
open results/comparison.png
open results/energy_steady_load.png
open results/energy_peak_load.png
open results/energy_variable_load.pngCS493/
├── ml_consolidation_testing.py # Main simulation code
├── run_experiments.py # Quick start script
├── requirements.txt # Python dependencies
├── README.md # This file
└── results/ # Output directory
├── results.json # Raw metrics
├── report.txt # Detailed analysis
├── comparison.png # Multi-scenario comparison
└── energy_*.png # Time-series plots
Modify parameters in run_experiments.py:
runner = ExperimentRunner(
num_hosts=10, # Number of physical servers
host_cpu=200, # CPU capacity per host
num_vms=25, # Number of virtual machines
vm_cpus=[15, 25, 35, ...], # VM resource requirements
num_steps=300, # Simulation length
consolidation_interval=8 # How often to consolidate
)- Steady Load: Gradual daily cycles with 20% utilization variation
- Peak Load: Two distinct peak periods (60% → 80% utilization)
- Variable Load: Flash crowds with exponential spikes and sustained loads
P(util) = {
0 W if host is powered off
50 W if host is idle (no VMs)
100 + 200·u² if host is active (quadratic power curve)
}
- Energy overhead: 50 Wh per VM migration
- Applied to both FFD and ML approaches
This project demonstrates key concepts from CS493 Virtualization:
- Resource Management: Dynamic VM placement and consolidation
- Energy Efficiency: Power-aware scheduling and host management
- QoS Guarantees: SLA violation tracking and prevention
- Machine Learning: Predictive analytics for proactive optimization
- Reactive: Responds to current utilization only
- Strategy: Sort VMs by size (largest first), place in first available host
- Thresholds: Migrate if host < 30% or > 75% utilized
- Proactive: Uses EWMA prediction (α=0.3, 5-step history)
- Strategy: Best-fit placement based on predicted workload
- Thresholds: Migrate if current AND predicted < 20% or > 80%
- Beloglazov, A., & Buyya, R. (2012). "Optimal online deterministic algorithms and adaptive heuristics for energy and performance efficient dynamic consolidation of virtual machines in Cloud data centers"
- Chen, Z., et al. (2020). "Workload prediction for cloud resource management"
This is an academic project for CS493:
- Course: CS493 Virtualization, Spring 2026
Academic use only - CS493 Course Project
- Implement LSTM for longer-term prediction
- Add multi-resource constraints (CPU, memory, network)
- Support live migration cost modeling
- Integrate with real cloud traces (Google, Azure)
- Hyperparameter tuning for ML predictor
Last Updated: January 23, 2026