feat: Cloud Hypervisor 执行器生产级 v1(cloud-hypervisor)

单任务单 VM:API 唤醒(preflight→vmm.ping→vm.create→vm.boot→SSH 就绪)、
暂停/快照/休眠等价/关闭/回收、预热快照池、每任务磁盘 copy、容量与磁盘配额门、
受控 egress fail-closed、VM 事件审计与分类失败;worker/server/autoscaler 接线
(executor=cloud-hypervisor,任务内 LLM 不可自选);默认关闭,不进生产路由。
未做真实 VM 验证:生产主机与本 VM 均无 /dev/kvm、无嵌套虚拟化,验证为 mock +
干跑命令 + 单元测试;真 VM、快照恢复、压测、安全审计见
docs/chv-production-readiness.md。CI 账单故障仍是硬门禁,本提交只到 PR OPEN。
This commit is contained in:
host committed 2026-10-30 18:54:16 +00:00
1 parent aebc6238a6
commit c371bbdf1e
9 files changed
+2364 -11

No files matched your search

+10
View File
@@ -304,6 +304,14 @@ class Autoscaler:
if not any(a == "--host-name" or a.startswith("--host-name=")
for a in self.worker_args):
cmd.extend(["--host-name", socket.gethostname()])
# 执行器透传:scaler 的 --executor 只算该类型队列深度,
# 不透传时拉起的 worker 默认 local,永远认领不到该类型
# 任务(cloud-hypervisor 池就是这样被饿死的)。worker_args
# 里已显式给 --executor 时以显式为准,不覆盖。
if self.executor and not any(
a == "--executor" or a.startswith("--executor=")
for a in self.worker_args):
cmd.extend(["--executor", self.executor])
return cmd
def _start_worker(self, worker_id):
@@ -553,6 +561,8 @@ def main(argv=None):
help="各 worker 子进程的日志目录")
parser.add_argument("--executor", default=None,
help="只按该执行器类型的就绪任务算深度;"
"同时透传给拉起的 worker(worker_args 里"
"已显式给 --executor 时以显式为准);"
"不给时按全部任务算(可能轻微多扩,"
"受 max-workers 封顶)")
parser.add_argument("worker_args", nargs=argparse.REMAINDER,