Skip to content

<fix>[backport]: ZSTAC-86784 migrate storage host filters#4589

Open
zstack-robot-2 wants to merge 1 commit into
5.4.12from
sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2
Open

<fix>[backport]: ZSTAC-86784 migrate storage host filters#4589
zstack-robot-2 wants to merge 1 commit into
5.4.12from
sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2

Conversation

@zstack-robot-2

Copy link
Copy Markdown
Collaborator

Backport for ZSTAC-86784. Source MR: zstackio/zstack!10312.

sync from gitlab !10559

Introduce MigrateStorage host allocation semantics for storage migration so running VMs get KVM host property checks while stopped VMs skip runtime component version filtering.

Resolves: ZSTAC-75332

Change-Id: I6c393d7ec962d71fb5437d7a41d0891deb7abae7
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Could not fetch remote config from http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml: TimeoutError: The operation was aborted due to timeout
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: acc4dfb9-ff2e-4bae-a21a-087bc170778f

📥 Commits

Reviewing files that changed from the base of the PR and between 4662199 and 262b857.

📒 Files selected for processing (5)
  • compute/src/main/java/org/zstack/compute/allocator/AttachedVolumePrimaryStorageAllocatorFlow.java
  • compute/src/main/java/org/zstack/compute/allocator/HostPrimaryStorageAllocatorFlow.java
  • header/src/main/java/org/zstack/header/vm/VmInstanceConstant.java
  • plugin/kvm/src/main/java/org/zstack/kvm/KVMHostAllocatorFilterExtensionPoint.java
  • plugin/localstorage/src/main/java/org/zstack/storage/primary/local/LocalStorageAllocatorFactory.java

Walkthrough

新增 MigrateStorage VM 操作类型,并将其接入附加卷、主存储、KVM 与本地存储的候选主机筛选流程;停止状态实例在 KVM 筛选中保留原候选集。

Changes

存储迁移分配

Layer / File(s) Summary
操作契约与主存储分配
header/.../VmInstanceConstant.java, compute/.../AttachedVolumePrimaryStorageAllocatorFlow.java, compute/.../HostPrimaryStorageAllocatorFlow.java
新增 MigrateStorage 枚举,并使附加卷及主存储分配流程采用对应的候选筛选路径。
主机筛选器接入
plugin/kvm/.../KVMHostAllocatorFilterExtensionPoint.java, plugin/localstorage/.../LocalStorageAllocatorFactory.java
KVM 属性筛选支持 MigrateStorage,停止状态实例直接保留候选集;本地存储容量筛选支持该操作。

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VMOperation
  participant PrimaryStorageAllocator
  participant KVMFilter
  participant LocalStorageFilter
  VMOperation->>PrimaryStorageAllocator: MigrateStorage
  PrimaryStorageAllocator->>KVMFilter: 筛选候选主机
  PrimaryStorageAllocator->>LocalStorageFilter: 筛选本地存储容量
  KVMFilter-->>PrimaryStorageAllocator: 返回候选集
  LocalStorageFilter-->>PrimaryStorageAllocator: 返回候选集
Loading

Poem

小兔挥爪添新枚举,
存储迁移踏上云途。
主机筛选排成队,
停止实例候选留。
胡萝卜庆祝流程通!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题简洁且准确概括了本次变更的核心:迁移存储主机过滤规则的回移。
Description check ✅ Passed 描述明确表明这是 ZSTAC-86784 的回移,与本次变更相关。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2

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

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