Bug 1753554 - [SSP] [RFE] Common templates - template namespace label is missing from the templates
Summary: [SSP] [RFE] Common templates - template namespace label is missing from the t...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Guest Support
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: 2.2.0
Assignee: Martin Sivák
QA Contact: Ruth Netser
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-19 09:42 UTC by Ruth Netser
Modified: 2021-10-15 08:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-13 13:17:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1785118 1 high CLOSED Missing attributes when creating a VM from template using CLI 2021-10-15 08:54:11 UTC

Internal Links: 1785118 1929165

Description Ruth Netser 2019-09-19 09:42:11 UTC
Description of problem:
vm.kubevirt.io/template-namespace annotation is missing from common templates.
If using a template from the UI, the UI is responsible for updating the template name and namespace.

When using the CLI, currently there is no automated mechanism to update either.
While the template name annotation does exist in the templates, the namespace is missing.
When a VM is created using a template, validations from the template will not take place, as the template will not be found.


Version-Release number of selected component (if applicable):


How reproducible:
100% using common templates

Steps to Reproduce:
1. Update a template, e.g. -rhel7-server-tiny-v0.6.2
   Set min memory validation to be lower than requested memory

2. Create DV
apiVersion: cdi.kubevirt.io/v1alpha1
kind: DataVolume
metadata:
  name: rhel7
spec:
  source:
      http:
         url: "http://cnv-qe-server.rhevdev.lab.eng.rdu2.redhat.com/files/rhel-images/rhel-76/rhel-76.qcow2"
  pvc:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: "25Gi"


3. Create the VM from template
oc process -n openshift  rhel7-server-tiny-v0.6.2 -p NAME="test8" -p PVCNAME="rhel7" | oc create -n default  -f


Actual results:
VM is instantiated, there are no errors.

Expected results:
VM creation should fail.

Additional info:

Comment 2 Martin Sivák 2019-09-19 09:51:20 UTC
I would like to clarify something about the annotations. The annotation is missing from a template as that template itself does not know the namespace it is in. That is not an issue.

What is more important is that API users (including oc process tool) do not know they should fill in the namespace when instantiating the VM object. And this can prevent the template validator from properly checking the compliance of the created VM.

On the other hand, the templates we release are well defined and oc process does not do any changes to the important parameters. So validator is not really needed here as it is meant to catch user mistakes when the template is used only as a baseline and metadata source for modifications like the UI does.

So I am not entirely convinced this is an issue for the flow that is described here. It is something we would like to improve by providing a server side template customization service that would abstract the oc process step away and allow much better modifications based on the features described here: https://github.com/kubevirt/common-templates/blob/master/templates/README.md

Comment 3 Ruth Netser 2019-09-20 08:08:42 UTC
Based on bug 1753710 the template namespace is missing from the VM label.

Comment 4 sgott 2019-11-13 13:17:01 UTC
Tracked in Jira as an RFE.


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