Skip to content

Commit

Permalink
rgmanager: vm: add migrate_options parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
oalbrigt committed Nov 30, 2015
1 parent c5824cf commit 16fb53b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions rgmanager/src/resources/vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ meta_data()
<content type="string" default="live"/>
</parameter>
<parameter name="migrate_options">
<longdesc lang="en">
Extra options for the guest live migration.
</longdesc>
<shortdesc lang="en">
Extra options for the guest live migration.
</shortdesc>
<content type="string"/>
</parameter>
<parameter name="tunnelled">
<longdesc lang="en">
Tunnel data over ssh to securely migrate virtual machines.
Expand Down Expand Up @@ -980,16 +990,16 @@ virsh_migrate()
# Xen and qemu have different migration mechanisms
#
if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $OCF_RESKEY_hypervisor_uri $(printf $OCF_RESKEY_migration_uri $target)"
cmd="virsh migrate $migrate_opt $OCF_RESKEY_migrate_options $OCF_RESKEY_name $OCF_RESKEY_hypervisor_uri $(printf $OCF_RESKEY_migration_uri $target)"
ocf_log debug "$cmd"

err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
rv=$?
elif [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
if [ -z "$tunnelled_opt" ]; then
cmd="virsh migrate $tunnelled_opt $migrate_opt $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target) $(printf $migrateuriopt $target)"
cmd="virsh migrate $tunnelled_opt $migrate_opt $OCF_RESKEY_migrate_options $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target) $(printf $migrateuriopt $target)"
else
cmd="virsh migrate $tunnelled_opt $migrate_opt $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target)"
cmd="virsh migrate $tunnelled_opt $migrate_opt $OCF_RESKEY_migrate_options $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target)"
fi
ocf_log debug "$cmd"

Expand Down Expand Up @@ -1031,7 +1041,7 @@ xm_migrate()

# migrate() function sets target using migration_mapping;
# no need to do it here anymore
cmd="xm migrate $migrate_opt $OCF_RESKEY_name $target"
cmd="xm migrate $migrate_opt $OCF_RESKEY_migrate_options $OCF_RESKEY_name $target"
ocf_log debug "$cmd"

err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
Expand Down

3 comments on commit 16fb53b

@digimer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this new 'migrate_options' be used to migrate on systems with 4k drives? Or does this simply move the issue outside of the RA and over to qemu/virsh?

@oalbrigt
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add set migrate_options="--unsafe" to make it work with 4k drives.

@digimer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, OK, thanks.

Please sign in to comment.