Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low: Virtualdomain: allow for custom migrateport #204

Merged
merged 2 commits into from Feb 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions heartbeat/VirtualDomain
Expand Up @@ -21,11 +21,13 @@ OCF_RESKEY_force_stop_default=0
OCF_RESKEY_hypervisor_default="$(virsh --quiet uri)" OCF_RESKEY_hypervisor_default="$(virsh --quiet uri)"
OCF_RESKEY_autoset_utilization_cpu_default="true" OCF_RESKEY_autoset_utilization_cpu_default="true"
OCF_RESKEY_autoset_utilization_hv_memory_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_force_stop=${OCF_RESKEY_force_stop_default}}
: ${OCF_RESKEY_hypervisor=${OCF_RESKEY_hypervisor_default}} : ${OCF_RESKEY_hypervisor=${OCF_RESKEY_hypervisor_default}}
: ${OCF_RESKEY_autoset_utilization_cpu=${OCF_RESKEY_autoset_utilization_cpu_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_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, ## I'd very much suggest to make this RA use bash,
Expand Down Expand Up @@ -139,6 +141,14 @@ into the hv_memory utilization of the resource when the monitor is executed.
<content type="boolean" default="true" /> <content type="boolean" default="true" />
</parameter> </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> </parameters>


<actions> <actions>
Expand Down Expand Up @@ -388,8 +398,7 @@ VirtualDomain_Migrate_To() {
# For quiet ancient libvirt versions a migration port is needed # For quiet ancient libvirt versions a migration port is needed
# and the URI must not contain the "//". Newer versions can handle # and the URI must not contain the "//". Newer versions can handle
# the "bad" URI. # the "bad" URI.
migrateport=$(( 49152 + $(ocf_maybe_random) % 64 )) migrateuri="tcp:${migrate_target}:${OCF_RESKEY_migrateport}"
migrateuri="tcp:${migrate_target}:${migrateport}"
;; ;;
xen) xen)
migrateuri="xenmigr://${migrate_target}" migrateuri="xenmigr://${migrate_target}"
Expand Down