First testing with role="Promoted" location constraint:
# # No constraints initially # crm_simulate -Ls [ fastvm-rhel-9-0-42 fastvm-rhel-9-0-43 ] Promoted: [ fastvm-rhel-9-0-42 ] Unpromoted: [ fastvm-rhel-9-0-43 ] pcmk__clone_assign: stateful-clone allocation score on fastvm-rhel-9-0-42: 0 pcmk__clone_assign: stateful-clone allocation score on fastvm-rhel-9-0-43: 0 pcmk__clone_assign: stateful:0 allocation score on fastvm-rhel-9-0-42: 11 pcmk__clone_assign: stateful:0 allocation score on fastvm-rhel-9-0-43: 0 pcmk__clone_assign: stateful:1 allocation score on fastvm-rhel-9-0-42: 0 pcmk__clone_assign: stateful:1 allocation score on fastvm-rhel-9-0-43: 6 pcmk__primitive_assign: stateful:0 allocation score on fastvm-rhel-9-0-42: 11 pcmk__primitive_assign: stateful:0 allocation score on fastvm-rhel-9-0-43: 0 pcmk__primitive_assign: stateful:1 allocation score on fastvm-rhel-9-0-42: -INFINITY pcmk__primitive_assign: stateful:1 allocation score on fastvm-rhel-9-0-43: 6 stateful:0 promotion score on fastvm-rhel-9-0-42: INFINITY stateful:1 promotion score on fastvm-rhel-9-0-43: -INFINITY # crm_resource --resource stateful-clone --move --promoted --node fastvm-rhel-9-0-43 # # Scores don't change # crm_simulate -Ls [ fastvm-rhel-9-0-42 fastvm-rhel-9-0-43 ] Promoted: [ fastvm-rhel-9-0-42 ] Unpromoted: [ fastvm-rhel-9-0-43 ] pcmk__clone_assign: stateful-clone allocation score on fastvm-rhel-9-0-42: 0 pcmk__clone_assign: stateful-clone allocation score on fastvm-rhel-9-0-43: 0 pcmk__clone_assign: stateful:0 allocation score on fastvm-rhel-9-0-42: 11 pcmk__clone_assign: stateful:0 allocation score on fastvm-rhel-9-0-43: 0 pcmk__clone_assign: stateful:1 allocation score on fastvm-rhel-9-0-42: 0 pcmk__clone_assign: stateful:1 allocation score on fastvm-rhel-9-0-43: 6 pcmk__primitive_assign: stateful:0 allocation score on fastvm-rhel-9-0-42: 11 pcmk__primitive_assign: stateful:0 allocation score on fastvm-rhel-9-0-43: 0 pcmk__primitive_assign: stateful:1 allocation score on fastvm-rhel-9-0-42: -INFINITY pcmk__primitive_assign: stateful:1 allocation score on fastvm-rhel-9-0-43: 6 stateful:0 promotion score on fastvm-rhel-9-0-42: INFINITY stateful:1 promotion score on fastvm-rhel-9-0-43: -INFINITY [root@fastvm-rhel-9-0-42 pacemaker]# pcs constraint Location Constraints: Resource: stateful-clone Enabled on: Node: fastvm-rhel-9-0-43 (score:INFINITY) (role:Promoted) # # constraints section of CIB <constraints> <rsc_location id="cli-prefer-stateful-clone" rsc="stateful-clone" role="Promoted" node="fastvm-rhel-9-0-43" score="INFINITY"/> </constraints>
Now testing with role="Started" location constraint, still no meaningful effect:
<constraints> <rsc_location id="cli-prefer-stateful-clone" rsc="stateful-clone" role="Started" node="fastvm-rhel-9-0-43" score="INFINITY"/> </constraints> # crm_simulate -LSs [ fastvm-rhel-9-0-42 fastvm-rhel-9-0-43 ] Promoted: [ fastvm-rhel-9-0-42 ] Unpromoted: [ fastvm-rhel-9-0-43 ] pcmk__clone_assign: stateful-clone allocation score on fastvm-rhel-9-0-42: 0 pcmk__clone_assign: stateful-clone allocation score on fastvm-rhel-9-0-43: INFINITY pcmk__clone_assign: stateful:0 allocation score on fastvm-rhel-9-0-42: 11 pcmk__clone_assign: stateful:0 allocation score on fastvm-rhel-9-0-43: INFINITY pcmk__clone_assign: stateful:1 allocation score on fastvm-rhel-9-0-42: 0 pcmk__clone_assign: stateful:1 allocation score on fastvm-rhel-9-0-43: INFINITY pcmk__primitive_assign: stateful:0 allocation score on fastvm-rhel-9-0-42: 11 pcmk__primitive_assign: stateful:0 allocation score on fastvm-rhel-9-0-43: INFINITY pcmk__primitive_assign: stateful:1 allocation score on fastvm-rhel-9-0-42: -INFINITY pcmk__primitive_assign: stateful:1 allocation score on fastvm-rhel-9-0-43: INFINITY stateful:0 promotion score on fastvm-rhel-9-0-42: INFINITY stateful:1 promotion score on fastvm-rhel-9-0-43: -INFINITY [ fastvm-rhel-9-0-42 fastvm-rhel-9-0-43 ] Promoted: [ fastvm-rhel-9-0-42 ] Unpromoted: [ fastvm-rhel-9-0-43 ]