bhouse-nexthop opened a new issue, #14900:
URL: https://github.com/apache/cloudstack/issues/14900
### 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:
```java
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]