HomeClusterLabs Projects

Low: tools: Fix restarting clone instances in crm_resource.

Description

Low: tools: Fix restarting clone instances in crm_resource.

If a command line like "crm_resource --restart --resource stateful
--node cluster02" is given, the call to pe_find_resource_with_flags may
not find the correct resource instance. It may find one that is running
on some other node. Thus, cli_resource_restart can't just blindly go
with the resource it was given.

Instead, if the given resource is not running on the given node, check
to see if it has a parent and if so, check to see if that parent has a
child running on the given node. If so, use that.

Note that this causes problems for restarting the cloned primitive with
a command line like "crm_resource --restart --resource stateful:1 --node
cluster01", but that can be fixed in a later commit.

See: rhbz#1930578

Details

Provenance
clumensAuthored on Mar 18 2022, 11:17 AM
Parents
rPea59a5474c8b: Refactor: tools: Pass the node to cli_resource_restart.
Branches
Unknown
Tags
Unknown