[ClusterLabs] Strange behavior every time I set VirtualDomain attribute
Ken Gaillot
kgaillot at redhat.com
Tue Aug 4 09:50:44 EDT 2015
On 08/03/2015 08:32 PM, Digimer wrote:
> On 03/08/15 09:29 PM, Andrew Beekhof wrote:
>>
>>> On 26 Jun 2015, at 8:03 pm, Milos Buncic <htchak19 at gmail.com> wrote:
>>>
>>> Ok solution is
>>>
>>> pcs resource unmanage testvm1
>>
>> Right, because when you change the resource definition pacemaker restarts the service so the new values take effect
>
> Is there a way to disable this behavior globally? I sometimes change XML
> definition files with intentions to reboot/apply the changes later.
> Would be something of an "oh crap" if it triggered a reboot of the guest.
The first time I discovered this as an admin was a bit of a shock :)
At that shop, we kept all our important services' configurations in
version control, so our approach to this issue was to make the changes
in the repository, and pull it on the host when we were ready to apply.
>>> pcs resource update testvm1 migration_transport=ssh
>>> pcs resource cleanup testvm1
>>> pcs resource manage testvm1
>>>
>>> Cheers
>>>
>>> On Thu, Jun 25, 2015 at 11:03 PM, Milos Buncic <htchak19 at gmail.com> wrote:
>>> 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
>>> }
>>>
More information about the Users
mailing list