Files
CLICD/docs/features/tasks.md
T
MengMengCode f2c14c01d3 feat: add instance storage workflows and shadcn monitoring charts
Add offline disk growth and managed data disks, portable full backups and
restore, independent clones and batch instance templates, and local ISO
and QCOW2 uploads. Persist task details and metric history in SQLite.

Replace hand-drawn host and instance charts with shadcn/ui Chart and
Recharts, keep numeric values and units together, and preserve responsive
layouts, icons, time ranges and full-sample statistics.

Validation: backend tests and vet; Linux KVM/LXC/API/config/server tests;
frontend and documentation production builds; real disk, reinstall,
backup, clone, upload, task-history and NAT tests; 37 cross-host restore
checks; responsive chart checks and read-only deployed verification.
Guest Windows restore behavior has not been tested on a running Windows VM.
2026-11-03 23:17:46 +08:00

1.5 KiB

任务与历史指标

任务页面集中显示生命周期操作、磁盘扩容、数据盘管理、完整备份、恢复、克隆和模板保存的状态、耗时、错误与阶段日志。同一个实例的耗时变更按顺序执行,不会并发删除正在修改的磁盘。

GET /api/v1/tasks
DELETE /api/v1/tasks/{task_id}

异步接口返回 202 后,使用 data.task_id 在任务列表中查询;done 表示成功,failed 时应查看 error 和阶段日志。运行中的任务不能从列表删除;删除已完成任务记录不会撤销其磁盘、备份或实例变更。

面板重启

  • 任务记录与阶段日志持久化到 SQLite,终态记录保留最多 30 天、1000 条;每个任务最多保留 200 条阶段事件。
  • 已排队、尚未开始的通用操作会恢复排队。
  • 服务重启时正在执行的磁盘、备份、恢复、克隆等通用操作会标记为 failed/interrupted,不会盲目重跑。检查实际资源状态后再决定是否重试。
  • 子用户只能看到授权实例对应的任务;内部执行参数和凭据不会作为任务结果返回。

资源历史

宿主机与实例 CPU、内存、网络和磁盘 I/O 历史按约 30 秒采样、持久化保存最多 7 天,服务重启后继续显示。指标不是连续监控期间的回填:停机和服务未运行的时段不会自动补样。

配置数据库的备份同时保护任务和指标历史;完整实例备份关注客户机磁盘与实例配置,不替代面板数据库备份。