Bug 1129596 - Custom fence agent works with script even if optionMapping parameter is false
Summary: Custom fence agent works with script even if optionMapping parameter is false
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.5.0
Assignee: Eli Mesika
QA Contact: sefi litmanovich
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-13 10:09 UTC by sefi litmanovich
Modified: 2016-02-10 19:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-25 12:40:00 UTC
oVirt Team: Infra
Embargoed:


Attachments (Terms of Use)
engine and vdsm logs (769.91 KB, application/x-tar)
2014-08-13 10:09 UTC, sefi litmanovich
no flags Details
TEST fails on invalid custom agent parameters (37.11 KB, image/png)
2014-08-20 15:38 UTC, Eli Mesika
no flags Details

Description sefi litmanovich 2014-08-13 10:09:08 UTC
Created attachment 926349 [details]
engine and vdsm logs

Description of problem:

When adding a fence agent and providing proxy hosts with fence script for that agent, if an option in CustomVdsFenceOptionMapping is set with a wrong value, no error is raised.

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

ovirt-engine-3.5.0-0.0.master.20140804172041.git23b558e.el6.noarch

How reproducible:

always

after adding a fence agent type name "test_fence_agent" and copied at the proxy host the ipmilan fence script to a new script "fence_test_fence_agent" I tried some configurations for CustomVdsFenceOptionMapping parameter.


1. CustomVdsFenceOptionMapping="test_fence_Agent:" (same as ipmilan mapping) - restart engine - mapping in ui is similar to ipmilan - test works.

in proxy host vdsm.log:

Thread-45::DEBUG::2014-08-12 12:29:08,838::API::1153::vds::(fenceNode) fenceNode(addr={ipmilan_agent_address},port=,agent=test_fence_agent,user=root,passwd=XXXX,action=status,secure=,options
=)

2. CustomVdsFenceOptionMapping="test_fence_Agent:port=invalid" - restart engine - mapping in ui has ssh port field with no value. - test works.

same message in vdsm.log (port=,agent.....), port didn't get the invalid value.

3. CustomVdsFenceOptionMapping="test_fence_Agent:port=ipport" - restart engine - mapping in ui has ssh port field with no value. - test works.

same message in vdsm.log (port=,agent.....), port didn't get any value.

4. CustomVdsFenceOptionMapping="test_fence_Agent:blabla=invalid"- restart engine - mapping in ui is similar to ipmilan - test works.

same vdsm message.

5. CustomVdsFenceOptionMapping="different_fence_Agent:" - restart engine - mapping has all the different fields (as default apc) - test fails with message:

'Power Management test failed for Host {PROXY_HOST_NAME}.There is no other host in the data center that can be used to test the power management settings.'

Basically it seems that defining an agent of type name X and providing a script fence_X and configuring any sort of mapping is enough for the agent to work.
Is this the expected functionality, when does 'CustomVdsFenceOptionMapping' values make a difference?


Expected results:

1. when option port gets a false value or a non existing option is given e.g. blabla=invalid raise an error.

or 

2. if not an error then if port is defined with an illegal value (e.g. port=invalid) treat this case as if this parameter wasn't given and do not show this option in ui as well.

Comment 1 Eli Mesika 2014-08-20 15:37:32 UTC
Can not reproduced om latest 3.5 branch

Had two hosts h1 and h2
h1 has apc_snmp PM card
h2 with no PM

had copied in h2:/usr/sbin fence_apc_snmp to fence_custom

run:

engine-config -s CustomVdsFenceType="custom"
engine-config -s CustomVdsFenceOptionMapping="custom:port=port"

restarted engine 
defined h1 with the custom PM and click TEST => OK

stopped engine

run:

engine-config -s CustomVdsFenceOptionMapping="custom:port=invalid"

started engine 

Clicked TEST on h1 Edit PM TAB => FAILED

Get error as expected (attached) 

Please test again with next build

Comment 2 Eli Mesika 2014-08-20 15:38:11 UTC
Created attachment 928869 [details]
TEST fails on invalid custom agent parameters


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