Expose per-VM details and stats on VmDomain (vCPUs, memory, disks, IPs, autostart, live usage)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with vms.model.ts and VmsService, which the issue identifies as the VM model and existing libvirt connection entry point. Review the current VmDomain fields and how vm.start and vm.stop use that connection. Done means exposing the requested per-VM configuration, disk, network and uptime details, with optional live stats and nullable IPs; the issue does not name tests to run.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem?
VmDomain exposes only id, name and state (uuid was added on main). A client can list VMs and start or stop them, but it can't show anything about a VM: how many vCPUs or how much memory it has, its disks, its IP address, whether it autostarts, or how busy it is. Docker containers get far more (image, status, ports and mounts, plus dockerContainerStats for live CPU and memory), so remote clients can show a useful container detail view but not a VM one.
I'm building an Android remote for Unraid (urrt) on the official API, and the VM tab can't go beyond a name, a state pill and action buttons.
Describe the solution you'd like
Add fields to VmDomain, all of which libvirt already provides on the server:
- Configuration (from the domain XML /
virDomainGetInfo):vcpus,memoryandmaxMemory(bytes),autostart,osType/machine, and the template icon (as the webGUI shows). - Disks: a list of
{ target (vda), source path, bus, capacity, allocation }(virDomainGetBlockInfo). - Network: a list of
{ mac, model, bridge or network, ipAddresses }, where the guest agent or DHCP lease reports them (virDomainInterfaceAddresses). - Live stats (optional, e.g. a
vmStatssubscription mirroringdockerContainerStats): CPU percent, memory in use, disk read/write and network rx/tx bytes per second (virConnectGetAllDomainStats/virDomainGetCPUStats). - Uptime / last state change, if available.
Everything can be nullable, so a VM without a guest agent simply returns null for its IPs.
Describe alternatives you've considered
- Reading the webGUI's VM pages: needs a browser session, not an API key, and isn't a stable interface.
- A companion plugin calling
virshon the server: works, but asks every user to install and trust another service for data the API process already has access to. - SSH from the client: not acceptable for a phone app.
Additional context
- Related, not duplicate: #2036 adds a server-wide memory breakdown that includes VMs as a whole; this asks for per-VM detail.
- Mutations like
vm.startandvm.stopalready use the same libvirt connection (VmsService), so the data is one call away. - Read access could stay behind the existing
VMS:READ_ANYpermission.
Environment (if relevant)
Unraid OS Version: 7.3.3 and 7.4.0-rc.1 (API 4.37.5); fields checked by schema introspection and in vms.model.ts on main.
Pre-submission Checklist
- I have searched existing issues to ensure this feature hasn't already been requested
- This is not an Unraid Connect related feature (if it is, please submit via the support form instead)
- I have provided clear examples or use cases for the feature
- 主要语言
- TypeScript
- 星标
- 115
- 派生
- 23
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
unraid/api 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 64/100
维护者通常 1 天内回复
相似的 Issue
-
area: repo priority: P2 type: bug
难度 2/5 1-3 小时 新手友好度 76/100
appandflow/stim#4107 · 1 条评论 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1-3 小时 新手友好度 60/100
lingdojo/kana-dojo#32859 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
code-quality refactoring
难度 2/5 1-3 小时 新手友好度 78/100
github/gh-aw-firewall#10364 ·
维护者通常 1 天内回复
-
Merge the duplicate kaffir_corn record into sorghum可能已有人在做 @Crypto-Shroom 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
Crypto-Shroom/Bird-Feed-Calculator#322 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
drizzle-team/drizzle-orm#6552 ·
维护者通常 2 天内回复