Skip to content

Comments

feat(vm-summary): show guest hostname and OS from QEMU guest agent#57

Open
ry-ops wants to merge 1 commit intoPegaProx:mainfrom
ry-ops:feat/vm-summary-guest-info
Open

feat(vm-summary): show guest hostname and OS from QEMU guest agent#57
ry-ops wants to merge 1 commit intoPegaProx:mainfrom
ry-ops:feat/vm-summary-guest-info

Conversation

@ry-ops
Copy link
Contributor

@ry-ops ry-ops commented Feb 21, 2026

Summary

Implements the approved feature request from #50.

Admins can now see the guest hostname and OS pretty-name (e.g. Ubuntu 22.04.3 LTS) directly in the VM Summary panel without opening a console or SSH session — useful for identifying VMs and checking patch levels at a glance.

Backend (pegaprox_multi_cluster.py)

  • New ProxmoxManager.get_guest_info(node, vmid) method — calls two PVE guest agent endpoints:
    • GET /nodes/{node}/qemu/{vmid}/agent/get-host-name
    • GET /nodes/{node}/qemu/{vmid}/agent/get-osinfo
  • Returns {hostname, os_pretty_name} with null values when the agent is unavailable; errors are logged at DEBUG level so they don't spam logs for stopped VMs
  • New Flask route: GET /api/clusters/<id>/vms/<node>/qemu/<vmid>/guest-info (requires vm.view)

Frontend (web/index.html)

  • VmDetailPanel fetches guest info on mount when the selected VM is a running QEMU VM
  • A new info row is rendered below the CPU/RAM/Disk/Uptime cards, showing Hostname and OS side-by-side
  • The row is hidden entirely when both values are null — no visual noise for LXCs, stopped VMs, or VMs without the guest agent
  • Added translation keys guestHostname / guestOsName for both EN and DE

Test plan

  • Select a running QEMU VM with qemu-guest-agent installed — Hostname and OS row appears below metrics
  • Select a stopped QEMU VM — guest info row is hidden
  • Select an LXC container — guest info row is hidden
  • Select a running QEMU VM without guest agent — row is hidden (API returns nulls gracefully)
  • Verify EN and DE language labels render correctly

🤖 Generated with Claude Code

Implements the approved feature request in issue PegaProx#50.

Backend (pegaprox_multi_cluster.py):
- Add `ProxmoxManager.get_guest_info(node, vmid)` which calls the PVE
  guest agent endpoints:
    - `/nodes/{node}/qemu/{vmid}/agent/get-host-name`
    - `/nodes/{node}/qemu/{vmid}/agent/get-osinfo`
  Returns `{hostname, os_pretty_name}` with null values when the agent
  is unavailable or the VM is stopped — callers handle this gracefully.
- Add Flask route `GET /api/clusters/<id>/vms/<node>/qemu/<vmid>/guest-info`
  protected by `vm.view` permission.

Frontend (web/index.html):
- Fetch guest info in `VmDetailPanel` via a `useEffect` that fires when
  a running QEMU VM is selected; result is stored in `guestInfo` state.
- Render a new info row beneath the CPU/RAM/Disk/Uptime metric cards
  showing Hostname and OS side-by-side. Row is hidden when both values
  are null (agent not running, LXC container, or VM stopped).
- Add translation keys `guestHostname` / `guestOsName` for EN and DE.

Fixes PegaProx#50

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant