Bug 1796388

Summary: Disk Validations should support optional validation also
Product: OpenShift Container Platform Reporter: Ido Rosenzwig <irosenzw>
Component: Console Kubevirt PluginAssignee: Ido Rosenzwig <irosenzw>
Status: CLOSED ERRATA QA Contact: Nelly Credi <ncredi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: aos-bugs, gouyang
Target Milestone: ---   
Target Release: 4.4.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: 2020-05-13 21:55:38 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 Ido Rosenzwig 2020-01-30 10:23:20 UTC
Description of problem:
Currently, the console enforces only restrictive disk type validations while it should also enforce optional validations (validations which has the 'justWarning' key).
As the console shows an error message for the restrictive validations, it should show a warning message if the user chose not recommended disk type.


How reproducible:
100%

Steps to Reproduce:
1. Check that you have an optional disk validation in a template at the openshift namespace.
optional disk validation can be found in any of the windows templates:
$ oc get templates -n openshift | grep win

2. Pick one of the results ( for example win2k12r2-server-large-v0.7.0)
3. Make sure the template has a validation object with 'justWarning key' :
$ oc get template win2k12r2-server-large-v0.7.0 -n openshift -o yaml

4. Open openshift web console : Go to the 'workloads' -> 'Virtual Machines' -> 'Create Virtual Machine'
5. Choose a Windows OS and a source of 'container' or 'URL', the other fields aren't important. ( Don't use a user template )
6. Go to the Storage Tab 
7. Edit the disk that is present there: you should have 2 options: VirtIO and scsi.

Expected results:

- scsi should be marked as 'not recommended' but can be chosen.
- If scsi was chosen a warning message should appear under the Dropdown in the modal.
- If the user saved the changes at the modal along with the scsi choice, a warning message should appear below the scsi label in the Interface column.

Additional info:

NOTE: this bug is not for windows templates, virtIO and scsi specific but a general one. I used those specific names to explain the problem as this is the only way to reproduce the bug without creating a user template with custom validations.
Thus, the fix should be general and not Windows,VirtIO and scsi specific.

Comment 2 Ido Rosenzwig 2020-02-11 09:41:01 UTC
> 7. Edit the disk that is present there: you should have 2 options: VirtIO
> and scsi.
> 
> Expected results:
> 
> - scsi should be marked as 'not recommended' but can be chosen.
> - If scsi was chosen a warning message should appear under the Dropdown in
> the modal.
> - If the user saved the changes at the modal along with the scsi choice, a
> warning message should appear below the scsi label in the Interface column.
> 
> Additional info:
> 
> NOTE: this bug is not for windows templates, virtIO and scsi specific but a
> general one. I used those specific names to explain the problem as this is
> the only way to reproduce the bug without creating a user template with
> custom validations.
> Thus, the fix should be general and not Windows,VirtIO and scsi specific.

I confused with `scsi` and `sata` - I meant to write `sata`.
wherever it's written `scsi` think of it as `sata`. Sorry for the confusion.

Comment 3 Guohua Ouyang 2020-02-24 02:51:33 UTC
The bug says it should be general and not Windows.
If it's windows, the disk type are virtio and sata, select sata warning shows.
If it's cirros/fedora, the disk type are virtio, sata and scsi, select sata/scsi no warning shows, is it correct?

version: 4.4.0-0.nightly-2020-02-22-102956

Comment 4 Ido Rosenzwig 2020-02-24 07:08:45 UTC
Yes that is correct.

Please note that disk validations are present only for Windows templates in the common-templates provided by Kubevirt because only Windows has limitations. This is why you see the warnings only when choosing a Windows OS.

If you would like to verify the errors appear on OSs that aren't windows you can change a common-template temporarily by coping the validations from windows template to a non-windows template. (and remove those changes after you done).

In addition, please verify the warnings are present on user templates as well:
1. Create a user template
2. Add Disk validations manually for the template you just created ( coping from windows template is the fastest )
3. Create a VM from the template you created.

Comment 5 Guohua Ouyang 2020-02-24 07:35:02 UTC
Thanks for the confirmation.

Verified it on vm template wizard, the warning present as well.

Comment 7 errata-xmlrpc 2020-05-13 21:55:38 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, 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-2020:0581