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

Đang mở Phù hợp với người mới
#14,900 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, infrastructure

Hướng nghiên cứu

Bắt đầu với các kiểm tra trong VolumeApiServiceImpl.isOperationSupported và SnapshotManagerImpl.createPolicy, rồi so sánh chúng với kiểm tra triển khai trong UserVmManagerImpl. Thay đổi cần thiết là kết hợp chính xác các trường hợp loại trừ đối với volume của CKS-node và Shared FileSystem VM, đồng thời duy trì việc từ chối đối với các volume SYSTEM-template khác. Hoàn thành khi snapshot và chính sách snapshot hoạt động đối với volume của CKS node và Shared FileSystem VM nhưng vẫn bị chặn đối với system VM và router.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
6 ngày 1 giờ
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/cloudstack

Tất cả issue của apache/cloudstack

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.