Bug 1165025 - MacPoolRange | error validation should be on engine-config
Summary: MacPoolRange | error validation should be on engine-config
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-config
Version: 3.5.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: 3.5.0
Assignee: Martin Mucha
QA Contact: Michael Burman
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-18 07:10 UTC by Meni Yakove
Modified: 2016-02-10 19:52 UTC (History)
10 users (show)

Fixed In Version: vt13.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-17 17:10:05 UTC
oVirt Team: Network
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine.log (678.22 KB, text/plain)
2014-11-18 07:10 UTC, Meni Yakove
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 35390 0 ovirt-engine-3.5 MERGED core: lenient validation of mac pool ranges in engine-config Never
oVirt gerrit 35391 0 ovirt-engine-3.5 ABANDONED core: dont fail on empty ranges Never
oVirt gerrit 35392 0 ovirt-engine-3.5 MERGED core: do not fail when there's no mac in pool on engine startup. Never
oVirt gerrit 35506 0 master ABANDONED core: do not fail when there's no mac in pool on engine startup. Never
oVirt gerrit 35747 0 master ABANDONED core: lenient validation of mac pool ranges in engine-config Never

Description Meni Yakove 2014-11-18 07:10:41 UTC
Created attachment 958447 [details]
engine.log

Description of problem:
When setting invalid MacPoolRange in engine-config andd NIC to VM fail while  MAC Addresses pool manager failed to initializing.
The validation of invalid MAC range should be in engine-config

Version-Release number of selected component (if applicable):
rhevm-3.5.0-0.19.beta.el6ev.noarch



Steps to Reproduce:
1. engine-config -s MacPoolRanges=FF:00:00:00:00:00-FF:00:00:00:00:01
2. Restart ovirt-engine service
3. Add NIC to VM

Actual results:
Add NIC failed

Expected results:
Add NIC succeeded

Comment 1 Lior Vernia 2014-11-19 13:16:49 UTC
To my understanding there are three issues here:

1. When running engine-config with MacPoolRanges that contains invalid addresses, a warning error should have been printed that the ranges were trimmed (and possibly some more information about the trimming).

2. Engine should probably handle an empty MacPoolRanges entry upon startup, rather than fail to initialize MacPoolManager, so that when an attempt is made to create a new vNIC a proper error will be shown (similar to MAC pool exhaustion).

3. In the very specific case when trying to set ranges that get trimmed to the point where no valid address remains, perhaps the engine-config command should fail altogether.

Since all of this becomes irrelevant in 3.6, I would make sure that (1) works (as it should have been implemented already), and implement (2).

(3) would require more complex code and I don't find it necessary.

Comment 3 Lior Vernia 2014-11-19 15:18:09 UTC
Not quite a regression in my opinion, a behavior change that in most cases is nicer and in one edge case acts a little worse. Still worth fixing for 3.5 though.

Comment 5 Michael Burman 2014-12-01 15:11:22 UTC
The same error validation should be for:
RHEVM is supposed to remove Multicast MAC addresses form MAC range, lets see what happens if the only MAC specified is multicast-
 engine-config -s MaxMacsCountInPool=1
 engine-config -s MacPoolRanges=01:00:5E:28:23:01-01:00:5E:28:23:01

engine shouldn't accept such range, since there is no ordinary MACs left,
But engine actually accept this range, but after restarting engine, you can't add nic to VM. with error in GUI:
Error while executing action:

Admins_:

    General command validation failure.

Lior, When i tested this, invalid ranges on the older builds, engine was blocking me from accepting such invalid ranges on the engine-config.

Comment 6 Lior Vernia 2014-12-01 15:16:18 UTC
I thought that's exactly what Meni did?...

Comment 7 Michael Burman 2014-12-01 15:36:38 UTC
Meni did other invalid range.
It's just another example.
Just wanted to add, that all invalid ranges used to be blocked by the engine-config..

Comment 8 Lior Vernia 2014-12-01 15:44:16 UTC
Ack, all such scenarios should be handled the same way after this fix... For you to verify after the next build :)

Comment 9 Martin Mucha 2014-12-02 11:56:18 UTC
(In reply to Michael Burman from comment #5)
> The same error validation should be for:
> RHEVM is supposed to remove Multicast MAC addresses form MAC range, lets see
> what happens if the only MAC specified is multicast-
>  engine-config -s MaxMacsCountInPool=1
>  engine-config -s MacPoolRanges=01:00:5E:28:23:01-01:00:5E:28:23:01
> 
> engine shouldn't accept such range, since there is no ordinary MACs left,
> But engine actually accept this range, but after restarting engine, you
> can't add nic to VM. with error in GUI:
> Error while executing action:
> 
> Admins_:
> 
>     General command validation failure.
> 
> Lior, When i tested this, invalid ranges on the older builds, engine was
> blocking me from accepting such invalid ranges on the engine-config.

yesterday was merged updated code: response for:
engine-config -s MacPoolRanges=01:00:5E:28:23:01-01:00:5E:28:23:01
is now:

WARNING: User supplied range(Range[1101091316481,1101091316481]) contains only multicast addresses, so this range is not usable.
Cannot set value 01:00:5E:28:23:01-01:00:5E:28:23:01 to key MacPoolRanges. The entered ranges is invalid. 01:00:5E:28:23:01-01:00:5E:28:23:01 contains no valid MAC addresses.

note that warning is (usually) present only in logs, so user will (usually) see only second line.

Comment 10 Michael Burman 2014-12-08 14:24:09 UTC
Verified on - 3.5.0-0.23.beta.el6ev

- invalid values such as:
engine-config -s MacPoolRanges=01:00:5E:28:23:01-01:00:5E:28:23:01
engine-config -s MacPoolRanges=FF:00:00:00:00:00-FF:00:00:00:00:01
get:
'Cannot set value FF:00:00:00:00:00-FF:00:00:00:00:01 to key MacPoolRanges. The entered ranges is invalid. FF:00:00:00:00:00-FF:00:00:00:00:01 contains no valid MAC addresses.'

- invalid values such as:
engine-config-s MacPoolRanges=01:00:5E:28:23:01-01:00:5E:28:23:01,FF:00:00:00:00:00-FF:00:00:00:00:01
get:
'Cannot set value 01:00:5E:28:23:01-01:00:5E:28:23:01,FF:00:00:00:00:00-FF:00:00:00:00:01 to key MacPoolRanges. The entered ranges is invalid. 01:00:5E:28:23:01-01:00:5E:28:23:01,FF:00:00:00:00:00-FF:00:00:00:00:01 contains no valid MAC addresses.' - both ranges are invalid in this case.

- valid and invalid values such as:
engine-config -s MacPoolRanges=FF:00:00:00:00:00-FF:00:00:00:00:01,F0:00:00:00:00:00-F0:00:00:00:00:01
engine-config -s MacPoolRanges=FF:00:00:00:00:00-FF:00:00:00:00:01,00:00:00:00:00:00-00:00:00:00:00:01
get no error or blocked by engine, because one of the ranges entered is a valid MAC addresses.

Comment 11 Eyal Edri 2015-02-17 17:10:05 UTC
rhev 3.5.0 was released. closing.


Note You need to log in before you can comment on or make changes to this bug.