Bug 962666

Summary: Wrong user-defined custom properties prevent engine from loading
Product: Red Hat Enterprise Virtualization Manager Reporter: Gilad Chaplik <gchaplik>
Component: ovirt-engineAssignee: Martin Perina <mperina>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, bazulay, bdagan, dfediuck, gchaplik, iheim, jkt, lpeer, michal.skrivanek, mperina, Rhev-m-bugs, yeylon, yzaslavs
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 22:17:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gilad Chaplik 2013-05-14 08:06:28 UTC
Description of problem:
Wrong user-defined custom properties prevent engine from loading

How reproducible:
100%

Steps to Reproduce:
Enter UserDefinedVMProperties containing chars other then ';', '=', ,[a-z_A-Z0-9]
  
Actual results:
Backend fail to load

Expected results:
Proper error, or ignoring that property.

Comment 1 Gilad Chaplik 2013-05-14 08:36:22 UTC
> Enter UserDefinedVMProperties containing chars other then ';', '=',
> ,[a-z_A-Z0-9]
>   

other than... :/

Comment 3 Martin Perina 2013-05-14 11:22:49 UTC
Moti told me, that there's no UserDefinedVMProperties validator defined in engine-config tool. I will create such validator for UserDefinedVMProperties (so only valid properties could be entered) as soon as device custom properties patch will be ready, because it changes many things in VMPropertiesUtils class.

Comment 4 Yair Zaslavsky 2013-05-19 08:56:04 UTC
(In reply to comment #3)
> Moti told me, that there's no UserDefinedVMProperties validator defined in
> engine-config tool. I will create such validator for UserDefinedVMProperties
> (so only valid properties could be entered) as soon as device custom
> properties patch will be ready, because it changes many things in
> VMPropertiesUtils class.

I agree with this path.
Can you please asses how long it will take you to come up with such validator (based on the fact you need to require a validator for custom device properties)

Comment 6 Artyom 2013-08-25 11:56:32 UTC
Please write exactly what you write under UserDefinedVMProperties, that after this engine stack?
Enter special characters, also tried Russian symbols, engine work fine and do restart without problem  
rhevm-config -s UserDefinedVMProperties='test=$%2as'
Please select a version:
1. 3.0
2. 3.1
3. 3.2
4. 3.3
4
[root@artyom-rhevm-33 ~]# rhevm-config -g UserDefinedVMProperties
UserDefinedVMProperties:  version: 3.0
UserDefinedVMProperties:  version: 3.1
UserDefinedVMProperties:  version: 3.2
UserDefinedVMProperties: test=$%2as version: 3.3
[root@artyom-rhevm-33 ~]# service ovirt-engine restart
Stopping oVirt Engine:                                     [  OK  ]
Starting oVirt Engine:                                     [  OK  ]
[root@artyom-rhevm-33 ~]# rhevm-config -s UserDefinedVMProperties='test=фыв'
Please select a version:
1. 3.0
2. 3.1
3. 3.2
4. 3.3
4
[root@artyom-rhevm-33 ~]# service ovirt-engine restart
Stopping oVirt Engine:                                     [  OK  ]
Starting oVirt Engine:                                     [  OK  ]
[root@artyom-rhevm-33 ~]# rhevm-config -g UserDefinedVMProperties
UserDefinedVMProperties:  version: 3.0
UserDefinedVMProperties:  version: 3.1
UserDefinedVMProperties:  version: 3.2
UserDefinedVMProperties: test=фыв version: 3.3

also create vm with this custom parameter

about patch, still no any validation on input for rhevm-config -s UserDefinedVMProperties

Comment 7 Martin Perina 2013-08-27 09:53:18 UTC
All your tests contains only valid characters for property definition. Currently there are these rules for properties:

1) Property name can contain only upper/lower case, number or underscore
2) Property value can contain every characters except semicolon

So if you try following examples, you will receive validation errors, but before patch 14914, those values would be ok, but engine wouldn't start:

engine-config -s UserDefinedVMProperties='te#st=1'
engine-config -s UserDefinedVMProperties='test=1;3'


But watch out for this example:

engine-config -s UserDefinedVMProperties='test=1;'

This one will not throw an error, because semicolon is used as property definition delimiter, so property with name 'test' and value '1' will be created.

Comment 8 Artyom 2013-09-01 06:34:53 UTC
Trying examples from comment above receive message:
"Cannot set value test=1;3 to key UserDefinedVMProperties. Invalid syntax, user defined VM properties specification should conform to (([a-z_A-Z0-9])+)=(([^;])+)(;(([a-z_A-Z0-9])+)=(([^;])+))*;?"
Verified on is12

Comment 9 Itamar Heim 2014-01-21 22:17:00 UTC
Closing - RHEV 3.3 Released

Comment 10 Itamar Heim 2014-01-21 22:23:40 UTC
Closing - RHEV 3.3 Released