You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2010/11/24 21:37:33 UTC

svn commit: r1038840 - in /incubator/tashi/trunk/src/tashi: clustermanager/clustermanagerservice.py nodemanager/nodemanagerservice.py rpycservices/rpycservices.py

Author: stroucki
Date: Wed Nov 24 21:37:33 2010
New Revision: 1038840

URL: http://svn.apache.org/viewvc?rev=1038840&view=rev
Log:
Implement Miha Stopar's changes to set the state of the VM on the source
machine of a migration to MigratePrep.

Modified:
    incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
    incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
    incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py

Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py?rev=1038840&r1=1038839&r2=1038840&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Wed Nov 24 21:37:33 2010
@@ -253,6 +253,9 @@ class ClusterManagerService(object):
 		self.data.releaseInstance(instance)
 		try:
 			# Prepare the target
+			self.log.info("migrateVm: Calling prepSourceVm on source host %s" % sourceHost.name)
+			self.proxy[sourceHost.name].prepSourceVm(instance)
+			self.log.info("migrateVm: Calling prepReceiveVm on target host %s" % targetHost.name)
 			cookie = self.proxy[targetHost.name].prepReceiveVm(instance, sourceHost)
 		except Exception, e:
 			self.log.exception('prepReceiveVm failed')

Modified: incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py?rev=1038840&r1=1038839&r2=1038840&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py Wed Nov 24 21:37:33 2010
@@ -198,10 +198,12 @@ class NodeManagerService(object):
 		return instance.vmId
 	
 	def prepReceiveVm(self, instance, source):
-		instance.state = InstanceState.MigratePrep
 		instance.vmId = -1
 		transportCookie = self.vmm.prepReceiveVm(instance, source.name)
 		return transportCookie
+
+	def prepSourceVm(self, instance):
+		instance.state = InstanceState.MigratePrep
 	
 	def migrateVmHelper(self, instance, target, transportCookie):
 		self.vmm.migrateVm(instance.vmId, target.name, transportCookie)

Modified: incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py?rev=1038840&r1=1038839&r2=1038840&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py (original)
+++ incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py Wed Nov 24 21:37:33 2010
@@ -3,7 +3,7 @@ from tashi.rpycservices.rpyctypes import
 import cPickle
 
 clusterManagerRPCs = ['createVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'migrateVm', 'pauseVm', 'unpauseVm', 'getHosts', 'getNetworks', 'getUsers', 'getInstances', 'vmmSpecificCall', 'registerNodeManager', 'vmUpdate', 'activateVm']
-nodeManagerRPCs = ['instantiateVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'prepReceiveVm', 'migrateVm', 'receiveVm', 'pauseVm', 'unpauseVm', 'getVmInfo', 'listVms', 'vmmSpecificCall', 'getHostInfo']
+nodeManagerRPCs = ['instantiateVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'prepReceiveVm', 'prepSourceVm', 'migrateVm', 'receiveVm', 'pauseVm', 'unpauseVm', 'getVmInfo', 'listVms', 'vmmSpecificCall', 'getHostInfo']
 
 def clean(args):
 	"""Cleans the object so cPickle can be used."""