Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Low: Virtualdomain: allow for custom migrateport #204

Merged
merged 2 commits into from

3 participants

@kleind

When testing with qemu on a glusterfs backend, I encountered problems with a lot of high ports being in used by glusterfs. I could work around this by specifying a custom instead of a random port in the virsh migrate "migrateuri". This patch allows for that in the VirtualDomain agent.

heartbeat/VirtualDomain
@@ -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" />
@fghaas Owner
fghaas added a note

In the interest of not confusing people and not making them believe that this variable will be initialized to the string random when unset, could you just remove this default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@fghaas
Owner

Looks good to me except for the minor defaults issue I mentioned in the line note. Any other opinions?

@kleind

you mean like 'default=""'? imho, that'd be even more confusing.

@fghaas
Owner
@kleind

Oh, didn't know that was acceptable. What's the workflow now? edit, commit, push and then create another pull request? Haven't used this much. Thanks!

@kleind

Ah, that was self-explaining :)

@fghaas
Owner

Looks fine to me now. I'll give it another day for others to comment, but I'm happy to merge this unless there are any objections.

@dmuhamedagic
Owner

Looks OK to me too.

@fghaas fghaas merged commit e77a222 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 6, 2013
  1. Low: VirtualDomain: allow for custom migrateport

    Dominik Klein authored
  2. Low: VirtualDomain: Fix misleading metadata default

    Dominik Klein authored
This page is out of date. Refresh to see the latest.
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" />
+</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}"
Something went wrong with that request. Please try again.