<div dir="ltr"><div>Bernd, another option would be a mismatch between the message that "virsh destroy" issues and the message that force_stop() in the pacemaker agent expects to receive.  Pacemaker is trying to determine the success or failure of the destroy based on the concatenation of the text of the exit code and the text output by virsh; if either of those have changed between virsh versions, and especially if virsh destroy ever exits with a status other than zero, then you'll get that OCF error.</div><div><br></div><div>Do you know what $VIRSH_OPTIONS ends up as in your Pacemaker config, particularly whether --graceful is specified?</div><div><br></div><div>Cheers,</div><div><br></div><div>- Peter<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 7 Oct 2020 at 18:13, Lentes, Bernd <<a href="mailto:bernd.lentes@helmholtz-muenchen.de">bernd.lentes@helmholtz-muenchen.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Is it possible that "virsh destroy" does not stop a domain ?<br>
I'm asking because i have some domains running in a two-node HA-Cluster (pacemaker).<br>
And sometimes one node get fenced (killed) because it couldn't stop a domain.<br>
That's very ugly.<br>
<br>
This is also the reason why i asked before what "virsh destroy" really does ?<br>
IIRC a kill -9 can't terminate a process which is in "D" state (uninterruptible sleep).<br>
So if the process of the domain is in "D" state, it can't be finished. Right ?<br>
<br>
Pacemaker tries to shutdown or destroy a domain with a resource agent, which is a shell script, similar <br>
to an init script.<br>
<br>
Here is an excerp from the resource agent for virtual domains:<br>
<br>
force_stop()<br>
{<br>
        local out ex translate<br>
        local status=0<br>
<br>
        ocf_log info "Issuing forced shutdown (destroy) request for domain ${DOMAIN_NAME}."<br>
        out=$(LANG=C virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} 2>&1)              # hier wird die domain destroyed<br>
        ex=$?<br>
        translate=$(echo $out|tr 'A-Z' 'a-z')<br>
        echo >&2 "$translate"<br>
        case $ex$translate in<br>
                *"error:"*"domain is not running"*|*"error:"*"domain not found"*|\<br>
                *"error:"*"failed to get domain"*)<br>
                        : ;; # unexpected path to the intended outcome, all is well   sucess<br>
                [!0]*)<br>
                        ocf_exit_reason "forced stop failed"   # <============ fail of destroy seems to be possible<br>
                        return $OCF_ERR_GENERIC ;;     <br>
                0*)<br>
                        while [ $status != $OCF_NOT_RUNNING ]; do<br>
                                VirtualDomain_status<br>
                                status=$?<br>
                        done ;;<br>
        esac<br>
        return $OCF_SUCCESS<br>
}<br>
<br>
The function force_stop is responsible for stop/destroy the domain.<br>
And it cares about a non-working "virsh destroy".<br>
Is there a developer who can explain what "virsh destroy" really does ?<br>
Or is there another ML for the developers ?<br>
<br>
Bernd<br>
<br>
-- <br>
<br>
Bernd Lentes <br>
Systemadministration <br>
Institute for Metabolism and Cell Death (MCD) <br>
Building 25 - office 122 <br>
HelmholtzZentrum München <br>
<a href="mailto:bernd.lentes@helmholtz-muenchen.de" target="_blank">bernd.lentes@helmholtz-muenchen.de</a> <br>
phone: +49 89 3187 1241 <br>
phone: +49 89 3187 3827 <br>
fax: +49 89 3187 2294 <br>
<a href="http://www.helmholtz-muenchen.de/mcd" rel="noreferrer" target="_blank">http://www.helmholtz-muenchen.de/mcd</a> <br>
<br>
stay healthy<br>
Helmholtz Zentrum München<br>
<br>
Helmholtz Zentrum München<br>
<br>
<br>
</blockquote></div>