Bug 2096780

Summary: [RFE] Add ssh-key and sysprep to template scripts tab
Product: Container Native Virtualization (CNV) Reporter: Guohua Ouyang <gouyang>
Component: User ExperienceAssignee: Ugo Palatucci <upalatuc>
Status: CLOSED ERRATA QA Contact: Guohua Ouyang <gouyang>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.11.0CC: gouyang, lkladnit, tnisan, yzamir
Target Milestone: ---   
Target Release: 4.12.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-24 13:36:39 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:

Description Guohua Ouyang 2022-06-14 09:04:19 UTC
Description of problem:
Currently, only cloud-init data are added to the template scripts tab, user will wonder why there are no ssh-key and sysprep data showing there.
Such as for a windows template, user may want the sysprep configured in the template, so they won't provider the sysprep file every time while they creating their windows VM.

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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Guohua Ouyang 2022-07-27 04:32:59 UTC
Now it has the ssh-key and sysprep in the template's scripts tab, but it's not like the VM's scripts tab.
It's trying to add an existing secret instead of adding new ssh-key or sysprep file.

Comment 2 Ugo Palatucci 2022-08-02 09:24:36 UTC
@yzamir 

Yes, this is the desired behavior. 
In VM and wizard, we can choose from creating new secret/sysprep just for that single VM or selecting an existing one in the same namespace.
We decided in the template to don't let the user create new secret/sysprep but just choose existing ones.
It's not really feasible to enable the user to create n equal secrets/syspreps resources that can be simply shared across namespaces.

Comment 3 Yaacov Zamir 2022-08-02 10:02:29 UTC
(In reply to Ugo Palatucci from comment #2)
> @yzamir 
> 
> Yes, this is the desired behavior. 
> In VM and wizard, we can choose from creating new secret/sysprep just for
> that single VM or selecting an existing one in the same namespace.
> We decided in the template to don't let the user create new secret/sysprep
> but just choose existing ones.
> It's not really feasible to enable the user to create n equal
> secrets/syspreps resources that can be simply shared across namespaces.

It's by design, only when you create a VM we allow to create a new secret just for the VM
we do not support this feature in the templates overview.

for the future:
when working with templates, we currently do not allow to create a new services/secrets/routes... using the template.
when we will allow to add additional objects to a template, it may be nice to allow to add new secrets for ssh and sysprep

Comment 4 Ugo Palatucci 2022-08-05 09:06:17 UTC
Okay working on that. 

Recently we fixed the bug regarding template with multiple objects ( https://bugzilla.redhat.com/show_bug.cgi?id=2060499 )
so now we can continue with this.

Comment 5 Leon Kladnitsky 2022-08-24 18:18:12 UTC
Verified on v4.12.0-109

Comment 9 errata-xmlrpc 2023-01-24 13:36:39 UTC
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 (Important: OpenShift Virtualization 4.12.0 Images security update), 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/RHSA-2023:0408