Bug 1770973

Summary: [RFE] The cluster should not be allowed to disable a resource if dependent resources are still online
Product: Red Hat Enterprise Linux 7 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: high Docs Contact:
Priority: high    
Version: 7.7CC: aherr, cfeist, cluster-maint, cluster-qe, djansa, idevat, mlisik, mpospisi, nhostako, omular, rblough, tborcin, tojeline
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.9.168-4.el7 Doc Type: Enhancement
Doc Text:
Feature: Provide means for disabling resources only if no other resources would be stopped in effect. Reason: Sometimes there is a need to disable a resource without having any effect on other resources. When complex resource relations are set up, this is impossible to do by hand. Result: New options have been added to the "pcs resource disable" command. * "pcs resource disable --simulate": show effects of disabling specified resource(s) while not changing the cluster configuration * "pcs resource disable --safe": disable specified resource(s) only if no other resources would be affected in any way, i.e. migrated from a node to another node * "pcs resource disable --safe --no-strict": disable specified resource(s) only if no other resources would be stopped or demoted New command "pcs resource safe-disable" has been introduced which is an alias for "pcs resource disable --safe"
Story Points: ---
Clone Of: 1631519
: 1787598 (view as bug list) Environment:
Last Closed: 2020-03-31 19:09:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1631519    
Bug Blocks: 1787598    

Description Tomas Jelinek 2019-11-11 15:49:57 UTC
+++ This bug was initially created as a clone of Bug #1631519 +++

1. Proposed title of this feature request
Do not disable a resource if dependent resources are still online

3. What is the nature and description of the request?
When disabling a resource, we want to know if resources that rely on it are still operating. For example, we don't want to pull an lvm resource out from under a filesystem resource, or a filesystem resource out from under a db resource.

4. Why does the customer need this? (List the business requirements here)
Prevent data loss/corruption by stopping resources inappropriately.

5. How would the customer like to achieve this? (List the functional requirements here)
An error or at least a warning should be thrown when a pcs resource disable <resource id> command targets a resource which is a dependency of other running resources.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
Before: pcs resource disable <resource id> succeeds.
After: pcs resource disable <resource id> throws error or warning.

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
No.

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
7.6 if possible.

9. Is the sales team involved in this request and do they have any additional input?
No.

10. List any affected packages or components.
pcs

11. Would the customer be able to assist in testing this functionality if implemented?
Yes.

Comment 4 Ondrej Mular 2019-12-13 11:06:59 UTC
Additional commits:
https://github.com/ClusterLabs/pcs/commit/e36dd29b861c1bf767dc3ec2b43b3e91f9daef32
https://github.com/ClusterLabs/pcs/commit/731cb69442e9ca7c2d1a4881dd632682a0670703

Test:
[root@rhel78-node1 ~]# pcs resource create dummy1 ocf:pacemaker:Dummy --clone
[root@rhel78-node1 ~]# pcs resource safe-disable dummy1-clone; echo $?
0

Comment 6 Ondrej Mular 2019-12-19 07:37:06 UTC
Test:
[root@rhel78-node1 ~]# rpm -q pcs
pcs-0.9.168-4.el7.x86_64
[root@rhel78-node1 ~]# pcs resource safe-disable d1
Error: Disabling specified resources would have an effect on other resources

1 of 3 resources DISABLED and 0 BLOCKED from being started due to failures

Current cluster status:
Online: [ localhost ]

 Clone Set: dummy-clone [dummy]
     Started: [ localhost ]
 Clone Set: dummy1-clone [dummy1]
     Started: [ localhost ]
 d1     (ocf::pacemaker:Dummy): Started localhost (disabled)

Transition Summary:
 * Stop       dummy:0     ( localhost )   due to required d1 start
 * Stop       d1          ( localhost )   due to node availability

Executing cluster transition:
 * Pseudo action:   dummy-clone_stop_0
 * Resource action: dummy           stop on localhost
 * Pseudo action:   dummy-clone_stopped_0
 * Resource action: d1              stop on localhost

Revised cluster status:
Online: [ localhost ]

 Clone Set: dummy-clone [dummy]
     Stopped: [ localhost ]
 Clone Set: dummy1-clone [dummy1]
     Started: [ localhost ]
 d1     (ocf::pacemaker:Dummy): Stopped (disabled)
[root@rhel78-node1 ~]# echo $?
1

Comment 11 errata-xmlrpc 2020-03-31 19:09:41 UTC
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-2020:0996