[ClusterLabs] crm resource stop VirtualDomain - how to know when/if VirtualDomain is really stopped ?

Kristoffer Grönlund kgronlund at suse.de
Thu Oct 11 10:26:41 EDT 2018


On Thu, 2018-10-11 at 13:59 +0200,  Lentes, Bernd  wrote:
> Hi,
> 
> i'm trying to write a script which shutdown my VirtualDomains in the
> night for a short period to take a clean snapshot with libvirt.
> To shut them down i can use "crm resource stop VirtualDomain".
> 
> But when i do a "crm resource stop VirtualDomain" in my script, the
> command returns immediately. How can i know if my VirtualDomains are
> really stopped, because the shutdown may take up to several minutes.
> 
> I know i could do something with a loop and "crm resource status" and
> grepping for e.g. stopped, but i would prefer a cleaner solution.
> 
> Any ideas ?

You should be able to pass -w to crm,

crm -w resource stop VirtualDomain

That should wait until the policy engine settles down again.

Cheers,
Kristoffer

> 
> Thanks.
> 
> 
> Bernd
> 



More information about the Users mailing list