Hi,
We test VirtualDomain on Xen.(at RHEL5.5)
But, a problem is taking place when stop processing is carried out somehow or
other.
VirtualDomain_Status carried out by stop processing returns "no state" at
considerably high frequency.
For this problem, it is worked to destroy the guest(VM).
When VirtualDomain_Status gives back a right state, there is not the problem.
However, this problem happens in Xen environment, but does not occur in the KVM
environment.
We hope for the following improvement in the case of the Xen environment.
And we wish a guest(VM) is stopped definitely.
* When "no state" was provided by VirtualDomain_Status, carry it out again.
* And, based on a stable state, carry out processing
--------------------------
VirtualDomain_Stop() {
local i
local status
local shutdown_timeout
VirtualDomain_Status
status=$?
case $status in
$OCF_SUCCESS)
if ! ocf_is_true $OCF_RESKEY_force_stop; then
# Issue a graceful shutdown request
ocf_log info "Issuing graceful shutdown request for domain
${DOMAIN_NAME}."
virsh $VIRSH_OPTIONS shutdown ${DOMAIN_NAME}
# The "shutdown_timeout" we use here is the operation
# timeout specified in the CIB, minus 5 seconds
shutdown_timeout=$((($OCF_RESKEY_CRM_meta_timeout/1000)-5))
# Loop on status for $shutdown_timeout seconds
for i in `seq $shutdown_timeout`; do
VirtualDomain_Status
status=$?
case $status in
$OCF_NOT_RUNNING)
# This was a graceful shutdown. Clean
# up and return.
VirtualDomain_Cleanup_Statefile
return $OCF_SUCCESS
;;
$OCF_SUCCESS)
# Domain is still running, keep
# waiting (until shutdown_timeout
# expires)
sleep 1
;;
*)
# Something went wrong. Bail out and
# resort to forced stop (destroy).
break;
esac
done
fi
;;
$OCF_NOT_RUNNING)
ocf_log info "Domain $DOMAIN_NAME already stopped."
return $OCF_SUCCESS
esac
# OK. Now if the above graceful shutdown hasn't worked, kill
# off the domain with destroy. If that too does not work, give
# up and have the LRM time us out.
ocf_log info "Issuing forced shutdown (destroy) request for domain
${DOMAIN_NAME}."
virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} || return $OCF_ERR_GENERIC
VirtualDomain_Cleanup_Statefile
return $OCF_SUCCESS
}
--------------------------
Best Regards,
Hideo Yamauchi.
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/