This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 1420298 - "pcs resource delete" overhaul
Summary: "pcs resource delete" overhaul
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 1619824 (view as bug list)
Depends On:
Blocks: 1420101 1426608 1553782 1849994 2062390
TreeView+ depends on / blocked
 
Reported: 2017-02-08 11:51 UTC by Tomas Jelinek
Modified: 2024-10-09 09:45 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-10-09 09:44:43 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1359057 0 medium CLOSED [cli] pcs should provide enhanced, stackable, integrity-protecting "pcs cluster cib/cib-push" alternative 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1420101 0 unspecified CLOSED generalize argument handling with commands like "resource delete": single operand -> multiple operands (-> pattern) 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1873691 1 None None None 2023-04-19 10:53:03 UTC
Red Hat Bugzilla 2062390 1 unspecified CLOSED When deleting a promotable resource, delete its promotable score node attributes 2023-09-09 07:30:35 UTC
Red Hat Issue Tracker   RHEL-61889 0 None None None 2024-10-09 09:44:42 UTC

Internal Links: 1359057 1420101

Description Tomas Jelinek 2017-02-08 11:51:51 UTC
1) When deleting a resource group, pcs lists all resources in the group and deletes them one by one. For each resource the CIB is loaded, the resource is deleted, and the CIB is pushed. If anything goes wrong in the process, we may end up with part the resources deleted and the other part still present in the cluster.

2) It is not possible to delete more than one resource in one go. So if the user wants to delete five resources, he/she needs to run "pcs resource delete" five times. Pcs will five times load the CIB, stop the resource, push the CIB, wait for pacemaker to stop the resource, load the CIB, delete the resource and push the CIB. That will unnecessary take a lot of time.

We want to make the code modular and reusable, allow multiple resources to be deleted with one command, fix the command line arguments parsing, improve error reporting.

Comment 1 Tomas Jelinek 2017-02-08 12:05:41 UTC
Making "pcs resource remove" an alias to "pcs resource delete" would be nice as well.

Comment 2 Jaroslav Kortus 2017-02-08 13:29:25 UTC
what about hijacking this bug and create something like transaction-aware logic in pcs? Deleting the resource is only one of the examples when this comes handy.

Currently to achieve that we have to dump the cib, do pcs -f cib.xml <something> and push it back.

It would be cool to have something like crm had and be able to do things like:

# pcs
pcs> pcs resource delete ...
pcs> pcs resource create ...
pcs> pcs constraint ..
pcs> commit

Ideas? :)

Comment 3 Jan Pokorný [poki] 2017-02-08 14:09:06 UTC
re [comment 2]:

This is pretty overboard: please realize you are proposing an internal
statefull shell, big feature on its own.  There's hardly any other way
to have it considered than through a dedicated bug or upstream issue.
Note that there's more humble suggestion already to compose compound
"atomic" change natively on command-line through piping: [bug 1359057].

[If the pipe approach was to cover non-mere-CIB-manipulating actions
as well (which "pcs resource delete" is), it would have to embed
a pcs-internal stream of actions to be performed before/after pushing
the CIB into the CIB itself (status section could serve that purpose
temporarily, stripping it for the resulting push of the CIB).  Still
might be doable.]

Comment 4 Jaroslav Kortus 2017-02-08 14:27:43 UTC
I was thinking only about CIB related actions. Anything else seems to be just too complex for "atomic" operation. More of a shortcut for pcs cib dump && modify && pcs cib push.

Comment 5 Tomas Jelinek 2017-02-10 07:46:58 UTC
I discussed this with Jaroslav personally. His proposal is out of the scope of this bz.

Comment 6 Tomas Jelinek 2017-02-10 07:49:08 UTC
We should consider printing a warning when working with CIB file that pcs cannot:
* stop resources before deleting them
* properly remove remote nodes (when deleting VirtualDomain and ocf:pacemaker:remote resources) from the cluster

Comment 7 Tomas Jelinek 2017-05-15 09:52:54 UTC
(In reply to Tomas Jelinek from comment #6)
> We should consider printing a warning when working with CIB file that pcs
> cannot:
> * stop resources before deleting them
> * properly remove remote nodes (when deleting VirtualDomain and
> ocf:pacemaker:remote resources) from the cluster

This is covered by bz1426608.

Comment 8 Tomas Jelinek 2017-05-15 09:53:54 UTC
Once pcs part is done, we need to update pcsd so it does not use -f when deleting resources.

Comment 9 Tomas Jelinek 2017-05-17 08:04:17 UTC
Also we should deal with deleting remove and guest nodes. Currently the resource delete command removes the node from pacemaker by using crm_node --remove, but does not delete config files and stop and disable pacemaker remote on the deleted node. It would be probably better to either do none of that or all of that.

Comment 16 Tomas Jelinek 2018-08-22 08:06:53 UTC
*** Bug 1619824 has been marked as a duplicate of this bug. ***

Comment 17 Tomas Jelinek 2019-06-12 14:49:21 UTC
Also wanted: do a resource cleanup when a resource is being removed, to prevent leaving junk behind

Comment 18 Tomas Jelinek 2019-06-12 15:08:33 UTC
(In reply to Tomas Jelinek from comment #17)
> Also wanted: do a resource cleanup when a resource is being removed, to
> prevent leaving junk behind

reported upstream: https://github.com/ClusterLabs/pcs/issues/194

Comment 20 Tomas Jelinek 2020-09-01 07:24:26 UTC
(In reply to Tomas Jelinek from comment #17)
> Also wanted: do a resource cleanup when a resource is being removed, to
> prevent leaving junk behind

We actually may want to do resource refresh: bz1508350, bz1873691 comment 6

Comment 23 RHEL Program Management 2020-12-01 07:28:13 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 25 RHEL Program Management 2024-10-09 09:09:24 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.


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