vrapl's True Purpose: A Transport Mechanism Reference Implementation
Misconception vs Reality
❌ WRONG Understanding:
"vrapl competes with Kepler/Scaphandre on power attribution algorithms"
✅ CORRECT Understanding:
"vrapl demonstrates how cloud providers can expose RAPL data to guest VMs, enabling ALL power monitoring tools to work accurately"
The Real Problem vrapl Solves
Current Cloud VM Situation
┌─────────────────────────────────────────────────┐
│ AWS EC2 / GCP Compute / Azure VM │
│ │
│ Inside the Guest VM: │
│ ❌ No /sys/class/powercap/ │
│ ❌ No RAPL MSR access │
│ ❌ No hardware power metrics │
│ │
│ Result: │
│ ⚠️ Kepler falls back to ML estimator │
│ ❌ Scaphandre doesn't work (Issue #25) │
│ ⚠️ All tools use approximations/models │
│ 📊 Accuracy: LOW (trends only) │
└─────────────────────────────────────────────────┘
With vrapl's Approach
┌─────────────────────────────────────────────────┐
│ Cloud Provider Hypervisor (Host) │
│ │
│ ✅ Reads host RAPL from hardware │
│ ✅ Attributes power to each VM (any method) │
│ ✅ Exposes VM-specific data to guest │
│ │
│ Transport Mechanism: │
│ • vrapl: Serial port (current demo) │
│ • Future: virtio-power device │
│ • Future: Virtual sysfs │
└───────────────┬─────────────────────────────────┘
│
│ VM gets hardware-based power data
↓
┌─────────────────────────────────────────────────┐
│ Guest VM (Any Cloud Provider) │
│ │
│ ✅ Receives RAPL-based power data │
│ ✅ Kepler can use real data │
│ ✅ Scaphandre can use real data │
│ ✅ PowerJoular can use real data │
│ ✅ Any tool works accurately │
│ 📊 Accuracy: HIGH (hardware-based) │
└─────────────────────────────────────────────────┘
vrapl is NOT About Attribution Algorithms
What vrapl DOES care about:
- ✅ Transport mechanism - How to get data from host to guest
- ✅ Reference implementation - Proof that it's feasible
- ✅ Standards proposal - Show cloud providers a path forward
- ✅ Simplicity - Make it easy to understand and adopt
What vrapl DOES NOT care about:
- ❌ Competing with Kepler's instruction-level attribution
- ❌ Competing with Scaphandre's process monitoring
- ❌ Being the "best" power attribution algorithm
- ❌ Replacing existing tools
The Vision: Enable All Tools
Once cloud providers expose RAPL to VMs (using vrapl's approach or similar):
User Choice Inside VM:
├── Option 1: Install Kepler
│ └── Uses eBPF + hardware counters + RAPL data from host
│ └── ✅ Accurate container-level attribution
│
├── Option 2: Install Scaphandre
│ └── Uses CPU time + RAPL data from host
│ └── ✅ Accurate process-level attribution
│
├── Option 3: Install PowerJoular
│ └── Uses RAPL data from host
│ └── ✅ Accurate per-process monitoring
│
└── Option 4: Custom solution
└── Read VM power from standard interface
└── ✅ Build your own tools
vrapl doesn't care which one you choose - it just enables them all to work!
vrapl's Core Innovation: The Transport
Current vrapl Implementation:
Serial Port Communication:
Host Side (vrapl):
1. Read RAPL from /sys/class/powercap/
2. Attribute to VM using CPU time ratio
3. Send to guest via virtio-serial
Guest Side:
1. Read from /dev/vport0p1
2. Parse "vRAPL_Watts: X.XX"
3. Use data however you want
Why this works:
- ✅ No filesystem sharing needed
- ✅ Real-time streaming
- ✅ Simple to implement
- ✅ Works with any guest OS
- ✅ Demonstrates feasibility
Future Standard (Goal):
Proposed: virtio-power device
Host:
- Calculates VM power attribution
- Exposes via virtio device
Guest:
- Sees /sys/class/power_cap/vm-power/
- Standard Linux interface
- All tools work natively
Comparison: Transport Mechanisms
vrapl (Serial Port)
Pros:
✅ Simple implementation
✅ No kernel modifications in guest
✅ Real-time streaming
✅ Works with any guest OS
Cons:
❌ Non-standard interface
❌ Requires serial port config
❌ Not discoverable
Scaphandre (Filesystem Sharing)
Pros:
✅ Can work with shared folders
Cons:
❌ Requires VM filesystem sharing
❌ More complex setup
❌ Polling-based (not streaming)
❌ Doesn't work on standard cloud VMs
QEMU vRAPL (MSR Exposure)
Pros:
✅ Official QEMU feature
✅ Direct MSR access
Cons:
❌ Security concerns (raw MSR access)
❌ Still requires calculation in guest
❌ Not attribution, just raw RAPL
❌ Requires qemu-vmsr-helper
Future virtio-power (Proposal)
Pros:
✅ Standard interface
✅ Native Linux support
✅ Discoverable
✅ Secure by design
✅ Works like real RAPL
Cons:
⚠️ Doesn't exist yet
⚠️ Requires kernel changes
⚠️ Needs industry adoption
What Makes vrapl Valuable
1. Proof of Concept
Shows it's technically feasible:
- ✅ Host can attribute power to VMs
- ✅ Data can be transmitted to guest
- ✅ Guest can consume the data
- ✅ Works in real-world scenarios
2. Simple Reference Implementation
Easy for cloud providers to understand:
- ~200 lines of Go code
- Clear algorithm (CPU time proportional)
- Minimal dependencies
- Production-ready code
3. Demonstrates the Gap
Highlights what's missing:
- AWS/GCP/Azure don't do this
- Kepler/Scaphandre can't get accurate data
- Industry needs a standard
- vrapl shows one possible solution
4. Basis for Standardization
Could lead to:
- virtio-power device specification
- Cloud provider APIs for power metrics
- Standard /sys/class/vm-power/ interface
- QEMU/KVM upstream integration
Success Criteria for vrapl
Primary Goal: Enable Tools
✅ Once vrapl runs on host, can tools in guest get accurate power data?
- Yes, they receive hardware-based RAPL measurements
- Not model-based estimates
- Good enough for Kepler/Scaphandre to use
Secondary Goal: Demonstrate Feasibility
✅ Can cloud providers realistically implement this?
- Yes, simple code
- Low overhead
- Standard Linux interfaces
- Proven approach
Tertiary Goal: Influence Standards
⏳ Will this lead to industry adoption?
- TBD - requires outreach
- QEMU/KVM proposal
- Cloud provider discussions
- CNCF TAG Environmental Sustainability
Updated Comparison: Transport Focus
| Aspect |
vrapl |
Scaphandre Qemu |
QEMU vRAPL |
Ideal (virtio-power) |
| Transport |
Serial |
Filesystem |
MSR |
virtio device |
| Setup Complexity |
🟢 Low |
🟡 Medium |
🟡 Medium |
🟢 Low |
| Real-time |
✅ Yes |
❌ No (polling) |
✅ Yes |
✅ Yes |
| Standard Interface |
❌ No |
❌ No |
⚠️ Raw MSR |
✅ Yes |
| Security |
✅ Safe |
✅ Safe |
⚠️ MSR access |
✅ Safe |
| Attribution Done |
Host |
Host |
❌ Guest must do |
Host |
| Guest Complexity |
🟢 Read serial |
🟡 Read file |
🔴 Calculate |
🟢 Read sysfs |
| Exists Today |
✅ Yes |
⚠️ Partial |
✅ Yes |
❌ No |
The Real Innovation
vrapl's Contribution to the Ecosystem:
Before vrapl:
❓ "Can VMs get accurate power data?"
→ Maybe theoretically, but no proof
With vrapl:
✅ "Yes, here's working code that does it"
→ Demonstrates feasibility
→ Shows one transport mechanism
→ Reference for cloud providers
This Enables:
- Accurate Kepler - No need for ML estimator
- Working Scaphandre - Solves Issue #25
- Better Power Tools - All get real data
- Cloud Transparency - Users see actual power
- Carbon Accounting - Based on measurements, not models
Next Steps with Correct Understanding
Immediate (Prove the Concept):
- ✅ Document transport mechanism clearly
- ✅ Show it works with real VMs
- ✅ Measure overhead and accuracy
- ✅ Create guest-side consumer examples
Medium-term (Alternative Transports):
- Implement virtio device prototype
- Implement virtual sysfs approach
- Compare transport mechanisms
- Document trade-offs
Long-term (Industry Adoption):
- Propose to QEMU/KVM - virtio-power device
- Engage cloud providers - Show them vrapl
- CNCF TAG - Present at sustainability meetings
- Standards body - Propose standard interface
- Academic paper - Publish findings
Corrected Positioning
vrapl is:
- ✅ A transport mechanism reference implementation
- ✅ A proof of concept for cloud providers
- ✅ An enabler for existing tools (Kepler, Scaphandre)
- ✅ A standard proposal (virtio-power device)
vrapl is NOT:
- ❌ A competitor to Kepler/Scaphandre
- ❌ Trying to have the "best" attribution algorithm
- ❌ A complete monitoring solution
- ❌ Meant to replace existing tools
The Bigger Picture
Problem Statement:
"Cloud VMs cannot access hardware power metrics, forcing all tools to use inaccurate models"
vrapl's Solution:
"Show cloud providers how to expose RAPL to VMs via a simple transport mechanism, enabling all existing tools to work accurately"
Impact:
"Once cloud providers adopt this (or similar), Kepler, Scaphandre, and all other tools get accurate hardware-based data instead of estimates"
Call to Action for Cloud Providers
Dear AWS, GCP, Azure:
vrapl demonstrates that you can:
- ✅ Attribute power to VMs using RAPL
- ✅ Expose this data to guests safely
- ✅ Enable accurate power monitoring for tenants
- ✅ Improve carbon accounting transparency
Implementation options:
- Option A: Use vrapl's serial approach (simple, works today)
- Option B: Implement virtio-power device (standard, better long-term)
- Option C: Cloud-specific metadata API (your choice)
Benefits:
- ✅ Tenants get accurate power data
- ✅ Better carbon accounting
- ✅ Sustainability transparency
- ✅ Competitive advantage
vrapl is the proof it's possible. Now it's your turn to implement it at scale.
References
vrapl's True Purpose: A Transport Mechanism Reference Implementation
Misconception vs Reality
❌ WRONG Understanding:
"vrapl competes with Kepler/Scaphandre on power attribution algorithms"
✅ CORRECT Understanding:
"vrapl demonstrates how cloud providers can expose RAPL data to guest VMs, enabling ALL power monitoring tools to work accurately"
The Real Problem vrapl Solves
Current Cloud VM Situation
With vrapl's Approach
vrapl is NOT About Attribution Algorithms
What vrapl DOES care about:
What vrapl DOES NOT care about:
The Vision: Enable All Tools
Once cloud providers expose RAPL to VMs (using vrapl's approach or similar):
vrapl doesn't care which one you choose - it just enables them all to work!
vrapl's Core Innovation: The Transport
Current vrapl Implementation:
Serial Port Communication:
Why this works:
Future Standard (Goal):
Proposed: virtio-power device
Comparison: Transport Mechanisms
vrapl (Serial Port)
Scaphandre (Filesystem Sharing)
QEMU vRAPL (MSR Exposure)
Future virtio-power (Proposal)
What Makes vrapl Valuable
1. Proof of Concept
Shows it's technically feasible:
2. Simple Reference Implementation
Easy for cloud providers to understand:
3. Demonstrates the Gap
Highlights what's missing:
4. Basis for Standardization
Could lead to:
Success Criteria for vrapl
Primary Goal: Enable Tools
✅ Once vrapl runs on host, can tools in guest get accurate power data?
Secondary Goal: Demonstrate Feasibility
✅ Can cloud providers realistically implement this?
Tertiary Goal: Influence Standards
⏳ Will this lead to industry adoption?
Updated Comparison: Transport Focus
The Real Innovation
vrapl's Contribution to the Ecosystem:
This Enables:
Next Steps with Correct Understanding
Immediate (Prove the Concept):
Medium-term (Alternative Transports):
Long-term (Industry Adoption):
Corrected Positioning
vrapl is:
vrapl is NOT:
The Bigger Picture
Problem Statement:
vrapl's Solution:
Impact:
Call to Action for Cloud Providers
Dear AWS, GCP, Azure:
vrapl demonstrates that you can:
Implementation options:
Benefits:
vrapl is the proof it's possible. Now it's your turn to implement it at scale.
References