hero-cloud — slice-based VM compute manager using hero_rpc OSIS framework #1

Closed
opened 2026-03-04 08:31:44 +00:00 by mahmoud · 1 comment
Owner

Description

Build a new Hero Cloud server to replace the existing broken implementation.
Hero Cloud is a virtual machine manager that runs on a physical host and manages
VMs using the Hero RPC framework. The key change from the old implementation is
replacing raw memory/storage allocation with a slice-based resource model.

What is a Slice?

A slice is the atomic unit of compute capacity — always exactly 4GB RAM plus
a proportional share of the host's SSD storage.

Slice math:

  • On startup, detect total RAM and total disk
  • Reserve 1GB for the OS
  • slice_count = floor((total_ram - 1) / 4)
  • disk_per_slice = floor(total_disk / slice_count)

Example: 32GB RAM, 2TB SSD → 7 slices, each with 4GB RAM and ~292GB disk


Requirements

  • Built using the Hero RPC framework (hero_rpc_osis / OServer)
  • On startup: auto-detect total RAM and disk from hardware (/proc/meminfo, df)
  • On startup: auto-create slices based on detected hardware
  • Slice = exactly 4GB RAM + proportional disk
  • Reserve 1GB for OS (not allocatable)
  • VM deploy always requires selecting a slice by slice_sid
  • Validate slice is Free before deploying a VM
  • Mark slice as InUse after VM is deployed
  • Free slice back to Free when VM is deleted
  • VM status visible via list_vms and get_vm
  • Attach VM to Cloud Hypervisor via attach_hypervisor
  • Integrate with chvm-lib (Cloud Hypervisor backend)
  • Mycelium IPv6 networking support per VM
  • OpenRPC spec auto-generated for future TF Grid binding
  • SDK client generated from OpenRPC spec
  • Admin UI dashboard

Out of Scope (for now)

  • Authentication (Unix socket = local only)
  • TF Grid Rust SDK (can be done later in Go against the OpenRPC spec)
  • Multi-node support (single host only for now)

RPC Methods

Node: node_register, node_status
Slices: list_slices, get_slice
VMs: deploy_vm, start_vm, stop_vm, restart_vm, delete_vm, list_vms, get_vm, attach_hypervisor, vm_logs, vm_exec


References

  • Hero RPC framework: https://forge.ourworld.tf/lhumina_code/hero_rpc
  • Cloud Hypervisor backend: https://forge.ourworld.tf/geomind_code/my_hypervisor
  • Old implementation (for reference only): https://forge.ourworld.tf/lhumina_code/hero_compute_manager
### Description Build a new **Hero Cloud** server to replace the existing broken implementation. Hero Cloud is a virtual machine manager that runs on a physical host and manages VMs using the Hero RPC framework. The key change from the old implementation is replacing raw memory/storage allocation with a **slice-based resource model**. ### What is a Slice? A slice is the atomic unit of compute capacity — always exactly **4GB RAM** plus a proportional share of the host's SSD storage. **Slice math:** - On startup, detect total RAM and total disk - Reserve 1GB for the OS - `slice_count = floor((total_ram - 1) / 4)` - `disk_per_slice = floor(total_disk / slice_count)` Example: 32GB RAM, 2TB SSD → 7 slices, each with 4GB RAM and ~292GB disk --- ### Requirements - [x] Built using the Hero RPC framework (`hero_rpc_osis` / `OServer`) - [x] On startup: auto-detect total RAM and disk from hardware (`/proc/meminfo`, `df`) - [x] On startup: auto-create slices based on detected hardware - [x] Slice = exactly 4GB RAM + proportional disk - [x] Reserve 1GB for OS (not allocatable) - [x] VM deploy always requires selecting a slice by `slice_sid` - [x] Validate slice is `Free` before deploying a VM - [x] Mark slice as `InUse` after VM is deployed - [x] Free slice back to `Free` when VM is deleted - [x] VM status visible via `list_vms` and `get_vm` - [x] Attach VM to Cloud Hypervisor via `attach_hypervisor` - [x] Integrate with `chvm-lib` (Cloud Hypervisor backend) - [x] Mycelium IPv6 networking support per VM - [x] OpenRPC spec auto-generated for future TF Grid binding - [x] SDK client generated from OpenRPC spec - [x] Admin UI dashboard --- ### Out of Scope (for now) - Authentication (Unix socket = local only) - TF Grid Rust SDK (can be done later in Go against the OpenRPC spec) - Multi-node support (single host only for now) --- ### RPC Methods **Node:** `node_register`, `node_status` **Slices:** `list_slices`, `get_slice` **VMs:** `deploy_vm`, `start_vm`, `stop_vm`, `restart_vm`, `delete_vm`, `list_vms`, `get_vm`, `attach_hypervisor`, `vm_logs`, `vm_exec` --- ### References - Hero RPC framework: `https://forge.ourworld.tf/lhumina_code/hero_rpc` - Cloud Hypervisor backend: `https://forge.ourworld.tf/geomind_code/my_hypervisor` - Old implementation (for reference only): `https://forge.ourworld.tf/lhumina_code/hero_compute_manager`
mahmoud self-assigned this 2026-03-04 08:31:50 +00:00
despiegk added this to the now milestone 2026-03-09 10:11:11 +00:00
Author
Owner

Done

Done
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_compute#1
No description provided.