Skip to content

bug(api): bulk VM management routes fail — inventory missing host group connection details #61

@pparage

Description

@pparage

Problem

Bulk VM management routes under /v0/admin/run/bundles/core/proxmox/configure/default/ fail with RC=1 because the backend's inventory file doesn't define connection details (ansible_host, ansible_user, etc.) for the host groups these playbooks target.

Evidence (tested on pve01 deployment 2026-03-18)

Request:

POST /v0/admin/run/bundles/core/proxmox/configure/default/stop-vms-vuln

Ansible error:

[ERROR]: Specified inventory, host pattern and/or --limit leaves us with no hosts to target.

Root Cause

The bundle playbooks target host groups like r42_vuln_box_group, r42_admin, r42_student_box_group. The backend's inventory/hosts.yml defines these groups but only with hostnames — no ansible_host, ansible_user, or ansible_connection variables.

The inventory needs either:

  • Full connection details for each host in the groups
  • Or the playbooks need to target the proxmox host group and use the API (like individual VM routes do)

Affected Routes (24 total)

All routes matching /v0/admin/run/bundles/core/proxmox/configure/default/*:

  • start-vms-{admin,student,vuln}
  • stop-vms-{admin,student,vuln}
  • pause-vms-{admin,student,vuln}
  • resume-vms-{admin,student,vuln}
  • create-vms-{admin,student,vuln}
  • delete-vms-{admin,student,vuln}
  • snapshot/create-vms-{admin,student,vuln}
  • snapshot/revert-vms-{admin,student,vuln}

Working Routes (for reference)

Individual VM operations via Proxmox API work correctly:

  • vms/vm_id/start, stop, pause, resume — all RC=0
  • These target proxmox host group which has proper API token config

Related

  • Tracked in range42/project_management#66

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtrack_axis-00Core stabilisation and hardening

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions