[ClusterLabs] Strange behavior every time I set VirtualDomain attribute

Milos Buncic htchak19 at gmail.com
Thu Jun 25 17:03:56 EDT 2015


Hi there,

Every time I run (CentOS 6.6)

pcs resource update testvm1 migration_transport=ssh
or
pcs resource update testvm1 migration_transport=

or when I try to set any VirtualDomain parameter, graceful shutdown is
initiated!

Jun 25 21:59:56 node1 VirtualDomain(testvm1)[10876]: INFO: Issuing graceful
shutdown request for domain testvm1.

Can someone please explain me why this is happening?

I'm using VirtualDomain resource agent downloaded from github
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/VirtualDomain


VirtualDomain_Stop() {
        local i
        local status
        local shutdown_timeout
        local needshutdown=1

        VirtualDomain_Status
        status=$?

        case $status in
                $OCF_SUCCESS)
                        if ocf_is_true $OCF_RESKEY_force_stop; then
                                # if force stop, don't bother attempting
graceful shutdown.
                                force_stop
                                return $?
                        fi

                        ocf_log info "Issuing graceful shutdown request for
domain ${DOMAIN_NAME}."

                        if [ -n "$OCF_RESKEY_snapshot" ]; then
                                virsh save $DOMAIN_NAME
"$OCF_RESKEY_snapshot/${DOMAIN_NAME}.state"
                                if [ $? -eq 0 ]; then
                                        needshutdown=0
                                else
                                        ocf_log error "Failed to save
snapshot state of ${DOMAIN_NAME} on stop"
                                fi
                        fi

                        # save config if needed
                        if ocf_is_true "$OCF_RESKEY_save_config_on_stop";
then
                                save_config
                        fi

                        # issue the shutdown if save state didn't shutdown
for us
                        if [ $needshutdown -eq 1 ]; then
                                # Issue a graceful shutdown request
                                *virsh $VIRSH_OPTIONS shutdown
${DOMAIN_NAME}*
                        fi

                        # The "shutdown_timeout" we use here is the
operation
                        # timeout specified in the CIB, minus 5 seconds
                        shutdown_timeout=$(( $NOW +
($OCF_RESKEY_CRM_meta_timeout/1000) -5 ))
                        # Loop on status until we reach $shutdown_timeout
                        while [ $NOW -lt $shutdown_timeout ]; do
                                VirtualDomain_Status
                                status=$?
                                case $status in
                                        $OCF_NOT_RUNNING)
                                                # This was a graceful
shutdown.
                                                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
                                NOW=$(date +%s)
                        done
                        ;;
                $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,
        # have the LRM time us out.
        force_stop
}


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clusterlabs.org/pipermail/users/attachments/20150625/02058cde/attachment-0002.html>


More information about the Users mailing list