Bug 1080074

Summary: [Neutron integration][webadmin] improve CIDR validation when creating network with subnet on Neutron
Product: Red Hat Enterprise Virtualization Manager Reporter: Martin Pavlik <mpavlik>
Component: ovirt-engineAssignee: Dan Kenigsberg <danken>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: medium Docs Contact:
Priority: low    
Version: 3.4.0CC: bazulay, danken, gklein, lsurette, mburman, myakove, nyechiel, rbalakri, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ovirt-3.6.0-rcFlags: ylavi: Triaged+
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:25:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1063716    
Attachments:
Description Flags
log_collector
none
screenshots+engine log none

Description Martin Pavlik 2014-03-24 15:58:29 UTC
Created attachment 878114 [details]
log_collector

Description of problem:

if user tries to create network with subnet on Neutron external provider
RHEVM will accept CIDR value such as 1.1.1.1/24
which gets refused by neutron server with
Invalid input for cidr. Reason: '1.1.1.1/24' isn't a recognized IP subnet cidr, '1.1.1.0/24' is recommended.


Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Manager Version: 3.4.0-0.10.beta2.el6ev 

How reproducible:
100%

Steps to Reproduce:
1. have working setup with neutron as external network provider configured
2. networks -> new
3. name: test, check Create on external provider, select your neutron provider
4. select Subnet in upper left corner of the dialog
5. Name: test, CIDR: 1.1.1.1/24, click OK


Actual results:
Error while executing action Add Subnet to Provider: Failed to communicate with the external provider.

Expected results:
1) CIDR: 1.1.1.1/24 does not pass validation in New logical network dialog
2) appropriate tooltip explaining what is wrong is displayed, it would be great if could provide as clear explanation as neutron logs, e.g. Reason: '1.1.1.1/24' isn't a recognized IP subnet cidr, '1.1.1.0/24' is recommended.

Additional info:

2014-03-24 16:52:11,963 ERROR [org.ovirt.engine.core.bll.provider.network.AddSubnetToProviderCommand] (ajp-/127.0.0.1:8702-10) [57fdacab] Command org.ovirt.engine.core.bll.provider.network.AddSubnetToProviderCommand throw Vdc Bll exception. With error message VdcBLLException: (Failed with error PROVIDER_FAILURE and code 5050)

Comment 3 Michael Burman 2015-04-27 16:23:31 UTC
Tested on - 3.6.0-0.0.master.20150412172306.git55ba764.el6


1) CIDR: 1.1.1.1/24 or 2.2.0.1/16 does not pass validation in New logical network dialog 

2) CIDR field is colored in red and Appropriate tooltip explaining what is wrong-
"This field must contain CIDR notation of an IP subnet, please ensure that the IP address matches the prefix. example:valid network address:2.2.0.0/16 invalid:2.2.0.1/16"

This is all look very nice until trying to create the network with a valid address such as 1.1.1.0/24 or as suggested in tooltip 2.2.0.0/16, then i get-
Operation canceled

 Error while executing action: may not be null

result- network created without subnet.
on neutron network created without subnet as well.

engine.log
 CanDoAction of action 'AddSubnetToProvider' failed for user admin@internal. Reasons: VAR__TYPE__SUBNET,VAR__ACTION__ADD,may not be null

faildQA

Comment 4 Michael Burman 2015-04-27 16:29:08 UTC
Created attachment 1019377 [details]
screenshots+engine log

Comment 5 Lior Vernia 2015-04-28 07:32:43 UTC
Michael, please open a different bug then, because it sounds like a different issue (and also a regression, unlike this bug which always existed). It might or might not have been caused by the fix to this, we'll have to investigate...

Comment 6 Michael Burman 2015-04-28 12:30:58 UTC
Lior, i will do that.

So moving this to verified, thank you.

Verified on - 3.6.0-0.0.master.20150412172306.git55ba764.el6

1) CIDR: 1.1.1.1/24 or 2.2.0.1/16 does not pass validation in New logical network dialog 

2) CIDR field is colored in red and Appropriate tooltip explaining what is wrong-
"This field must contain CIDR notation of an IP subnet, please ensure that the IP address matches the prefix. example:valid network address:2.2.0.0/16 invalid:2.2.0.1/16"