Re: crmsh fails to stop already stopped resource

Vladislav Bogdanov <[email protected]> Mon, 16 Feb 2015 15:14:05 +0300
Newsgroups gmane.linux.highavailability.user
Message-ID <[email protected]>
Hi Dejan,

16.02.2015 13:47, Dejan Muhamedagic wrote:
> Hi,
>
> On Mon, Feb 16, 2015 at 11:20:16AM +0300, Vladislav Bogdanov wrote:
>> 16.02.2015 11:15, Kristoffer Gr=F6nlund wrote:
>>> Vladislav Bogdanov <[email protected]> writes:
>>>
>>>> Hi Kristoffer,
>>>>
>>>> may be it is worth to silently (or at least with rc=3D0) allow deletio=
n of
>>>> non-existing or already-deleted configuration statements?
>>>>
>>>> Background for that is that I keep track of the all configuration
>>>> statements myself, and, when I delete some resources (together with
>>>> accompanying constraints), they may go "out-of-order" to 'crm configure
>>>> delete', thus some constraints are automatically deleted when deleting
>>>> "lower" resource before the "upper" one. That leads to the whole crm
>>>> script to fail.
>
> crmsh tries hard to preserve the CIB sanity on removing elements.
> It would be best that you just put all the elements you want to
> delete on one line.

That's a really good idea, I'll look into this.

>
>>> Hmm, I am not sure about doing this by default, since we would want to
>>> show some kind of indication that a resource name may have been
>>> misspelled for example... But I can imagine having a command line flag
>>> for being more flexible in this regard.
>>
>> Reuse '-F'?
>>
>>>
>>> I will look at how it works now.
>>>
>>> BTW, I suspect that passing the --wait flag to crm while running
>>> commands in this way may help you.
>
> The --wait option effectively waits for the PE to settle. It is
> normally useful only in resource/node levels and on configure
> commit.
>
>>> Although I am not sure I entirely
>>> understand what it is you are doing :)
>>
>> Look:
>> crm configure
>> primitive a ...
>> primitive b ...
>> colocation b-with-a inf: b a
>> commit
>> exit
>>
>> crm configure
>> delete a
>> delete b-with-a <=3D fails because is already deleted automatically
>
> You can also omit removing constraints as they are going to be
> removed with the resources they reference.

Unless the same function is used to remove just constraints too (like in =

my case - I compare old and new definition of an object with constraints =

and remove stale ones).

Anyways, thanks for pointer to multi-object deletes!

Best,
Vladislav

>
> Cheers,
>
> Dejan
>
>> delete b
>> commit
>>
>> Best,
>> Vladislav
>>
>>>
>>> Cheers,
>>> Kristoffer
>>>
>>>>
>>>> Best,
>>>> Vladislav
>>>>
>>>> 13.02.2015 17:03, Vladislav Bogdanov wrote:
>>>>> Hi,
>>>>>
>>>>> Following fails with the current crmsh (e4b10ee).
>>>>> # crm resource stop cl-http-lv
>>>>> # crm resource stop cl-http-lv
>>>>> ERROR: crm_diff apparently failed to produce the diff (rc=3D0)
>>>>> ERROR: Failed to commit updates to cl-http-lv
>>>>> # echo $?
>>>>> 1
>>>>>
>>>>>
>>>>> Best,
>>>>> Vladislav
>>>>> _______________________________________________
>>>>> Linux-HA mailing list
>>>>> [email protected]
>>>>> http://lists.linux-ha.org/mailman/listinfo/linux-ha
>>>>> See also: http://linux-ha.org/ReportingProblems
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> Linux-HA mailing list
>> [email protected]
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha
>> See also: http://linux-ha.org/ReportingProblems
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems