Bug 1929165
| Summary: | [RFE] A cluster may have old and new templates (e.g after upgrade); older templates should be protected from deletion | ||
|---|---|---|---|
| Product: | Container Native Virtualization (CNV) | Reporter: | Ruth Netser <rnetser> |
| Component: | SSP | Assignee: | Andrej Krejcir <akrejcir> |
| Status: | CLOSED ERRATA | QA Contact: | Sarah Bennert <sbennert> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 2.6.0 | CC: | akrejcir, cnv-qe-bugs, dholler, fdeutsch, ipinto |
| Target Milestone: | --- | ||
| Target Release: | 4.9.1 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | kubevirt-ssp-operator-container-v4.9.0-20 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-12-13 19:59:01 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1962475 | ||
|
Description
Ruth Netser
2021-02-16 10:40:22 UTC
I think that, instead of blocking the deletion of old templates, the SSP operator could add the 'vm.kubevirt.io/validations' annotation to old VMs. Then the template-validator would use the validation rules from the annotation and not form a non-existing template. Old VMs could be updated when the SSP resource is updated to a new version. It would be more efficient than updating on each reconciliation iteration. Template in use by a VM was allowed to be deleted on 4.9 CNV that had been upgraded from 2.5 $ oc delete template -n openshift rhel6-desktop-tiny-v0.11.3 template.template.openshift.io "rhel6-desktop-tiny-v0.11.3" deleted Verified.
Cluster upgraded
From: OpenShift 4.6.48 / OpenShift Virtualization 2.5.8
To: OpenShift 4.9.7 / OpenShift Virtualization 4.9.1-23
VMs were created using templates from the UI in 2.5.8 and then the cluster upgraded.
After upgrade to 4.9.1, verified delete command was rejected regardless if the VMs were running or not.
$ oc delete -n openshift template rhel8-server-tiny-v0.11.3
Error from server (Forbidden): admission webhook "template-admission.ssp.kubevirt.io" denied the request: Template cannot be deleted, because the following VMs are referencing it for validation: {LIST_OF_ALL_VMS_CREATED_FOR_TEST}
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (OpenShift Virtualization 4.9.1 Images), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:5091 |