Bug 1730232
Summary: | [RFE] Provide easier management of constraints created by pcs move command | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Chris Feist <cfeist> | |
Component: | pcs | Assignee: | Miroslav Lisik <mlisik> | |
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
Severity: | high | Docs Contact: | Steven J. Levine <slevine> | |
Priority: | high | |||
Version: | 8.0 | CC: | bfrank, cluster-maint, idevat, mmazoure, nhostako, omular, slevine, svalasti, tojeline | |
Target Milestone: | rc | Keywords: | FutureFeature, Reopened, Triaged | |
Target Release: | 8.7 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | pcs-0.10.13-1.el8 | Doc Type: | Enhancement | |
Doc Text: |
Feature:
Pcs status displays warning about constraints created by move command.
Reason:
Constraints created by move command can be forgotten by a user.
Result:
User can be noticed from pcs status that there are move constraints still in place.
|
Story Points: | --- | |
Clone Of: | ||||
: | 2058247 (view as bug list) | Environment: | ||
Last Closed: | 2022-11-08 09:12:53 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Chris Feist
2019-07-16 09:16:40 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. Upstream commit: https://github.com/ClusterLabs/pcs/commit/acc1a9264d90fdec52c244ca1fc6c60939d5ddf4 Updated commands: * pcs status * pcs resource move 1. Pcs status displays warning with resources which have constraints created by 'pcs resource move' command. 2. Command 'pcs resource move' displays warning in case when a move constraint is created for a resource but resource may not move because there could be other configuration preventing resource running on the specified node. Test: Prepare 1 cli-ban constraint, 1 cli-prefer constraint and 1 location constraint with -INFINITY. [root@r8-node-01 ~]# pcs resource * d1 (ocf::pacemaker:Dummy): Started r8-node-01 * d2 (ocf::pacemaker:Dummy): Started r8-node-02 * d3 (ocf::pacemaker:Dummy): Started r8-node-03 [root@r8-node-01 ~]# pcs resource move d1 Warning: Creating location constraint 'cli-ban-d1-on-r8-node-01' with a score of -INFINITY for resource d1 on r8-node-01. This will prevent d1 from running on r8-node-01 until the constraint is removed This will be the case even if r8-node-01 is the last node in the cluster [root@r8-node-01 ~]# pcs resource move d3 r8-node-01 [root@r8-node-01 ~]# pcs constraint location d3 avoids r8-node-02 [root@r8-node-01 ~]# pcs constraint location --full Location Constraints: Resource: d1 Disabled on: Node: r8-node-01 (score:-INFINITY) (role:Started) (id:cli-ban-d1-on-r8-node-01) Resource: d3 Enabled on: Node: r8-node-01 (score:INFINITY) (role:Started) (id:cli-prefer-d3) Disabled on: Node: r8-node-02 (score:-INFINITY) (id:location-d3-r8-node-02--INFINITY) Check warnings in the status: [root@r8-node-01 ~]# pcs status Cluster name: HACluster WARNINGS: Following resources have been moved and their move constraints are still in place: 'd1', 'd3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively Cluster Summary: * Stack: corosync * Current DC: r8-node-03 (version 2.1.2-4.el8-ada5c3b36e2) - partition with quorum * Last updated: Mon Mar 28 17:47:16 2022 * Last change: Mon Mar 28 17:46:47 2022 by hacluster via crmd on r8-node-03 * 3 nodes configured * 6 resource instances configured Node List: * Online: [ r8-node-01 r8-node-02 r8-node-03 ] Full List of Resources: * fence-r8-node-01 (stonith:fence_xvm): Started r8-node-01 * fence-r8-node-02 (stonith:fence_xvm): Started r8-node-02 * fence-r8-node-03 (stonith:fence_xvm): Started r8-node-03 * d1 (ocf::pacemaker:Dummy): Started r8-node-02 * d2 (ocf::pacemaker:Dummy): Started r8-node-01 * d3 (ocf::pacemaker:Dummy): Started r8-node-01 Daemon Status: corosync: active/disabled pacemaker: active/disabled pcsd: active/disabled Try to move resource d3 to a node where it has location constraint with -INFINITY created by a user. [root@r8-node-01 ~]# pcs resource move d3 r8-node-02 Warning: A move constraint has been created and the resource 'd3' may or may not move depending on other configuration [root@r8-node-01 ~]# pcs resource * d1 (ocf::pacemaker:Dummy): Started r8-node-02 * d2 (ocf::pacemaker:Dummy): Started r8-node-01 * d3 (ocf::pacemaker:Dummy): Started r8-node-03 [root@r8-node-01 ~]# pcs constraint location --full Location Constraints: Resource: d1 Disabled on: Node: r8-node-01 (score:-INFINITY) (role:Started) (id:cli-ban-d1-on-r8-node-01) Resource: d3 Enabled on: Node: r8-node-02 (score:INFINITY) (role:Started) (id:cli-prefer-d3) Disabled on: Node: r8-node-02 (score:-INFINITY) (id:location-d3-r8-node-02--INFINITY) DevTestResults: [root@r8-node-01 ~]# rpm -q pcs pcs-0.10.13-1.el8.x86_64 Prepare 1 cli-ban constraint, 1 cli-prefer constraint and 1 location constraint with -INFINITY. [root@r8-node-01 ~]# pcs resource * d1 (ocf::pacemaker:Dummy): Started r8-node-01 * d2 (ocf::pacemaker:Dummy): Started r8-node-02 * d3 (ocf::pacemaker:Dummy): Started r8-node-03 [root@r8-node-01 ~]# pcs resource move d1 Warning: Creating location constraint 'cli-ban-d1-on-r8-node-01' with a score of -INFINITY for resource d1 on r8-node-01. This will prevent d1 from running on r8-node-01 until the constraint is removed This will be the case even if r8-node-01 is the last node in the cluster [root@r8-node-01 ~]# pcs resource move d3 r8-node-01 Warning: A move constraint has been created and the resource 'd3' may or may not move depending on other configuration [root@r8-node-01 ~]# pcs constraint location d3 avoids r8-node-02 [root@r8-node-01 ~]# pcs constraint location --full Location Constraints: Resource: d1 Disabled on: Node: r8-node-01 (score:-INFINITY) (role:Started) (id:cli-ban-d1-on-r8-node-01) Resource: d3 Enabled on: Node: r8-node-01 (score:INFINITY) (role:Started) (id:cli-prefer-d3) Disabled on: Node: r8-node-02 (score:-INFINITY) (id:location-d3-r8-node-02--INFINITY) Check warnings in the status. [root@r8-node-01 ~]# pcs status | grep WARNINGS: -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'd1', 'd3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively Try to move resource d3 to a node where it has location constraint with -INFINITY created by a user. [root@r8-node-01 ~]# pcs resource move d3 r8-node-02 Warning: A move constraint has been created and the resource 'd3' may or may not move depending on other configuration [root@r8-node-01 ~]# pcs resource * d1 (ocf::pacemaker:Dummy): Started r8-node-02 * d2 (ocf::pacemaker:Dummy): Started r8-node-01 * d3 (ocf::pacemaker:Dummy): Started r8-node-03 [root@r8-node-01 ~]# pcs constraint location --full Location Constraints: Resource: d1 Disabled on: Node: r8-node-01 (score:-INFINITY) (role:Started) (id:cli-ban-d1-on-r8-node-01) Resource: d3 Enabled on: Node: r8-node-02 (score:INFINITY) (role:Started) (id:cli-prefer-d3) Disabled on: Node: r8-node-02 (score:-INFINITY) (id:location-d3-r8-node-02--INFINITY) Resource wasn't moved. [root@virt-487 ~]# rpm -q pcs pcs-0.10.14-1.el8.x86_64 1.) Checking the validity of warning message after a resource move (without specification of the dest. node.) A.) Moving 'dummy1' and after that removing constraint. [root@virt-487 ~]# pcs resource * Clone Set: locking-clone [locking]: * Started: [ virt-487 virt-491 virt-492 ] * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs resource move dummy1 Warning: Creating location constraint 'cli-ban-dummy1-on-virt-487' with a score of -INFINITY for resource dummy1 on virt-487. This will prevent dummy1 from running on virt-487 until the constraint is removed This will be the case even if virt-487 is the last node in the cluster [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs constraint location Location Constraints: Resource: dummy1 Disabled on: Node: virt-487 (score:-INFINITY) (role:Started) [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs resource clear dummy1 Removing constraint: cli-ban-dummy1-on-virt-487 [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 > OK. The warning message disappears if the constraints are removed. B.) Creating an avoidance constraint before moving resource. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-491 * dummy2 (ocf::heartbeat:Dummy): Started virt-487 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs constraint location dummy1 avoids virt-492=INFINITY [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs constraint location Location Constraints: Resource: dummy1 Disabled on: Node: virt-492 (score:-INFINITY) [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 > OK. No warning message is displayed in case of manual avoid constraint creation. [root@virt-487 ~]# pcs resource move dummy1 Warning: Creating location constraint 'cli-ban-dummy1-on-virt-491' with a score of -INFINITY for resource dummy1 on virt-491. This will prevent dummy1 from running on virt-491 until the constraint is removed This will be the case even if virt-491 is the last node in the cluster [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively > OK. After moving the dummy1 resource, the warning message is displayed. C.) Moving multiple resources to the same cluster node. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs constraint location dummy2 prefers virt-491=INFINITY [root@virt-487 ~]# pcs constraint location dummy3 prefers virt-492=INFINITY [root@virt-487 ~]# pcs constraint location Location Constraints: Resource: dummy2 Enabled on: Node: virt-491 (score:INFINITY) Resource: dummy3 Enabled on: Node: virt-492 (score:INFINITY) [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 > OK. No warning message is displayed in case of manual prefers constraints creation. [root@virt-487 ~]# pcs resource move dummy1 Warning: Creating location constraint 'cli-ban-dummy1-on-virt-487' with a score of -INFINITY for resource dummy1 on virt-487. This will prevent dummy1 from running on virt-487 until the constraint is removed This will be the case even if virt-487 is the last node in the cluster [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively > OK, pcs notify about constraint after 'pcs move' of 'dummy1' resource. [root@virt-487 ~]# pcs constraint location dummy3 avoids virt-487=INFINITY [root@virt-487 ~]# pcs constraint location Location Constraints: Resource: dummy1 Disabled on: Node: virt-487 (score:-INFINITY) (role:Started) Resource: dummy2 Enabled on: Node: virt-491 (score:INFINITY) Resource: dummy3 Enabled on: Node: virt-492 (score:INFINITY) Disabled on: Node: virt-487 (score:-INFINITY) [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively > OK. No notification if avoidance constraint is created. [root@virt-487 ~]# pcs resource move dummy3 Warning: Creating location constraint 'cli-ban-dummy3-on-virt-492' with a score of -INFINITY for resource dummy3 on virt-492. This will prevent dummy3 from running on virt-492 until the constraint is removed This will be the case even if virt-492 is the last node in the cluster [root@virt-487 ~]# pcs status | grep "dummy" Following resources have been moved and their move constraints are still in place: 'dummy1', 'dummy3' * dummy1 (ocf::heartbeat:Dummy): Started virt-491 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-491 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1', 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively > OK. D.) Removing constraints by using the 'pcs resource clear' command. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs constraint location Location Constraints: [root@virt-487 ~]# pcs resource move dummy3 Warning: Creating location constraint 'cli-ban-dummy3-on-virt-492' with a score of -INFINITY for resource dummy3 on virt-492. This will prevent dummy3 from running on virt-492 until the constraint is removed This will be the case even if virt-492 is the last node in the cluster [root@virt-487 ~]# pcs resource move dummy2 Warning: Creating location constraint 'cli-ban-dummy2-on-virt-491' with a score of -INFINITY for resource dummy2 on virt-491. This will prevent dummy2 from running on virt-491 until the constraint is removed This will be the case even if virt-491 is the last node in the cluster [root@virt-487 ~]# pcs resource move dummy1 Warning: Creating location constraint 'cli-ban-dummy1-on-virt-487' with a score of -INFINITY for resource dummy1 on virt-487. This will prevent dummy1 from running on virt-487 until the constraint is removed This will be the case even if virt-487 is the last node in the cluster [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1', 'dummy2', 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs resource clear dummy3 Removing constraint: cli-ban-dummy3-on-virt-492 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1', 'dummy2' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs resource clear dummy1 Removing constraint: cli-ban-dummy1-on-virt-487 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy2' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs resource clear dummy2 Removing constraint: cli-ban-dummy2-on-virt-491 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 > OK. The warning message works reliably and responds to the removal of constraints. E.) Manual removal of constraints that were created by moving resources. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs constraint location Location Constraints: [root@virt-487 ~]# pcs resource move dummy2 Warning: Creating location constraint 'cli-ban-dummy2-on-virt-491' with a score of -INFINITY for resource dummy2 on virt-491. This will prevent dummy2 from running on virt-491 until the constraint is removed This will be the case even if virt-491 is the last node in the cluster [root@virt-487 ~]# pcs resource move dummy3 Warning: Creating location constraint 'cli-ban-dummy3-on-virt-491' with a score of -INFINITY for resource dummy3 on virt-491. This will prevent dummy3 from running on virt-491 until the constraint is removed This will be the case even if virt-491 is the last node in the cluster [root@virt-487 ~]# pcs resource move dummy1 Warning: Creating location constraint 'cli-ban-dummy1-on-virt-487' with a score of -INFINITY for resource dummy1 on virt-487. This will prevent dummy1 from running on virt-487 until the constraint is removed This will be the case even if virt-487 is the last node in the cluster [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1', 'dummy2', 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs constraint location --full Location Constraints: Resource: dummy1 Disabled on: Node: virt-487 (score:-INFINITY) (role:Started) (id:cli-ban-dummy1-on-virt-487) Resource: dummy2 Disabled on: Node: virt-491 (score:-INFINITY) (role:Started) (id:cli-ban-dummy2-on-virt-491) Resource: dummy3 Disabled on: Node: virt-491 (score:-INFINITY) (role:Started) (id:cli-ban-dummy3-on-virt-491) [root@virt-487 ~]# pcs constraint location delete cli-ban-dummy2-on-virt-491 [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy1', 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs constraint location delete cli-ban-dummy1-on-virt-487 [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs constraint location delete cli-ban-dummy3-on-virt-491 [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 > OK. 2.) Checking the validity of warning message after the resource move (with specification of the destination node.) A.) Check if the notification message responds correctly to the removal of the constraints that have been created by the move of dummy resources. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs resource move dummy2 virt-487 Warning: A move constraint has been created and the resource 'dummy2' may or may not move depending on other configuration [root@virt-487 ~]# pcs resource move dummy3 virt-487 Warning: A move constraint has been created and the resource 'dummy3' may or may not move depending on other configuration [root@virt-487 ~]# pcs constraint location --full Location Constraints: Resource: dummy2 Enabled on: Node: virt-487 (score:INFINITY) (role:Started) (id:cli-prefer-dummy2) Resource: dummy3 Enabled on: Node: virt-487 (score:INFINITY) (role:Started) (id:cli-prefer-dummy3) [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy2', 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively > OK. [root@virt-487 ~]# pcs status | grep "dummy" Following resources have been moved and their move constraints are still in place: 'dummy2', 'dummy3' * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-487 * dummy3 (ocf::heartbeat:Dummy): Started virt-487 [root@virt-487 ~]# pcs resource clear dummy2 Removing constraint: cli-prefer-dummy2 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy3' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs resource clear dummy3 Removing constraint: cli-prefer-dummy3 [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs status | grep "WARNINGS" > OK. B.) Test how the manually created constraint affects the following move of 'dummy' resource. [root@virt-487 ~]# pcs status | grep "dummy" * dummy (ocf::heartbeat:Dummy): Started virt-487 [root@virt-487 ~]# pcs constraint location --full Location Constraints: [root@virt-487 ~]# pcs constraint location dummy avoids virt-491=INFINITY [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs constraint location --full Location Constraints: Resource: dummy Disabled on: Node: virt-491 (score:-INFINITY) (id:location-dummy-virt-491--INFINITY) [root@virt-487 ~]# pcs resource move dummy virt-491 Warning: A move constraint has been created and the resource 'dummy' may or may not move depending on other configuration [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3 WARNINGS: Following resources have been moved and their move constraints are still in place: 'dummy' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively [root@virt-487 ~]# pcs constraint location --full Location Constraints: Resource: dummy Enabled on: Node: virt-491 (score:INFINITY) (role:Started) (id:cli-prefer-dummy) Disabled on: Node: virt-491 (score:-INFINITY) (id:location-dummy-virt-491--INFINITY) [root@virt-487 ~]# pcs status | grep "dummy" -A 1 Following resources have been moved and their move constraints are still in place: 'dummy' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively -- * dummy (ocf::heartbeat:Dummy): Started virt-487 > OK. 'pcs status' displays warning message even in cases when the resource is not moved due to previous declared constraints. [root@virt-487 ~]# pcs constraint location delete location-dummy-virt-491--INFINITY [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "dummy" -A 1 Following resources have been moved and their move constraints are still in place: 'dummy' Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively -- * dummy (ocf::heartbeat:Dummy): Started virt-491 [root@virt-487 ~]# pcs constraint location delete cli-prefer-dummy [root@virt-487 ~]# echo $? 0 [root@virt-487 ~]# pcs status | grep "dummy" -A 1 * dummy (ocf::heartbeat:Dummy): Started virt-491 [root@virt-487 ~]# pcs status | grep "WARNINGS" -A 1 > OK. After removing a constraint that was created by resource move, a warning message is no longer displayed. 3.) Check if a warning message is displayed in case of using --autodelete switch in 'pcs resource move' A.) Destination node is specified. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs constraint location Location Constraints: [root@virt-487 ~]# pcs resource move dummy1 virt-492 --autodelete Location constraint to move resource 'dummy1' has been created Waiting for the cluster to apply configuration changes... Location constraint created to move resource 'dummy1' has been removed Waiting for the cluster to apply configuration changes... resource 'dummy1' is running on node 'virt-492' [root@virt-487 ~]# pcs status | grep "WARNINGS" > OK. A warning message should not be displayed when the constraint is removed. B.) Destination node is not specified. [root@virt-487 ~]# pcs status | grep "dummy" * dummy1 (ocf::heartbeat:Dummy): Started virt-487 * dummy2 (ocf::heartbeat:Dummy): Started virt-491 * dummy3 (ocf::heartbeat:Dummy): Started virt-492 [root@virt-487 ~]# pcs constraint --full Location Constraints: Ordering Constraints: Colocation Constraints: Ticket Constraints: [root@virt-487 ~]# pcs resource move dummy1 --autodelete Location constraint to move resource 'dummy1' has been created Waiting for the cluster to apply configuration changes... Location constraint created to move resource 'dummy1' has been removed Waiting for the cluster to apply configuration changes... resource 'dummy1' is running on node 'virt-491' [root@virt-487 ~]# pcs status | grep "WARNINGS" > OK. A warning message should not be displayed when the constraint is removed. 4.) Testing the display of a warning message in case of a temporary constraint (lifetime switch)
[root@virt-487 ~]# pcs status | grep "dummy"
* dummy1 (ocf::heartbeat:Dummy): Started virt-487
* dummy2 (ocf::heartbeat:Dummy): Started virt-491
* dummy3 (ocf::heartbeat:Dummy): Started virt-492
[root@virt-487 ~]# pcs resource move dummy1 lifetime=PT1M
Migration will take effect until: 2022-07-20 15:13:12 +02:00
Warning: Creating location constraint 'cli-ban-dummy1-on-virt-487' with a score of -INFINITY for resource dummy1 on virt-487.
This will prevent dummy1 from running on virt-487 until the constraint is removed
This will be the case even if virt-487 is the last node in the cluster
[root@virt-487 ~]# date
Wed Jul 20 15:12:17 CEST 2022
[root@virt-487 ~]# pcs constraint location
Location Constraints:
Resource: dummy1
Constraint: cli-ban-dummy1-on-virt-487
Rule: boolean-op=and score=-INFINITY
Expression: #uname eq string virt-487
Expression: date lt 2022-07-20 15:13:12 +02:00
[root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3
WARNINGS:
Following resources have been moved and their move constraints are still in place: 'dummy1'
Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively
[root@virt-487 ~]# pcs status | grep "dummy"
Following resources have been moved and their move constraints are still in place: 'dummy1'
* dummy1 (ocf::heartbeat:Dummy): Started virt-491
* dummy2 (ocf::heartbeat:Dummy): Started virt-487
* dummy3 (ocf::heartbeat:Dummy): Started virt-492
[root@virt-487 ~]# date
Wed Jul 20 15:13:22 CEST 2022
[root@virt-487 ~]# pcs constraint location
Location Constraints:
[root@virt-487 ~]# pcs status | grep "WARNINGS" -A 3
WARNINGS:
Following resources have been moved and their move constraints are still in place: 'dummy1'
Run 'pcs constraint location' or 'pcs resource clear <resource id>' to view or remove the constraints, respectively
> The warning message should not be available after the constraint expiration. As can be seen from this example, the warning message about the existence of the constraint after resource move is available to the user even after the constraint has expired.
Re comment 38: This is expected. Even when a constraint is expired, it is still in place (i.e. present in the CIB). It can be shown by 'pcs constraint location' and removed by 'pcs resource clear <resource id>'. Considering a user's point of view, showing an expired location constraint in pcs status as a 'constraint in place' will not help the user, on the contrary might be confusing as the constraint is no longer in effect. Such a constraint is not present in 'pcs constraint location' after expiration, it can only be found in 'pcs constraint location --all' where is marked as expired. From the QA side we agreed on this should be fixed. After further discussion, the issue was moved to a separate BZ bz2111583. Marking this bz verified based on comment37. 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 (Moderate: pcs security, bug fix, and enhancement update), 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/RHSA-2022:7447 |