incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1370639 - in /incubator/tashi/trunk/src/tashi/nodemanager: nodemanagerservice.py vmcontrol/qemu.py
Date Wed, 08 Aug 2012 02:34:01 GMT
Author: stroucki
Date: Wed Aug  8 02:34:00 2012
New Revision: 1370639

URL: http://svn.apache.org/viewvc?rev=1370639&view=rev
Log:
nodemanagerservice: make note on communication
qemu: keep track of my nodemanager service
qemu: force started instances to have my hostId

Modified:
    incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
    incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py?rev=1370639&r1=1370638&r2=1370639&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py Wed Aug  8 02:34:00
2012
@@ -77,6 +77,7 @@ class NodeManagerService(object):
 
 		self.id = None
 		# XXXstroucki this fn could be in this level maybe?
+		# note we are passing our information down to the VMM here.
 		self.host = self.vmm.getHostInfo(self)
 
 		# populate self.instances

Modified: incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py?rev=1370639&r1=1370638&r2=1370639&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Wed Aug  8 02:34:00 2012
@@ -100,6 +100,8 @@ class Qemu(VmControlInterface):
 
 		self.log = logging.getLogger(__file__)
 		self.ifPrefix = "tashi"
+		# keep a handle to my NM service
+		self.service = None
 		self.controlledVMs = {}
 		self.hostname = socket.gethostname()
 		self.usedPorts = []
@@ -408,8 +410,9 @@ class Qemu(VmControlInterface):
 	# extern
 	def getHostInfo(self, service):
 		host = Host()
-		host.id = service.id
 		host.name = self.hostname
+		self.service = service
+		host.id = self.service.id
 
 		# Linux specific
 		memoryStr = open("/proc/meminfo","r").readline().strip().split()
@@ -590,6 +593,10 @@ class Qemu(VmControlInterface):
 
 		# parent process
 		os.close(pipe_w)
+
+		# enforce the new instance to have our hostId!
+		# otherwise, a migrated VM will have its previous hostId.
+		instance.hostId = self.service.id
 		child = self.anonClass(pid=pid, instance=instance, stderr=os.fdopen(pipe_r, 'r'), migratingOut
= False, monitorHistory=[], errorBit = True, OSchild = True)
 		child.ptyFile = None
 		child.vncPort = -1



Mime
View raw message