Bug 1286632

Summary: [RFE] When editing fence agents, options displayed should be specific to that agent
Product: [oVirt] ovirt-engine Reporter: Dan Lavu <dlavu>
Component: Frontend.WebAdminAssignee: Oved Ourfali <oourfali>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.6.0.3CC: bugs, dlavu, eheftman, emesika, masayag, mperina, oourfali
Target Milestone: ovirt-4.1.0-alphaKeywords: FutureFeature
Target Release: 4.1.0Flags: mperina: ovirt-4.1?
pmatyas: testing_plan_complete-
rule-engine: planning_ack?
mperina: devel_ack+
pstehlik: testing_ack+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
In this release, a link has been added to the Edit fence agent window which opens the online help and displays information about the parameters that can be set for fence agents.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 14:44:55 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:
Bug Depends On:    
Bug Blocks: 1427727    

Description Dan Lavu 2015-11-30 11:32:46 UTC
Description of problem:
When editing fence agents, options displayed should be specific to that agent, it was quite confusing to see 'SSH Port' when adding 'apc_snmp'. If you haven't done this before, it takes time looking through the engine.log to ensure syntax is being parsed correctly. I think it'd be a nice easy improvement for users. 

Version-Release number of selected component (if applicable):
All versions, this is an RFE

How reproducible:
Always

Steps to Reproduce:
1. Add a fencing agent to a host
2. Select apc_snmp
3. *Note* That snmp does not require SSH and should be renamed to SNMP port. 

Actual results: 
Available options for fence_snmp are

Address:
User Name: 
Password:
Type:
SSH Port: 
Options:


Expected results:

Have mandatory fence agent specific options, these can be found in the fence_script on the host. 

fence_apc_snmp --help
Usage:
	fence_apc_snmp [options]
Options:
   -a, --ip=[ip]                  IP address or hostname of fencing device
   -l, --username=[name]          Login name
   -p, --password=[password]      Login password or passphrase
   -n, --plug=[id]                Physical plug number on device, UUID or
                                        identification of machine
   -d, --snmp-version=[version]   Specifies SNMP version to use
   -c, --community=[community]    Set the community string
   -u, --ipport=[port]            TCP/UDP port to use (default 161)
   -4, --inet4-only               Forces agent to use IPv4 addresses only
   -6, --inet6-only               Forces agent to use IPv6 addresses only
   -S, --password-script=[script] Script to run to retrieve password
   -b, --snmp-auth-prot=[prot]    Set authentication protocol (MD5|SHA)
   -E, --snmp-sec-level=[level]   Set security level
                                  (noAuthNoPriv|authNoPriv|authPriv)
   -B, --snmp-priv-prot=[prot]    Set privacy protocol (DES|AES)
   -P, --snmp-priv-passwd=[pass]  Set privacy protocol password
   -R, --snmp-priv-passwd-script  Script to run to retrieve privacy password
   -o, --action=[action]          Action: status, reboot (default), off or on
   -v, --verbose                  Verbose mode
   -D, --debug-file=[debugfile]   Debugging to output file
   -V, --version                  Output version information and exit
   -h, --help                     Display this help and exit
   -C, --separator=[char]         Separator for CSV created by 'list' operation
   --power-timeout=[seconds]      Test X seconds for status change after ON/OFF
   --shell-timeout=[seconds]      Wait X seconds for cmd prompt after issuing command
   --login-timeout=[seconds]      Wait X seconds for cmd prompt after login
   --power-wait=[seconds]         Wait X seconds after issuing ON/OFF
   --delay=[seconds]              Wait X seconds before fencing is started
   --retry-on=[attempts]          Count of attempts to retry power on



Additional info:

Note this is not specific to just fence_apc other fence agents as well.

Comment 1 Oved Ourfali 2015-12-07 12:32:29 UTC
We do have specific ones.
We renamed the field to PORT, to fit all use-cases, each one filling another type of PORT.

Was there any other example that you saw?

Comment 2 Dan Lavu 2015-12-14 13:59:00 UTC
For the fence_apc_snmp, 'community' should be required, would be nice if 'version' was a pull down.

Comment 3 Oved Ourfali 2015-12-15 10:02:34 UTC
Eli - please review and see what we can do among what's requested by Dan.

Comment 4 Eli Mesika 2015-12-15 11:26:24 UTC
(In reply to Oved Ourfali from comment #3)
> Eli - please review and see what we can do among what's requested by Dan.

Well, we have decided, when we developed the UI for the fencing operations, to implement specifically only a common subset of the parameters which are 

1) Port
2) Slot
3) Secure

All other parameters can be set in a <key>=<value> format in the options field.

Community (--community=[community]) is specific to apc_snmp, therefor it should be set in the options field if required.

Version (--version) is an operation that only returns information 

For example :

/usr/sbin/fence_apc_snmp --version
3.1.5 (built Thu Jul 10 04:49:13 EDT 2014)
Copyright (C) Red Hat, Inc. 2004-2010 All rights reserved.

How this should populated a drop-down???

More than that, the information returned from --version is never used as an input to any fencing operation (status, on , off) , so , what is the point to even put it in a form that includes only fencing parameters ???

All agents supports the command "-o metadata" 
This will return XML describing the parameters lists and description for the agent.
We were thinking in the past that this option can be used to dynamically build a form per fence agent with all supported parameters, but I am not sure that the benefit justify the effort needed to implement that.

Comment 5 Dan Lavu 2015-12-15 16:27:33 UTC
Eli,

SNMP version, not --version, so it'll be either 1, 2c or 3. 


-d, --snmp-version=[version]   Specifies SNMP version to use

Comment 7 Eli Mesika 2016-08-15 14:12:16 UTC
It was agreed that a link to a URL displaying all agents ans their valid parameters will be added to the Add Fence Agent dialog 
We will use branding in order to allow different links for upstream and downstream

Comment 8 Sandro Bonazzola 2016-12-12 14:03:24 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 9 Petr Matyáš 2017-01-26 09:04:06 UTC
Verified on 4.1.0-9

Comment 10 Martin Perina 2017-03-22 16:34:32 UTC
Unfortunately the original page is no longer available, so until we will have a replacement page, we need to hide that link, see BZ1434019