[ClusterLabs] Disabled resources after parallel removing of group

Miroslav Lisik mlisik at redhat.com
Fri May 17 10:49:02 EDT 2024


Hi Aleksandr!

It is not safe to use `pcs resource remove` command in parallel because
you run into the same issues as you already described. Processes run by
remove command are not synchronized.

Unfortunately, remove command does not support more than one resource
yet.

If you really need to remove resources at once you can use this method:
1. get the current cib configuration:
pcs cluster cib > original.xml

2. create a new copy of the file:
cp original.xml new.xml

3. disable all to be removed resources using -f option and new
configuration file:
pcs -f new.xml resource disable <resource id>...

4. remove resources using -f option and new configuration file:
pcs -f new.xml resource remove <resource id>
...

5. push new cib configuration to the cluster
pcs cluster cib-push new.xml diff-against=original.xml


On 5/17/24 13:47, Александр Руденко wrote:
> Hi!
> 
> I am new in the pacemaker world, and I, unfortunately, have problems 
> with simple actions like group removal. Please, help me understand when 
> I'm wrong.
> 
> For simplicity I will use standard resources like IPaddr2 (but we have 
> this problem on any type of our custom resources).
> 
> I have 5 groups like this:
> 
> Full List of Resources:
>    * Resource Group: group-1:
>      * ip-11 (ocf::heartbeat:IPaddr2): Started vdc16
>      * ip-12 (ocf::heartbeat:IPaddr2): Started vdc16
>    * Resource Group: group-2:
>      * ip-21 (ocf::heartbeat:IPaddr2): Started vdc17
>      * ip-22 (ocf::heartbeat:IPaddr2): Started vdc17
>    * Resource Group: group-3:
>      * ip-31 (ocf::heartbeat:IPaddr2): Started vdc18
>      * ip-32 (ocf::heartbeat:IPaddr2): Started vdc18
>    * Resource Group: group-4:
>      * ip-41 (ocf::heartbeat:IPaddr2): Started vdc16
>      * ip-42 (ocf::heartbeat:IPaddr2): Started vdc16
> 
> Groups were created by next simple script:
> cat groups.sh
> pcs resource create ip-11 ocf:heartbeat:IPaddr2 ip=10.7.1.11 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-1
> pcs resource create ip-12 ocf:heartbeat:IPaddr2 ip=10.7.1.12 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-1
> 
> pcs resource create ip-21 ocf:heartbeat:IPaddr2 ip=10.7.1.21 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-2
> pcs resource create ip-22 ocf:heartbeat:IPaddr2 ip=10.7.1.22 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-2
> 
> pcs resource create ip-31 ocf:heartbeat:IPaddr2 ip=10.7.1.31 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-3
> pcs resource create ip-32 ocf:heartbeat:IPaddr2 ip=10.7.1.32 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-3
> 
> pcs resource create ip-41 ocf:heartbeat:IPaddr2 ip=10.7.1.41 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-4
> pcs resource create ip-42 ocf:heartbeat:IPaddr2 ip=10.7.1.42 
> cidr_netmask=24 nic=lo op monitor interval=10s --group group-4
> 
> Next, i try to remove all of these group in 'parallel':
> cat remove.sh
> pcs resource remove group-1 &
> sleep 0.2
> pcs resource remove group-2 &
> sleep 0.2
> pcs resource remove group-3 &
> sleep 0.2
> pcs resource remove group-4 &
> 
> After this, every time I have a few resources in some groups which were 
> not removed. It looks like:
> 
> Full List of Resources:
>    * Resource Group: group-2 (disabled):
>      * ip-21 (ocf::heartbeat:IPaddr2): Stopped (disabled)
>    * Resource Group: group-4 (disabled):
>      * ip-41 (ocf::heartbeat:IPaddr2): Stopped (disabled)
> 
> In logs, I can see success stopping all resources, but after stopping 
> some resources it looks like pacemaker just 'forgot' about deletion and 
> didn't.
> 
> Cluster name: pacemaker1
> Cluster Summary:
>    * Stack: corosync
>    * Current DC: vdc16 (version 2.1.0-8.el8-7c3f660707) - partition with 
> quorum
>    * Last updated: Fri May 17 14:30:14 2024
>    * Last change:  Fri May 17 14:30:05 2024 by root via cibadmin on vdc16
>    * 3 nodes configured
>    * 2 resource instances configured (2 DISABLED)
> 
> Node List:
>    * Online: [ vdc16 vdc17 vdc18 ]
> 
> Host OS is CentOS 8.4. Cluster with default settings. vdc16,vdc17,vdc18 
> are VMs with 4 vCPU.
> 
> 
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> 
> ClusterLabs home: https://www.clusterlabs.org/



More information about the Users mailing list