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

Offen Anfängerfreundlich
#14,900 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
82/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
java

Rechercherichtung

Beginne mit den Guards in VolumeApiServiceImpl.isOperationSupported und SnapshotManagerImpl.createPolicy und vergleiche sie mit der Deploy-Prüfung in UserVmManagerImpl. Die erforderliche Änderung besteht darin, die Ausschlüsse für CKS-node- und Shared FileSystem VM-Volumes korrekt zu kombinieren und dabei Ablehnungen für andere SYSTEM-template-Volumes beizubehalten. Fertig bedeutet, dass Snapshots und Snapshot-Policies für CKS-Node- und Shared FileSystem VM-Volumes funktionieren, für System-VMs und Router aber weiterhin blockiert bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.4k
Ø Merge
6 T. 1 Std.
Gemergte PRs (30 T.)
16

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/cloudstack

Alle Issues in apache/cloudstack

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.