Red Hat Bugzilla – Bug 1473860
fence_compute: Agent options defined in fence_compute are ignored
Last modified: 2018-04-10 08:15:31 EDT
Description of problem: There is a change in behaviour of fence_compute between version 4.0.11-47.el7_3.5 (RHEL7.3.z) and 4.0.11-66 (RHEL7.4 wannabe) and since fence_compute code did not change then It must be related to some changes in /usr/share/fencing.py. I've been testing fence_compute behaviour in Openstack environment (Instance HA) and It seems like options[1] defined in fence_compute (auth-url, tenant-name, etc.) are being ignored - at the time of use they have empty value which leads to unsuccessful creation of nova connection. The log from corosync: Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Parse error: Ignoring unknown option 'auth-url=http://10.0.0.101:5000/v2.0' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Parse error: Ignoring unknown option 'record-only=1' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Parse error: Ignoring unknown option 'no-shared-storage=False' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Parse error: Ignoring unknown option 'tenant-name=admin' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Nova connection failed. AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ Nova connection failed. AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Nova connection failed. AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ Nova connection failed. AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient' ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ WARNING:root:Couldn't obtain a supported connection to nova, tried: ['2.11', '2'] ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ Couldn't obtain a supported connection to nova, tried: ['2.11', '2'] ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ Traceback (most recent call last): ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/sbin/fence_compute", line 502, in <module> ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ main() ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/sbin/fence_compute", line 498, in main ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ result = fence_action(None, options, set_power_status, get_power_status, get_plugs_list, None) ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/share/fence/fencing.py", line 1005, in fence_action ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ outlets = get_outlet_list(tn, options) ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/sbin/fence_compute", line 298, in get_plugs_list ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ hypervisors = nova.hypervisors.list() ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/lib/python2.7/site-packages/novaclient/v2/hypervisors.py", line 43, in list ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ return self._list('/os-hypervisors%s' % detail, 'hypervisors') ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 242, in _list ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ resp, body = self.api.client.get(url) ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 452, in get ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ return self._cs_request(url, 'GET', **kwargs) ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 408, in _cs_request ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ self.authenticate() ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 539, in authenticate ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ raise exceptions.AuthorizationFailure(msg) ] Jul 21 17:16:57 [4754] controller-2 stonith-ng: warning: log_action: fence_compute[10436] stderr: [ novaclient.exceptions.AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient' ] Downgrade to RHEL7.3.z version solves problem, no code change in fence_compute.py Version-Release number of selected component (if applicable): 4.0.11-66 How reproducible: Always Steps to Reproduce: 1. Define stonith device of fence-nova which uses fence_compute agent. Actual results: The resource will not get into Started status. [1] https://github.com/ClusterLabs/fence-agents/blob/master/fence/agents/compute/fence_compute.py#L341-L421
Created attachment 1303548 [details] Proposed patch Proposed patch is in the attachment. The problem is in the planned switch to use '-' instead of '_' in stdin options. In order to support both I have expected that '-' is not used anywhere. What is not true as it was already used in fence_compute. This patch changes the name of options but both '_' and '-' variants are working as expected.
I tested scratch build with proposed patch and It fixes the problem.
Additional patch to maintain ABI compatibility: https://github.com/ClusterLabs/fence-agents/pull/146/commits/0b36c4ac191d88922d972668732575ef8a579a5b
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0758