<fix>[storage]: fix encrypted data volume host selection#4299
<fix>[storage]: fix encrypted data volume host selection#4299ZStack-Robot wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 45 minutes and 38 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
概述本 PR 为加密卷就地创建流程增加了宿主机自动选择能力:在调用方未提供 变更内容加密卷就地创建宿主机自动选择流程
时序图sequenceDiagram
rect rgba(135, 206, 235, 0.5)
Note over VolumeManagerImpl: create-data-volume-from-template
VolumeManagerImpl->>VolumeManagerImpl: 计算 encryptInPlaceRequired
VolumeManagerImpl->>PSCapacityExtensionPoint: getHostUuidFromAllocatedInstallUrl(installUrl)
PSCapacityExtensionPoint-->>VolumeManagerImpl: hostUuid 或 null
end
rect rgba(255, 200, 100, 0.5)
Note over VolumeManagerImpl: 宿主机兜底选择
VolumeManagerImpl->>VolumeManagerImpl: selectHostForEncryptInPlace(psUuid)
VolumeManagerImpl->>DatabaseFacade: 查询 PrimaryStorageHostRefVO (Connected)
DatabaseFacade-->>VolumeManagerImpl: connectedHostUuids
VolumeManagerImpl->>DatabaseFacade: 查询 HostVO (KVM/Connected/Enabled)
DatabaseFacade-->>VolumeManagerImpl: HostInventory(selectedHostUuid)
end
rect rgba(144, 238, 144, 0.5)
Note over VolumeManagerImpl: 加密执行与失败清理
VolumeManagerImpl->>VolumeInPlaceEncryptor: 使用 selectedHostUuid 执行加密
alt 创建失败
VolumeManagerImpl->>VolumeEncryptedResourceKeyBackend: detachKeyProviderFromVolume(volume)
end
end
代码审查复杂度评估🎯 3 (Moderate) | ⏱️ ~25 分钟 小诗
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Standalone encrypted data-volume creation can miss VM host context. Select a connected KVM host when LUKS secret staging is required. Clean key-provider binding if encrypted instantiation fails. Tests: - storage and ceph module compile - related storage encryption unit tests Resolves: ZSV-12438 Change-Id: I6f4a843b7c15cead75d75f248d77f8760d7fe106
c35fb73 to
a3ffdf2
Compare
|
Comment from yaohua.wu: Review: MR !10256 — ZSV-12438结论: APPROVED(含若干 Suggestion) 背景ZSV-12438(P0):加密虚拟机内/独立新建加密数据盘报错,zce(ceph)、local 存储均复现。根因是独立加密数据盘 instantiate 时缺少 host 来 staging LUKS secret,且 key-provider 绑定缺失。本 MR 在 zstack 侧承载主机自动选择 + 失败清理的基础逻辑。 变更评估
发现项🟡 Warning — destHostUuid = findConnectedHostForCephLuks();
HostVO selectedHost = dbf.findByUuid(destHostUuid, HostVO.class);
🟢 Suggestion — 🟢 Suggestion — 🟢 Suggestion — 关联 MR
兼容性目标分支 🤖 Robot Reviewer |
Summary
Fix ZSV-12438 encrypted data volume creation paths where LUKS secret staging or key-provider binding is missing.
Testing
Resolves: ZSV-12438
Changes
sync from gitlab !10256