Bug 1962475 - CNV-provided templates should not be deleted
Summary: CNV-provided templates should not be deleted
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Documentation
Version: 4.8.0
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ---
: 4.8.0
Assignee: Bob Gaydos
QA Contact: Ruth Netser
URL:
Whiteboard:
Depends On: 1929165
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-20 07:08 UTC by Ruth Netser
Modified: 2021-08-18 06:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Release Note
Doc Text:
Caution: Do not delete CNV-provided templates. If you delete a template and edit the VM, then the edit fails because the template was deleted. $ oc edit vm rhelvm error: virtualmachines.kubevirt.io "rhelvm" could not be patched: admission webhook "virt-template-admission.kubevirt.io" denied the request: missing parent template (key=openshift/rhel8-server-tiny-v0.11.3) for rhelvm
Clone Of:
Environment:
Last Closed: 2021-07-28 23:13:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ruth Netser 2021-05-20 07:08:35 UTC
Document URL: 

Section Number and Name: 

Describe the issue: 
A cluster may have old and new templates provided by CNV(e.g after upgrade); older templates, if used by VMs, should be not be deleted from the cluster (bug 1929165).


Suggestions for improvement: 

Additional information:

Comment 1 ctomasko 2021-06-08 19:02:10 UTC
Add a known issue to the CNV 4.8 release notes:

Caution: Do not delete CNV-provided templates. If you delete a template and edit the VM, then the edit fails because the template was deleted.

$ oc edit vm rhelvm
error: virtualmachines.kubevirt.io "rhelvm" could not be patched: admission webhook "virt-template-admission.kubevirt.io" denied the request: missing parent template (key=openshift/rhel8-server-tiny-v0.11.3) for rhelvm

Comment 2 Bob Gaydos 2021-07-01 15:29:59 UTC
Hi @rnetser-

Please review draft text for 4.8 release notes Known Issues. We can't use CAUTION blocks unless there are steps in the documentation, so let me know if this is sufficient (assuming this is a bug that will be fixed). {VirtProductName} is our variable for the OV /CNV product.

* Do not delete {VirtProductName}-provided templates. If you delete {VirtProductName}-provided templates and then edit the virtual machine created from the template, the edit fails because the template was deleted.

Thanks,

Bob

Comment 5 Bob Gaydos 2021-07-07 21:03:28 UTC
@rnetser -

Sure, that sounds fine. How about this:

Do not delete OpenShift Virtualization-provided templates in version 4.8 or later releases. If you delete OpenShift Virtualization-provided templates in version 4.8 or later releases, and then edit the virtual machine created from the template, the edit fails because the template was deleted.

I am not sure what you mean by "reconsiled". I can explain that if you can define it for me... up to you if you think it's helpful. If you approve the above wording, I can get this bug fix merged Thursday July 8.

Thanks for your help,

Bob

Comment 6 Ruth Netser 2021-07-12 07:48:05 UTC
@bgaydos

By "reconciled" I mean that the SSP operator will re-create the templates.

So the flow is as follows:

If the user deletes a new template (i.e those provided with the current release), they will be re-created by the operator.

If a user deletes an old template (i.e templates that were deployed as part of a previous release), those templates will not be re-created. Editing (or any update) of a VM using the old template will fail if this template was deleted.

Do you think it's worth distiguishing between the 2 use cases?

Comment 7 Bob Gaydos 2021-07-15 18:28:07 UTC
Hi @rnetser, I'm going to say that more info is better, but I think it can be summarized. Here's what I suggest:

If you delete OpenShift Virtualization-provided templates in version 4.8 or later, the templates are automatically recreated by the OpenShift Virtualization Operator. However, if you delete OpenShift Virtualization-provided templates created before version 4.8, any edit or update to a virtual machine referencing a deleted template will fail.  

Let me know if this works.

Thanks

Bob

Comment 8 Bob Gaydos 2021-07-16 16:48:14 UTC
rnetser can approve this version?

====
If you delete {VirtProductName}-provided templates in version 4.8 or later, the templates are automatically recreated by the {VirtProductName} Operator. However, if you delete {VirtProductName}-provided templates created before version 4.8, those earlier templates are not automatically recreated after deletion. As a result, any edit or update to a virtual machine referencing a deleted earlier template will fail.
====

I'd like to get this merged on Monday July 19. it's passed peer review so we just need your sign-off.

Thanks,

Bob

Comment 9 Ruth Netser 2021-07-21 09:36:09 UTC
@bgaydos  LGTM

Comment 10 Bob Gaydos 2021-07-21 17:36:16 UTC
Thanks @rnester 

Merged into 4.8 notes and DONE: https://github.com/openshift/openshift-docs/pull/34228

Comment 11 rnester 2021-07-27 18:36:50 UTC
Corrected needsinfo target from "rnester" to "rnetser".


Note You need to log in before you can comment on or make changes to this bug.