feat(vm): Medien pro VM (disk/floppy/iso) + ARIA-Urteilswissen
vm_register + Registry + boot fassen jetzt das ECHTE Boot-Medium (disk/floppy/ iso) — Eintrag, Startbefehl und App-Start spiegeln die reale Config. Leer = aria-vm erkennt disk.qcow2/floppy.img/cdrom.iso selbst. - project_vms.add_vm: floppy/disk-Felder. - main.py: VmAddBody + _vm_boot_args (baut --disk/--floppy/--iso), boot-Endpoint + boot_cmd nutzen sie. - agent.py: vm_register-Tool bekommt disk/floppy/iso. - Seed-Regel: URTEIL — VM nur wenn sinnvoll; Medium aus der Situation (Festplatte fuer DOS-Spiele, Diskette fuer OS-Dev, ISO fuer Installer); Architektur zum Task (ARM=aarch64, emuliert/langsam ok); Aenderungs-Zyklus stop→aendern→boot. py_compile clean. aria-vm schon live auf dem Host. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,12 @@ def get_vm(project_id: str, name: str) -> Optional[dict]:
|
||||
|
||||
|
||||
def add_vm(project_id: str, name: str, arch: str, iso: str = "",
|
||||
floppy: str = "", disk: str = "",
|
||||
vnc_display: int = 1, mem: int = 1024) -> dict:
|
||||
"""Registriert/aktualisiert eine VM. Medien (disk/floppy/iso) sind optional —
|
||||
leer = aria-vm erkennt disk.qcow2/floppy.img/cdrom.iso im VM-Ordner selbst.
|
||||
ARIA setzt hier, was sie zum Task passend gebaut hat (Festplatte fuer DOS-
|
||||
Spiele, Diskette fuer OS-Dev, ISO fuer Installer)."""
|
||||
if not NAME_RE.match(name or ""):
|
||||
raise ValueError(f"Ungueltiger VM-Name: {name!r} (nur a-z0-9_-, max 40)")
|
||||
if arch not in VALID_ARCH:
|
||||
@@ -60,14 +65,14 @@ def add_vm(project_id: str, name: str, arch: str, iso: str = "",
|
||||
data = _load()
|
||||
lst = data.setdefault(project_id or "", [])
|
||||
now = int(time.time())
|
||||
fields = {"arch": arch, "iso": iso, "floppy": floppy, "disk": disk,
|
||||
"vnc_display": int(vnc_display), "mem": int(mem), "updated_at": now}
|
||||
for v in lst:
|
||||
if v.get("name") == name:
|
||||
v.update({"arch": arch, "iso": iso, "vnc_display": int(vnc_display),
|
||||
"mem": int(mem), "updated_at": now})
|
||||
v.update(fields)
|
||||
_save(data)
|
||||
return v
|
||||
vm = {"name": name, "arch": arch, "iso": iso, "vnc_display": int(vnc_display),
|
||||
"mem": int(mem), "created_at": now, "updated_at": now}
|
||||
vm = {"name": name, "created_at": now, **fields}
|
||||
lst.append(vm)
|
||||
_save(data)
|
||||
return vm
|
||||
|
||||
Reference in New Issue
Block a user