RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1730232 - [RFE] Provide easier management of constraints created by pcs move command
Summary: [RFE] Provide easier management of constraints created by pcs move command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.7
Assignee: Miroslav Lisik
QA Contact: cluster-qe@redhat.com
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-16 09:16 UTC by Chris Feist
Modified: 2022-11-08 09:22 UTC (History)
9 users (show)

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.
Clone Of:
: 2058247 (view as bug list)
Environment:
Last Closed: 2022-11-08 09:12:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1847102 1 None None None 2023-06-27 12:59:41 UTC
Red Hat Issue Tracker CLUSTERQE-5144 0 None None None 2021-10-25 19:44:22 UTC
Red Hat Knowledge Base (Solution) 6169652 0 None None None 2021-07-06 15:00:24 UTC
Red Hat Product Errata RHSA-2022:7447 0 None None None 2022-11-08 09:13:11 UTC

Internal Links: 1847102

Description Chris Feist 2019-07-16 09:16:40 UTC
When customers use the pcs move command they will occasionally forget to remove the constraints and then later try to move the resource back to the original node, forgetting that the constraint exists.

We need to investigate some ways to notify the user when this is happening.  I'm thinking about these two options (although I'm open to alternatives).

1.  In the pcs status screen show a note/warning for resources that currently have constraints created by pcs move

2.  When running pcs move, notify the user if that resource has existing move constraints on it.

Comment 14 RHEL Program Management 2021-03-18 07:31:24 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.

Comment 22 RHEL Program Management 2021-09-18 07:27:01 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.

Comment 27 Miroslav Lisik 2022-03-28 16:12:15 UTC
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)

Comment 28 Miroslav Lisik 2022-05-26 08:06:43 UTC
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.

Comment 37 svalasti 2022-07-25 07:53:21 UTC
[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.

Comment 38 svalasti 2022-07-25 07:54:11 UTC
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.

Comment 44 Tomas Jelinek 2022-07-26 08:32:08 UTC
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>'.

Comment 45 Nina Hostakova 2022-07-26 14:58:15 UTC
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.

Comment 49 Tomas Jelinek 2022-07-27 14:56:00 UTC
After further discussion, the issue was moved to a separate BZ bz2111583.

Comment 50 Nina Hostakova 2022-07-27 14:59:27 UTC
Marking this bz verified based on comment37.

Comment 52 errata-xmlrpc 2022-11-08 09:12:53 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 (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


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