Bug 2168111

Summary: VM template loses storage information if a required parameter has no value
Product: Container Native Virtualization (CNV) Reporter: Juan Orti <jortialc>
Component: User ExperienceAssignee: Ugo Palatucci <upalatuc>
Status: CLOSED ERRATA QA Contact: Guohua Ouyang <gouyang>
Severity: high Docs Contact:
Priority: high    
Version: 4.12.0CC: gouyang, rsdeor, tnisan, upalatuc
Target Milestone: ---Flags: upalatuc: needinfo-
Target Release: 4.13.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-05-18 02:57:30 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:
Attachments:
Description Flags
template.yaml none

Description Juan Orti 2023-02-08 08:11:37 UTC
Description of problem:
If a VM template has any parameter that is required but does not provide a default value, the storage disk source is lost.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a VM template with a required parameter and no default value, for example:

~~~
parameters:
  - description: SSH pubkey for the cloud-init user
    name: CLOUD_USER_SSH_KEY
    required: true
~~~

2. In the console, go to Virtual Machines -> Create from catalog -> Select template -> Customize Virtual Machine.

Actual results:
CLOUD_USER_SSH_KEY is empty and required as expected, however in Storage -> Disk source, the details of the source storage has been lost.

Expected results:
I expect that "Template default" is selected in Storage -> Disk source. 

Additional info:

Comment 1 Juan Orti 2023-02-08 08:14:51 UTC
Created attachment 1942824 [details]
template.yaml

Comment 2 Guohua Ouyang 2023-02-10 03:43:24 UTC
I could reproduce the issue, but I double about whether it's a valid scenario because it sets a required parameter in the template but not provide the data for the required parameter.

Comment 6 Guohua Ouyang 2023-03-23 05:32:11 UTC
The required parameter 'CLOUD_USER_SSH_KEY' is displaying on page now, but the parameter is not processed.
Create a VM from it cannot see the key or secret about it.

@Ugo @Tal
Do we need further fix for the problem?

Comment 8 Guohua Ouyang 2023-03-23 10:00:22 UTC
Missed one part while creating the template, retest it with the YAML from the attachment, the ssh key is actually in the VM YAML.

Comment 10 errata-xmlrpc 2023-05-18 02:57:30 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 (Moderate: OpenShift Virtualization 4.13.0 Images security, bug fix, and enhancement 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:3205

Comment 11 Red Hat Bugzilla 2023-09-19 04:33:25 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days