[ClusterLabs] Format of '--lifetime' in 'pcs resource move'

Digimer lists at alteeve.ca
Thu Aug 20 06:40:16 EDT 2020

Hi all,

  Reading the pcs man page for the 'move' action, it talks about
'--lifetime' switch that appears to control when the location constraint
is removed;

       move   <resource   id>  [destination  node]  [--master]  [life‐
       time=<lifetime>] [--wait[=n]]
              Move the resource off the node it is  currently  running
              on  by  creating  a -INFINITY location constraint to ban
              the node. If destination node is specified the  resource
              will be moved to that node by creating an INFINITY loca‐
              tion constraint  to  prefer  the  destination  node.  If
              --master  is used the scope of the command is limited to
              the master role and you must use the promotable clone id
              (instead  of  the resource id). If lifetime is specified
              then the constraint will expire after that time,  other‐
              wise  it  defaults to infinity and the constraint can be
              cleared manually with 'pcs resource clear' or 'pcs  con‐
              straint  delete'.  If --wait is specified, pcs will wait
              up to 'n' seconds for the  resource  to  move  and  then
              return  0 on success or 1 on error. If 'n' is not speci‐
              fied it defaults to 60 minutes. If you want the resource
              to preferably avoid running on some nodes but be able to
              failover to them use 'pcs constraint location avoids'.

I think I want to use this, as we move resources manually for various
reasons where the old host is still able to host the resource should a
node failure occur. So we'd love to immediately remove the location
constraint as soon as the move completes.

I tries using '--lifetime=60' as a test, assuming the format was
'seconds', but that was invalid. How is this switch meant to be used?


Papers and Projects: https://alteeve.com/w/
"I am, somehow, less interested in the weight and convolutions of
Einstein’s brain than in the near certainty that people of equal talent
have lived and died in cotton fields and sweatshops." - Stephen Jay Gould

More information about the Users mailing list