resource-agents: master - resource-agents: Fix migration mapping behavior w/ virsh

Lon Hohberger lon at fedoraproject.org
Tue Jul 20 16:01:12 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=15d53e132b4d9261995675245797778f0e211af9
Commit:        15d53e132b4d9261995675245797778f0e211af9
Parent:        629b148b43ec1442a056cf9798b26de4dfe0cdd4
Author:        Masahiro Matsuya <mmatsuya at redhat.com>
AuthorDate:    Fri Jul 9 14:40:51 2010 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Tue Jul 20 11:55:21 2010 -0400

resource-agents: Fix migration mapping behavior w/ virsh

Consider a two node cluster. The hostname of the nodes
are 'sk010001' and 'sk010002'.  Each nodes has two bonded
network interfaces for public and private communications.
The hostname matches the hostname of the IP address on
public network.

Node1: sk010001
 bond0 (for public network) : 172.22.51.1    sk010001
 bond2 (for private network): 172.22.48.131  sk010001-hb

Node2: sk010002
 bond0 (for public network) : 172.22.51.2    sk010002
 bond2 (for private network): 172.22.48.132  sk010002-hb

In cluster.conf, a migration mapping is used to specify
that the private interfaces should be used for migration traffic.
Unfortunately, when doing a live migration, while the traffic
should use the -hb interfaces, bond0 is used.

This is because the vm.sh agent uses the following command
for live migration from sk010001 to sk010002:

  virsh migrate --live su21k003 \
	qemu+ssh://sk010002-hb/system

This is not enough to ensure the guest goes over the private
interface.  The --migrateuri option of 'virsh migrate' is needed
for it.  The following command should be executed instead:

  virsh migrate --live su21k003 \
	qemu+ssh://sk010002-hb/system tcp:sk010002-hb

Resolves: rhbz#596918

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 rgmanager/src/resources/vm.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 66828ef..d2bd0b7 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -810,6 +810,7 @@ validate_all()
 		# Virsh makes it easier to do this.  Really.
 		if [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
 			export OCF_RESKEY_migration_uri="qemu+ssh://%s/system"
+			export migrateuriopt="tcp:%s"
 		fi
 
 		# I just need to believe in it more.
@@ -845,7 +846,7 @@ virsh_migrate()
 		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
 		rv=$?
 	elif [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-		cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target)"
+		cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target) $(printf $migrateuriopt $target)"
 		ocf_log debug "$cmd"
 		
 		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})


More information about the cluster-commits mailing list