A simulation project built on CloudSim 3.0.3, focused on minimizing energy consumption and optimizing resource usage through intelligent VM allocation and real-time metrics monitoring.
This project simulates energy-aware cloud resource allocation in a datacenter environment. It demonstrates the effectiveness of dynamic VM placement strategies and live performance tracking in reducing energy wastage and improving load balancing.
Key aspects include:
- Dynamic VM allocation based on current host utilization
- Real-time monitoring of resource metrics
- Energy-efficient modeling and evaluation
- Full automation via CI/CD pipelines
- Data visualization and reporting
- ✅ Energy-aware VM Allocation Policy
- 📊 Host-level real-time metrics (CPU, energy, VM load)
- ⚙️ Load balancing across heterogeneous hosts
- 🧪 Simulation execution via CI/CD (GitHub Actions)
- 📈 Automatic results generation in CSV/HTML
- Java JDK 11+
- CloudSim 3.0.3 (included in
/lib
) - GitHub Actions for CI/CD
# Clone the repository
git clone https://github.com/your-repo/cloudsim-energy-aware.git
cd cloudsim-energy-aware
# Compile and run the simulation
javac -Xlint:unchecked -cp "lib/cloudsim-3.0.3.jar" -d bin src/org/cloudbus/cloudsim/*.java
java -cp "bin;lib/cloudsim-3.0.3.jar" org.cloudbus.cloudsim.Main
Just push to the main branch or open a PR. GitHub Actions will:
- Build the project
- Run the simulation
- Archive the results
- Hosts and VMs are initialized with varying MIPS capacities.
- VMs are dynamically allocated to the least-utilized suitable host.
- Cloudlets (tasks) are assigned and executed on VMs.
- The system records CPU utilization, energy consumption, and performance per host.
Metric | Description |
---|---|
CPU Utilization | % used = Σ VM MIPS / Host MIPS |
Energy Used | Based on host power model and utilization |
VM Distribution | How evenly VMs are allocated across hosts |
Execution Time | Per-cloudlet processing duration |
====== CLOUDSIM SIMULATION RESULTS ======
Cloudlet ID | Status | VM ID | Execution Time
----------------------------------------
0 | SUCCESS | 0 | 8.10s
1 | SUCCESS | 1 | 16.10s
2 | SUCCESS | 2 | 24.10s
Host ID | CPU Util | Energy Used
-------------------------------
0 | 100.00% | 250.00 J
1 | 66.67% | 183.33 J
2 | 50.00% | 162.50 J
# .github/workflows/maven.yml
name: CloudSim CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
- name: Build and Test
run: |
mvn clean package
java -cp target/classes:lib/cloudsim-3.0.3.jar org.cloudbus.cloudsim.Main
- name: Archive results
uses: actions/upload-artifact@v2
with:
name: simulation-results
path: results/
public boolean allocateHostForVm(Vm vm) {
Host selectedHost = getHostList().stream()
.filter(host -> host.isSuitableForVm(vm))
.min(Comparator.comparingDouble(this::calculateCurrentUtilization))
.orElse(null);
// Allocation logic...
}
double energy = (idlePower + (maxPower - idlePower) * utilization)
* (simulationTime / 3600);
├── src/
│ └── main/java/org/cloudbus/cloudsim/
│ ├── Main.java
│ └── VmAllocationPolicyEnergyAware.java
├── lib/
│ └── cloudsim-3.0.3.jar
├── results/
│ ├── summary.csv
│ └── index.html
├── .github/workflows/
│ └── cloudsim-ci.yml
To tweak parameters like:
- Number of VMs or Hosts
- Power model constants
- Task (cloudlet) specifications
Edit:
src/main/java/org/cloudbus/cloudsim/Main.java
- 🔋 Green Cloud Initiatives
- 📉 Datacenter Cost Optimization
- 🔄 Adaptive Resource Scheduling
- 🧠 Autonomous Infrastructure Management
We welcome your contributions!
Fork the repo → Create a branch → Make changes → Submit a Pull Request 🚀
For issues, suggestions, or questions — please open an issue.