<feature>[dpu-bm2]: support attaching novlan and vxlan network to baremetal2 instance#3670
<feature>[dpu-bm2]: support attaching novlan and vxlan network to baremetal2 instance#3670ZStack-Robot wants to merge 1 commit into5.5.12from
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Walkthrough在 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (1 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.0)utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.javaComment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@header/src/main/java/org/zstack/header/volume/VolumeProtocol.java`:
- Line 9: VolumeProtocol now contains RBD but XInfiniStorageController does not
handle it; update the controller to close the protocol handling loop by adding
RBD cases or stop exposing RBD until implementation is ready. Specifically, in
XInfiniStorageController update protocolToString (method protocolToString) to
return a valid string for VolumeProtocol.RBD instead of throwing
RuntimeException, and extend the activate and deactivate methods to handle
VolumeProtocol.RBD in their protocol switch/if branches with the appropriate
logic or fallback path; alternatively remove/guard the VolumeProtocol.RBD enum
exposure so callers cannot select an unsupported protocol.
In
`@utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java`:
- Around line 5493-5494: The new error constant ORG_ZSTACK_BAREMETAL2_DPU_10002
(and the other four BAREMETAL2 constants added around the same diff) lack
corresponding human-friendly elaboration entries in
conf/errorElaborations/Elaboration.json; update that JSON by adding a BAREMETAL2
section (or extend the existing one) with entries keyed by each new constant
string (e.g., "ORG_ZSTACK_BAREMETAL2_DPU_10002") and provide appropriate
regex/message pairs for each error so runtime error reporting is not blank—also
ensure you add the same mappings for the other missing codes in the 7719-7726
range.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)
Review profile: CHILL
Plan: Pro
Run ID: 4fed95bd-11ba-4058-963d-408c7f547d29
⛔ Files ignored due to path filters (3)
sdk/src/main/java/SourceClassMap.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/BareMetal2DpuChassisConfig.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/BareMetal2DpuChassisInventory.javais excluded by!sdk/**
📒 Files selected for processing (3)
header/src/main/java/org/zstack/header/volume/VolumeProtocol.javaheader/src/main/java/org/zstack/header/volume/VolumeProtocolCapability.javautils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
| CBD, | ||
| NBD | ||
| NBD, | ||
| RBD |
There was a problem hiding this comment.
新增 RBD 后协议处理链路未闭环,实际调用会失败。
Line 9 引入 RBD 后,plugin/xinfini/src/main/java/org/zstack/xinfini/XInfiniStorageController.java 里:
protocolToString(Line 140-150)会走到RuntimeException;activate(Line 153-166)和deactivate(Line 207-221)会落入not supported protocol失败分支。
建议在同一 PR 补齐 RBD 分支处理,或暂不暴露该枚举值,避免功能处于“可配置但不可用”状态。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@header/src/main/java/org/zstack/header/volume/VolumeProtocol.java` at line 9,
VolumeProtocol now contains RBD but XInfiniStorageController does not handle it;
update the controller to close the protocol handling loop by adding RBD cases or
stop exposing RBD until implementation is ready. Specifically, in
XInfiniStorageController update protocolToString (method protocolToString) to
return a valid string for VolumeProtocol.RBD instead of throwing
RuntimeException, and extend the activate and deactivate methods to handle
VolumeProtocol.RBD in their protocol switch/if branches with the appropriate
logic or fallback path; alternatively remove/guard the VolumeProtocol.RBD enum
exposure so callers cannot select an unsupported protocol.
| public static final String ORG_ZSTACK_BAREMETAL2_DPU_10002 = "ORG_ZSTACK_BAREMETAL2_DPU_10002"; | ||
|
|
There was a problem hiding this comment.
新增错误码缺少 Elaboration 映射,用户侧将出现空/不完整报错信息
这 5 个新错误码已在常量中定义,但 conf/errorElaborations/Elaboration.json 里没有对应 BAREMETAL2 条目。请在同一 PR 同步补齐映射,否则实际报错时可读性会明显下降。
建议补充(示例,需按真实语义完善 regex/message)
+[
+ {
+ "category": "BAREMETAL2",
+ "code": "10002",
+ "method": "regex",
+ "regex": "TODO: dpu error regex",
+ "message_cn": "TODO",
+ "message_en": "TODO"
+ },
+ {
+ "category": "BAREMETAL2",
+ "code": "10093",
+ "method": "regex",
+ "regex": "TODO: instance error regex 10093",
+ "message_cn": "TODO",
+ "message_en": "TODO"
+ },
+ {
+ "category": "BAREMETAL2",
+ "code": "10094",
+ "method": "regex",
+ "regex": "TODO: instance error regex 10094",
+ "message_cn": "TODO",
+ "message_en": "TODO"
+ },
+ {
+ "category": "BAREMETAL2",
+ "code": "10095",
+ "method": "regex",
+ "regex": "TODO: instance error regex 10095",
+ "message_cn": "TODO",
+ "message_en": "TODO"
+ },
+ {
+ "category": "BAREMETAL2",
+ "code": "10096",
+ "method": "regex",
+ "regex": "TODO: instance error regex 10096",
+ "message_cn": "TODO",
+ "message_en": "TODO"
+ }
+]Also applies to: 7719-7726
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java`
around lines 5493 - 5494, The new error constant ORG_ZSTACK_BAREMETAL2_DPU_10002
(and the other four BAREMETAL2 constants added around the same diff) lack
corresponding human-friendly elaboration entries in
conf/errorElaborations/Elaboration.json; update that JSON by adding a BAREMETAL2
section (or extend the existing one) with entries keyed by each new constant
string (e.g., "ORG_ZSTACK_BAREMETAL2_DPU_10002") and provide appropriate
regex/message pairs for each error so runtime error reporting is not blank—also
ensure you add the same mappings for the other missing codes in the 7719-7726
range.
5cc42da to
b1e0789
Compare
…emetal2 instance support attaching novlan and vxlan network to baremetal2 instance Resolves/Related: ZSTAC-82781 Change-Id: I736d637a7168656a6c726c6769777a726e616974
b1e0789 to
2499826
Compare
|
Comment from yaohua.wu: Review: MR !9530 (zstack) — ZSTAC-82781
Warning1. [CloudOperationsErrorCode.java:~7729-7737] 新增 error code 缺少 Elaboration 映射
2. [BareMetal2DpuChassisConfig.java:~7] SDK 的 Suggestion1. [YuccaBareMetal2DpuChassisConfig.java] SDK 类字段为 public 且缺乏文档注释
Verdict: APPROVEDSDK 变更与 premium 侧实现一致,SourceClassMap 注册正确。详细 review 见 premium MR !13398 评论。 🤖 Robot Reviewer |
support attaching novlan and vxlan network to baremetal2 instance
Resolves/Related: ZSTAC-82781
Change-Id: I736d637a7168656a6c726c6769777a726e616974
sync from gitlab !9530