~ubuntu-branches/debian/sid/resource-agents/sid

« back to all changes in this revision

Viewing changes to heartbeat/Xen

  • Committer: Package Import Robot
  • Author(s): Martin Loschwitz
  • Date: 2012-10-09 11:16:59 UTC
  • mfrom: (3.1.1)
  • Revision ID: package-import@ubuntu.com-20121009111659-jrcwfqskcbh0iuio
Tags: 1:3.9.3+git20121009-1
* New upstream version
* debian/patches/01_docbook_patch.patch: Refactored for new release
* debian/patches/02_spelling_fixes.patch.new: Refatored for new release
* debian/control: Bumped Standards-Version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
 
43
43
: ${OCF_RESKEY_xmfile=/etc/xen/vm/MyDomU}
 
44
: ${OCF_RESKEY_shutdown_acpi=0}
44
45
: ${OCF_RESKEY_allow_mem_management=0}
45
46
: ${OCF_RESKEY_reserved_Dom0_memory=512}
46
47
 
107
108
<shortdesc lang="en">Shutdown escalation timeout</shortdesc>
108
109
<content type="string" default="" />
109
110
</parameter>
 
111
<parameter name="shutdown_acpi" unique="0" required="0">
 
112
<longdesc lang="en">
 
113
Handle shutdown by simulating an ACPI power button event.
 
114
Enable this to allow graceful shutdown for HVM domains
 
115
without installed PV drivers.
 
116
</longdesc>
 
117
<shortdesc lang="en">Simulate power button event on shutdown</shortdesc>
 
118
<content type="boolean" default="0" />
 
119
</parameter>
110
120
<parameter name="allow_mem_management" unique="0" required="0">
111
121
<longdesc lang="en">
112
122
This parameter enables dynamic adjustment of memory for start 
303
313
 
304
314
    if [ "$timeout" -gt 0 ]; then
305
315
      ocf_log info "Xen domain $dom will be stopped (timeout: ${timeout}s)"
306
 
      xm shutdown $dom
 
316
      if ocf_is_true "${OCF_RESKEY_shutdown_acpi}"; then
 
317
        xm trigger $dom power
 
318
      else
 
319
        xm shutdown $dom
 
320
      fi
307
321
          
308
322
      while Xen_Status $dom && [ "$timeout" -gt 0 ]; do
309
323
        ocf_log debug "$dom still not stopped. Waiting..."
352
366
 
353
367
Xen_Migrate_To() {
354
368
  target_node="$OCF_RESKEY_CRM_meta_migrate_target"
355
 
  target_attr="$OCF_RESKEY_CRM_node_ip_attribute"
 
369
  target_attr="$OCF_RESKEY_node_ip_attribute"
356
370
  target_addr="$target_node"
357
371
 
358
372
  if Xen_Status ${DOMAIN_NAME}; then
384
398
}
385
399
 
386
400
Xen_Migrate_From() {
 
401
  if [ -n "$OCF_RESKEY_CRM_meta_timeout" ]; then
 
402
      # Allow 2/3 of the action timeout for status to stabilize
 
403
      # (The origin unit is ms, hence the conversion)
 
404
      timeout=$((OCF_RESKEY_CRM_meta_timeout/1500))
 
405
  else
 
406
      timeout=10                # should be plenty
 
407
  fi
 
408
 
 
409
  while ! Xen_Status ${DOMAIN_NAME} && [ $timeout -gt 0 ]; do
 
410
    ocf_log debug "$DOMAIN_NAME: Not yet active locally, waiting (timeout: ${timeout}s)"
 
411
    timeout=$((timeout-1))
 
412
    sleep 1
 
413
  done
 
414
 
387
415
  if Xen_Status ${DOMAIN_NAME}; then
388
416
    Xen_Adjust_Memory 0
389
417
    ocf_log info "$DOMAIN_NAME: Active locally, migration successful"