Bug 1850562

Summary: [v2v][ui] VM import RHV to CNV: RHV URL pass validation though it is missing 'https://'
Product: OpenShift Container Platform Reporter: Yaacov Zamir <yzamir>
Component: Console Kubevirt PluginAssignee: Gilad Lekner <glekner>
Status: CLOSED ERRATA QA Contact: Maayan Hadasi <mguetta>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.6CC: akarol, aos-bugs, cnv-qe-bugs, dagur, fkrepins, glekner, gouyang, istein, mguetta, pkliczew, tjelinek
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1849733
: 1874373 (view as bug list) Environment:
Last Closed: 2020-10-27 16:08:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1849733    
Bug Blocks: 1874373    

Description Yaacov Zamir 2020-06-24 13:41:08 UTC
+++ This bug was initially created as a clone of Bug #1849733 +++

Description of problem:
When RHV URL is missing the 'https://' prefix,
and provide all other RHV details correctly (ca cert, user, password)
We get this message:
 "Connection succeeded but could not read list of virtual machines from the RHV API instance"
That prevents from loading the VMs in this RHV.

This should not happen, and user should be notified that the RHV URL is not valid.

We can do the following to solve this:

1. Add help message with example of a RHV URL - It can save users confusion
2. We can fail RHV URL on validation error 

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

--- Additional comment from Filip Krepinsky on 2020-06-23 14:25:17 UTC ---

we can add the validation to the UI, but what protocols/ports should be allowed then? 

just https://hostname or hostname:443? What about http, 8443 or any other ports?

Would it make sense to default to http or https on backend?

--- Additional comment from Piotr Kliczewski on 2020-06-23 14:36:37 UTC ---

We need https for importing the disks. As far as I know we can use either default https port (443) or 8443. I haven't seen any other port supported.

Comment 1 Yaacov Zamir 2020-06-24 14:00:59 UTC
*** Bug 1849733 has been marked as a duplicate of this bug. ***

Comment 2 Tomas Jelinek 2020-07-10 06:54:21 UTC
There has been a big batch of v2v related bugs moved to kubevirt plugin at once. We are working on them but due to capacity this did not make it last sprint.

Comment 4 Filip Krepinsky 2020-08-10 16:43:05 UTC
we could also include https:// as a default value of the url

Comment 8 Ilanit Stein 2020-08-13 15:53:40 UTC
@Piotr, @Tomas,

Can this bug get cloned to 4.5.z please?
It looks very important to me as I see, that EACH person in my team and externally, that ran it for the first time failed on this.

We'll file a bug to improve the tool tip or the "API URL" to guide exactly what content should be added here.
Current tool tip only links to some site that show RHv details, but do not explain the expected content.

Comment 9 Maayan Hadasi 2020-08-13 16:27:31 UTC
(In reply to Ilanit Stein from comment #8)
> @Piotr, @Tomas,
> 
> Can this bug get cloned to 4.5.z please?
> It looks very important to me as I see, that EACH person in my team and
> externally, that ran it for the first time failed on this.
> 
> We'll file a bug to improve the tool tip or the "API URL" to guide exactly
> what content should be added here.
> Current tool tip only links to some site that show RHv details, but do not
> explain the expected content.

Opened new bug: Bug 1868737 - [UI][V2V][RHV to CNV VM import] Improve "API URL" structure info while connecting to new RHV instance

Comment 10 Piotr Kliczewski 2020-08-16 20:22:27 UTC
Ilanit, I am not sure whether this bug is critical enough. I will let Tomas handle the backport if he see it needed.

Comment 11 Yaacov Zamir 2020-08-18 11:42:37 UTC
*** Bug 1868737 has been marked as a duplicate of this bug. ***

Comment 12 Maayan Hadasi 2020-09-22 11:52:56 UTC
Verified this issue with OCP 4.6/CNV 2.5

I provided RHV API URL without 'https://', all other provider details were correct -> An instruction under 'API URL' field is shown: "URL should start with 'https://'" but the connection succeeded and I was able to select VM to import. The followed import fails on:

ValidationFailed: Failed to initialize the source provider (Failed to connect to source provider): Post /ovirt-engine/sso/oauth/token: unsupported protocol scheme ""


@Gilad, @Ilanit, is this the expected behavior?
Shouldn't the connection fail on validation?

Comment 13 Ilanit Stein 2020-09-22 17:00:41 UTC
@Maayan, 
The described behavior is different than the one reported in the bug description.
The VMs were not listed, when RHV URL did not start with "https://".

So now not only that RHV passes validation, it even allows to continue further and perform the VM import.

Comment 14 Maayan Hadasi 2020-09-23 07:58:49 UTC
Moving this issue back to ASSIGNED.
The expected behavior is: connecting to RHV provider should fail on validation and not as described in comment #12

Comment 16 Maayan Hadasi 2020-09-29 10:28:23 UTC
Verified as fixed

Versions:
OCP 4.6.0-fc.8
CNV 2.5.0

There is an error message under RHV API URL field in case it does not start properly with 'https':
"URL has to start with 'https://'"

'Check and Save' button is disabled

Comment 18 errata-xmlrpc 2020-10-27 16:08:51 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 (OpenShift Container Platform 4.6 GA Images), 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:4196

Comment 19 Gilad Lekner 2021-01-02 19:27:22 UTC
Clearing redundant NEEDINFO