Skip to content

<feature>[zbs]: ZSV-12666 support whole-VM backup#4587

Open
ZStack-Robot wants to merge 1 commit into
feature-zsv-5.1.0-encryptionfrom
sync/zstackio/zbs-volume-encryption-backup@@4
Open

<feature>[zbs]: ZSV-12666 support whole-VM backup#4587
ZStack-Robot wants to merge 1 commit into
feature-zsv-5.1.0-encryptionfrom
sync/zstackio/zbs-volume-encryption-backup@@4

Conversation

@ZStack-Robot

Copy link
Copy Markdown
Collaborator

Summary

Support ZBS whole-VM backup restore on the existing VolumeBackup/ImageStore flow. Plain backup disks can be restored as encrypted ZBS disks through temporary cache conversion; the backup encryption property is not changed.

Changes

  • Add ordered external-primary-storage image download hooks and restore context.
  • Carry ZBS logical/backing size information through encrypted restore.
  • Keep the existing native clone and resize flow for encrypted cache snapshots.

Testing

  • cbok Groovy case: 1 test, 0 failures/errors/skips
  • Full/auto whole-VM backup, revert, three-disk restore matrix, and rollback injection coverage
  • cbok compile/deploy to 172.24.247.15
  • MN/UI status Running
  • CI pipeline

Resolves: ZSV-12666

sync from gitlab !10557

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c3629ad3-7bf6-4e8c-a820-559679d8c9a2

📥 Commits

Reviewing files that changed from the base of the PR and between 27aafe6 and 54d7d7b.

📒 Files selected for processing (3)
  • header/src/main/java/org/zstack/header/storage/addon/primary/ExternalPrimaryStorageImageDownloadContext.java
  • header/src/main/java/org/zstack/header/storage/addon/primary/ExternalPrimaryStorageImageDownloadExtensionPoint.java
  • storage/src/main/java/org/zstack/storage/addon/primary/ExternalPrimaryStorage.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/zstackio/zbs-volume-encryption-backup@@4

Comment @coderabbitai help to get the list of available commands.

@zstack-robot-2

Copy link
Copy Markdown
Collaborator

Comment from yaohua.wu:

Review: MR !10557 — ZSV-12666

Background (preserved across rounds)

  • Jira: ZSV-12666 — 【虚拟机加密】zbs-基于加密备份创建vm失败
  • Bug summary: ZBS 上从整机备份创建 VM 时,加密卷恢复链路无法正确处理备份密钥与临时缓存转换;明文备份还需要支持恢复为加密目标卷,且不能改变备份原始 bits/加密元数据。
  • Intent & scope: 在 ExternalPrimaryStorage 下载流程中加入可排序的扩展上下文与加密下载分支,由 premium 承接 ZBS/ImageStore 的密钥准备及下载实现。
  • Round 1 initial findings: 0 × P0, 0 × P1(本仓);联合链路存在 1 × P0,位于 zstack-store FUSE 并发导出。
  • Suggested fix direction: 本仓接口与 premium 调用契约保持不变;合入整组 MR 前先修复 zstack-store 的 FUSE 全局状态并发安全。

Findings

Severity File:Line Issue Fix
本仓 3 个文件未发现可发布的独立 finding。扩展上下文、字段类型及 premium 实现的调用契约一致。

关联 MR

MR 关系
premium !14769 实现 ZBS 加密备份密钥准备、ImageStore FUSE 导出编排及多盘恢复测试。
zstack-utility !7526 KVM agent 通过 sshfs 读取导出链并转换到 LUKS CBD 目标。
zstack-store !1158 新增 FUSE path 导出端点;当前存在并发导出可终止 agent 的联合阻塞问题。

Coverage

  • Local authoritative diff: 3/3 files;MCP 文件数一致;generated-file filter: 0 skipped。
  • Upstream freshness: target 比 source 新 2 个提交,无同文件重叠;MR 状态为 can_be_merged。其中包含 volume encryption 相关改动,需在整组 MR 合并结果上跑回归。
  • Cross-repo contract: ExternalPrimaryStorageImageDownloadContext 的 volume/remoteTarget/spec 字段与 premium 消费一致。
  • Reviewer dispatch degraded: 并行子审查通道不可用,已由主审逐文件读取并完成跨仓调用链核验。
  • Verification gap: 本机无 mvn,未独立执行 Java/Groovy 测试。

Verdict: REVISION_REQUIRED

本仓实现未发现独立阻塞项;联合交付被 zstack-store !1158 的 FUSE 并发安全问题阻塞。


🤖 Robot Reviewer

Add external primary storage download context for ZBS backup restore.

Keep temporary image key cleanup tied to image expunge extension.

Tests: git diff --cached --check.

Resolves: ZSV-12666

Change-Id: I7a0f3c2d91e4b58a6c01f92d3e84a6b77c9d0e12
@MatheMatrix
MatheMatrix force-pushed the sync/zstackio/zbs-volume-encryption-backup@@4 branch from 54d7d7b to 06d28e4 Compare July 16, 2026 11:02
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.

2 participants