Volume snapshots of CKS node and Shared FileSystem VM volumes are always refused

未关闭 适合新手
#14,900 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java

调研方向

从 VolumeApiServiceImpl.isOperationSupported 和 SnapshotManagerImpl.createPolicy 中的守卫开始,将它们与 UserVmManagerImpl 中的部署检查进行比较。所需更改是正确组合 CKS-node 和 Shared FileSystem VM 卷的排除规则,同时保留对其他 SYSTEM-template 卷的拒绝。完成的标准是,CKS node 和 Shared FileSystem VM 卷能够使用快照和快照策略,但系统 VM 和路由器仍会被阻止。

由索引模型根据 Issue 内容生成。

描述

problem

Volume snapshots of CKS node volumes are always refused when the cluster was deployed from the SYSTEM-type system VM template, which is the default:

Volume: ... is for System VM , Creating snapshot against System VM volumes is not supported

The same happens for snapshot policies, and for the root volume of a Shared FileSystem VM.

The guard in VolumeApiServiceImpl.isOperationSupported and in SnapshotManagerImpl.createPolicy reads:

template.getTemplateType() == SYSTEM &&
    (userVm == null || !CKS_NODE.equals(type) || !SHAREDFSVM.equals(type))

No VM has both types, so the right-hand side is always true and every volume from a SYSTEM template is refused. Before #9208 the guard was (userVm == null || !CKS_NODE.equals(type)), which allowed CKS nodes. #9208 meant to add Shared FileSystem VMs to the exemption (the deploy check it changed in UserVmManagerImpl reads !CKS_NODE.equals(vmType) && !SHAREDFSVM.equals(vmType)), but the || removed the CKS exemption instead.

The same code is on main.

versions

4.20 and later (since #9208), including 4.22 and main. KVM, Ceph RBD primary storage. Any hypervisor and storage is affected; the check runs before the storage layer.

The steps to reproduce the bug
  1. Create a CKS cluster without a custom node template (nodes use the system VM template).
  2. Take a volume snapshot of a node's ROOT volume: create snapshot volumeid=<node root volume>.
  3. The call fails with "Creating snapshot against System VM volumes is not supported". create snapshotpolicy on the same volume fails the same way.
What to do about it?

Change || to && in both guards, so CKS node and Shared FileSystem VM volumes are allowed and other SYSTEM template volumes (system VMs, routers) are still refused.

主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 1 小时
30 天内合并 PR
16

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/cloudstack 的其他 Issue

查看 apache/cloudstack 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。