Bug 671463

Summary: [RFE] Validate new Host address ( FQDN....) - REST interfaces
Product: [oVirt] ovirt-engine Reporter: Matthew Booth <mbooth>
Component: RFEsAssignee: Barak <bazulay>
Status: CLOSED WORKSFORME QA Contact: Pavel Stehlik <pstehlik>
Severity: low Docs Contact:
Priority: high    
Version: ---CC: alonbl, bazulay, bsettle, bugs, dfediuck, ecohen, iheim, lpeer, mkenneth, nbarcet, oourfali, oramraz, rbalakri, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: ylavi: ovirt-future?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-31 09:07:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Matthew Booth 2011-01-21 15:35:34 UTC
When I go to Hosts->New in RHEV Manager and enter 'red.rhev.marston' in the Address field, it gives me the following error message in a tool tip:

Address should be an IP Address or a Fully Qualified Domain Name (FQDN)

'red.rhev.marston' is the FQDN for this host. I suspect this is related to similar bug I filed a while back, I think for storage domains. In that case, the code was doing some invalid heuristic check on the FQDN. IIRC, it was checking the length of the final name component. Note that DNS puts no requirement on this, and private domains are both common and best practise on private networks.

Comment 2 Miki Kenneth 2011-02-16 12:37:20 UTC
This is not the issue at all! the reg-ex is not the issue.
The issue is that we need to validate the address by pinging it. 
As it stand now, we can create tons of hosts (illegal IP/FQDN address). lines in the DB, that are actually nothing....

See also the discussion on: 677343

Comment 6 Miki Kenneth 2011-03-02 12:24:05 UTC
I think that SSH is doing a bit too much in order to just validate the FQDN....
but you guys are the experts.

Comment 16 Alon Bar-Lev 2012-11-28 08:37:41 UTC
I see no problem in current implementation about to be rhev-3.2.

Closing for now,

Comment 18 Alon Bar-Lev 2012-12-23 11:34:28 UTC
I don't know exactly what the logic is...

1.1.1 - fails.
1.1.1a - success.
1.1.1.a - success
1.1.1.1 - success
1.1.1.1.1 - fails
300.1.1.1 - fails
1a.1.1.1 - fails
1.1a.1.1 - fails

I guess that every component which begins with number is treated as ip address, all other is accepted.

Why should be do any validation on this field?

But at least this works better than what was when comment#0 posted.

Comment 20 Barak 2013-01-01 10:34:49 UTC
I'm not sure a validity check is relevant for this field.

It is clear that the above validity check is not correct.

I would suggest to change it to not empty validity only.

And if we want to add a real validity check then do a connection check on the engine.

Yaniv, Simon please advise.

This obviously not a change for 3.2 hence moving to rhevm-future.

Comment 21 Simon Grinberg 2013-01-01 12:34:02 UTC
(In reply to comment #20)

> Yaniv, Simon please advise.
> 
> This obviously not a change for 3.2 hence moving to rhevm-future.

According to:
https://bugzilla.redhat.com/show_bug.cgi?id=691177#c5

Webadmin validates this properly. 

So we are left with REST based interfaces - I tend to say that if the SSH attempt (which is the first stage of installing a host) fails with proper message then validation can be reduce to non empty and no white spaces. 

Can this be easily done for 3.2?
P.S. If the current validation covered the above (and the error message is clear as stated above) but just does not detect some of the illegal combinations then you can leave this at future (if not even defer)

Comment 23 Barak 2014-01-01 17:09:01 UTC
moved back to new - to reset the work on this issue