Skip to contentSkip to conversation

cluster/rgmanager/src/resources vm.sh

Cluster-devel [email protected] 1 participant 1 message Nov 14, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-11-14 18:58:26

Modified files:
rgmanager/src/resources: vm.sh

Log message:
Fix #345871 - make default migration policy live instead of paused

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/vm.sh.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.7&r2=1.1.2.8

rgmanager/src/resources/vm.sh +17 -3
@@ -123,7 +123,6 @@
             <content type="string"/>
         </parameter>
 
-
 	<parameter name="rootdisk_physical" unique="1">
 	    <longdesc lang="en">
 		Root disk for the virtual machine.  (physical, on the host)
@@ -175,6 +174,15 @@
             <content type="string"/>
         </parameter>
 
+	<parameter name="migrate">
+	    <longdesc lang="en">
+	    	Migration type live or pause, default = live.
+	    </longdesc>
+	    <shortdesc lang="en">
+	    	Migration type live or pause, default = live.
+	    </shortdesc>
+            <content type="string" default="live"/>
+        </parameter>
 
     </parameters>
 
@@ -258,6 +266,8 @@
 		path)
 			cmdline="$cmdline --path=\"$val\""
 			;;
+		migrate)
+			;;
 		*)
 			cmdline="$cmdline $varp=\"$val\""
 			;;
@@ -377,9 +387,13 @@
 migrate()
 {
 	declare target=$1
-	declare errstr rv
+	declare errstr rv migrate_opt
+
+	if [ "$OCF_RESKEY_migrate" = "live" ]; then
+		migrate_opt="-l"
+	fi
 	
-	err=$(xm migrate $OCF_RESKEY_name $target 2>&1 | head -1)
+	err=$(xm migrate $migrate_opt $OCF_RESKEY_name $target 2>&1 | head -1)
 	rv=$?
 
 	if [ $rv -ne 0 ]; then