Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Low: VirtualDomain: allow for custom migrateport

  • Loading branch information...
commit 85333c1102d0f19169e14e406c0444d02b21c657 1 parent df3a739
Dominik Klein authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 heartbeat/VirtualDomain
View
13 heartbeat/VirtualDomain
@@ -21,11 +21,13 @@ OCF_RESKEY_force_stop_default=0
OCF_RESKEY_hypervisor_default="$(virsh --quiet uri)"
OCF_RESKEY_autoset_utilization_cpu_default="true"
OCF_RESKEY_autoset_utilization_hv_memory_default="true"
+OCF_RESKEY_migrateport_default=$(( 49152 + $(ocf_maybe_random) % 64 ))
: ${OCF_RESKEY_force_stop=${OCF_RESKEY_force_stop_default}}
: ${OCF_RESKEY_hypervisor=${OCF_RESKEY_hypervisor_default}}
: ${OCF_RESKEY_autoset_utilization_cpu=${OCF_RESKEY_autoset_utilization_cpu_default}}
: ${OCF_RESKEY_autoset_utilization_hv_memory=${OCF_RESKEY_autoset_utilization_hv_memory_default}}
+: ${OCF_RESKEY_migrateport=${OCF_RESKEY_migrateport_default}}
#######################################################################
## I'd very much suggest to make this RA use bash,
@@ -139,6 +141,14 @@ into the hv_memory utilization of the resource when the monitor is executed.
<content type="boolean" default="true" />
</parameter>
+<parameter name="migrateport" unique="0" required="0">
+<longdesc lang="en">
+This port will be used in the qemu migrateuri. If unset, the port will be a random highport.
+</longdesc>
+<shortdesc lang="en">Port for migrateuri</shortdesc>
+<content type="integer" default="random" />
+</parameter>
+
</parameters>
<actions>
@@ -388,8 +398,7 @@ VirtualDomain_Migrate_To() {
# For quiet ancient libvirt versions a migration port is needed
# and the URI must not contain the "//". Newer versions can handle
# the "bad" URI.
- migrateport=$(( 49152 + $(ocf_maybe_random) % 64 ))
- migrateuri="tcp:${migrate_target}:${migrateport}"
+ migrateuri="tcp:${migrate_target}:${OCF_RESKEY_migrateport}"
;;
xen)
migrateuri="xenmigr://${migrate_target}"
Please sign in to comment.
Something went wrong with that request. Please try again.