[ClusterLabs] Antw: [EXT] Re: Format of '--lifetime' in 'pcs resource move'

Tomas Jelinek tojeline at redhat.com
Tue Aug 25 04:50:14 EDT 2020


Hi all,

The lifetime value is indeed expected to be ISO 8601 duration. I updated 
pcs documentation to clarify that:
https://github.com/ClusterLabs/pcs/commit/1e9650a8fd5b8a0a22911ddca1010de582684971

Please note constraints are not removed from CIB when their lifetime 
expires. They are rendered ineffective but still preserved in CIB. See 
the following bugzilla for more details:
https://bugzilla.redhat.com/show_bug.cgi?id=1442116

Regards,
Tomas


Dne 21. 08. 20 v 7:56 Ulrich Windl napsal(a):
>>>> Strahil Nikolov <hunter86_bg at yahoo.com> schrieb am 20.08.2020 um 18:25 in
> Nachricht <329B5D02-2BCB-4A2C-BC2B-CA3030E6A3B7 at yahoo.com>:
>> Have you tried ISO 8601 format.
>> For example: 'PT20M'
> 
> And watch out not to mix Minutes wth Months ;-)
> 
>>
>> The  ISo format  is described at:
>> https://manpages.debian.org/testing/crmsh/crm.8.en.html
>>
>> Best Regards,
>> Strahil Nikolov
>>
>> На 20 август 2020 г. 13:40:16 GMT+03:00, Digimer <lists at alteeve.ca> написа:
>>> 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?
>>>
>>> Cheers
>>>
>>> -- 
>>> Digimer
>>> 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
>>> _______________________________________________
>>> Manage your subscription:
>>> https://lists.clusterlabs.org/mailman/listinfo/users
>>>
>>> ClusterLabs home: https://www.clusterlabs.org/
>> _______________________________________________
>> Manage your subscription:
>> https://lists.clusterlabs.org/mailman/listinfo/users
>>
>> ClusterLabs home: https://www.clusterlabs.org/
> 
> 
> 
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> 
> ClusterLabs home: https://www.clusterlabs.org/
> 



More information about the Users mailing list