[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] resource-agnets: Add support for using tunnelled migrations with qemu



Add support for using tunnelled migrations with qemu

Resolves: rhbz#712174


Allow using the --tunnelled option when migrating with virsh
>From 2a64185aaea47c1cc0820580b4f4c6520b8b3a38 Mon Sep 17 00:00:00 2001
From: Chris Feist <cfeist redhat com>
Date: Mon, 5 Mar 2012 16:03:15 -0600
Subject: [PATCH 7/7] Add support for using tunnelled migrations with qemu

Resolves: rhbz#712174
---
 rgmanager/src/resources/vm.sh |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index d2303fe..253cf35 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -155,6 +155,16 @@ meta_data()
             <content type="string" default="live"/>
         </parameter>
 
+	<parameter name="tunnelled">
+	    <longdesc lang="en">
+	    	Tunnel data over ssh to securely migrate virtual machines.
+	    </longdesc>
+	    <shortdesc lang="en">
+	    	Tunnel data over ssh to securely migrate virtual machines.
+	    </shortdesc>
+            <content type="string" default=""/>
+        </parameter>
+
 	<parameter name="path">
 	    <longdesc lang="en">
 		Path specification vm.sh will search for the specified
@@ -868,7 +878,11 @@ 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) $(printf $migrateuriopt $target)"
+		if [ -z "$tunnelled_opt" ]; then
+			cmd="virsh migrate $tunnelled_opt $migrate_opt $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)"
+		fi
 		ocf_log debug "$cmd"
 		
 		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
@@ -939,11 +953,16 @@ migrate()
 {
 	declare target=$1
 	declare rv migrate_opt
+	declare tunnelled_opt
 
 	if [ "$OCF_RESKEY_migrate" = "live" ]; then
 		migrate_opt="--live"
 	fi
 
+	if [ "$OCF_RESKEY_tunnelled" = "on" ]; then
+		tunnelled_opt="--tunnelled --p2p"
+	fi
+
 	# Patch from Marcelo Azevedo to migrate over private
 	# LANs instead of public LANs
         if [ -n "$OCF_RESKEY_migration_mapping" ] ; then
-- 
1.7.7.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]