Skip to content

[Bug Report] 执行 rcow_purge.sh 清理脚本后模版创建失败 #1680

Description

@wu977991

Summary

执行 rcow_purge.sh 清理脚本后,后续创建模版失败报 lvol not found in any lvstore。

Environment

  • CubeSandbox version / commit: 0.7
  • Host OS and kernel version:
  • KVM info (modinfo kvm):
  • Deployment mode:
  • Relevant component:

Steps to Reproduce

  1. /usr/local/services/cubetoolbox/CubeS3lvol/scripts/rcow_purge.sh
  2. systemctl restart cube-sandbox-cubelet
  3. cubemastercli tpl create-from-image

Expected Behavior

执行清理并重启后,Cubelet 应能感知到底层 SPDK 物理存储池已被清空,自动重新创建元数据基础卷(cubelet-s3-metadata-base)、执行 mkfs.ext4 格式化并打底快照(cubelet-s3-metadata-base-snap),后续制作 S3 模版时能够正常派生元数据卷并成功创建。
或者 rcow_purge.sh 脚本在执行时,同步清理 /data/cubelet/storage/s3/index.json 等元数据索引文件,避免产生脏数据缓存。

Actual Behavior

模版制作任务在 CREATING_TEMPLATE 阶段失败,报错提示找不到 cubelet-s3-metadata-base-snap 快照:

text

cubemastercli tpl create-from-image --image x --backend s3 --alias code-sandbox-s33 --node x
2026/09/07 14:54:55 submitted template image job: job_id=f049a875-665b-4a8f-92dd-217f2cbeb029 template_id=tpl-5ee5c64058b04c918c9655f8
● Building template from image
template tpl-5ee5c64058b04c918c9655f8
job f049a875-665b-4a8f-92dd-217f2cbeb029
image xxxx
✓ PULLING
✓ UNPACKING
✓ BUILDING_EXT4
✓ GENERATING_JSON
✓ DISTRIBUTING
✗ CREATING_TEMPLATE
dist ███████████████████████████████████████████████████████ 100% 1/1 ready
total ███████████████████████████████████████████████████████ 100%
elapsed 00:04
press q to stop watching (job keeps running)
2026/09/07 14:54:59 template image job failed template_id=tpl-5ee5c64058b04c918c9655f8 job_id=f049a875-665b-4a8f-92dd-217f2cbeb029 artifact_id=rfs-9fa39668a5pl-5ee5c64058b04c918c9655f8 creation failed: failed to create snapshot dir: derive s3 metadata volume s3-meta-tpl-5ee5c64058b04c918c9655f8 from cubelet-s3-mefail: not found: lvol 'cubelet-s3-metadata-base-snap' not found in any lvstore
cubemastercli run fail: template tpl-5ee5c64058b04c918c9655f8 creation failed: failed to create snapshot dir: derive s3 metadata volume s3-meta-tpl-5ee5c6405r code=not_found raw_rc=-1 action=fail: not found: lvol 'cubelet-s3-metadata-base-snap' not found in any lvstore

Additional Context

启动检测机制:Cubelet 在启动初始化 S3 元数据阶段(EnsureS3MetadataBase)时,会先读取本地的 /data/cubelet/storage/s3/index.json。
状态失步:运维人员执行 rcow_purge.sh 或重置 SPDK 块设备后,底层的 SPDK lvstore 物理卷和 WAL 已经被完全清空,但 rcow_purge.sh 未删除本地记录的 index.json。
误判跳过:Cubelet 重启时读取到旧的 index.json,误认为基础快照仍然存在,打印 s3 metadata base volume/snapshot already present; skip mkfs 并直接跳过了底层快照的重建。
下发报错:随后 Master 下发模板制作任务时,SPDK 去底层物理池查找 cubelet-s3-metadata-base-snap,由于底层实际已被清空,导致查找失败并报错 not found: lvol 'cubelet-s3-metadata-base-snap' not found in any lvstore。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions