incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1178110 - in /incubator/tashi: site/docs/documentation-options.html site/xdocs/documentation-options.xml trunk/etc/TashiDefaults.cfg trunk/src/tashi/nodemanager/vmcontrol/qemu.py
Date Sun, 02 Oct 2011 00:49:08 GMT
Author: stroucki
Date: Sun Oct  2 00:49:08 2011
New Revision: 1178110

URL: http://svn.apache.org/viewvc?rev=1178110&view=rev
Log:
let host-local scratch facility be a configuration option

Modified:
    incubator/tashi/site/docs/documentation-options.html
    incubator/tashi/site/xdocs/documentation-options.xml
    incubator/tashi/trunk/etc/TashiDefaults.cfg
    incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/site/docs/documentation-options.html
URL: http://svn.apache.org/viewvc/incubator/tashi/site/docs/documentation-options.html?rev=1178110&r1=1178109&r2=1178110&view=diff
==============================================================================
--- incubator/tashi/site/docs/documentation-options.html (original)
+++ incubator/tashi/site/docs/documentation-options.html Sun Oct  2 00:49:08 2011
@@ -380,6 +380,11 @@ table.options td {
 <td>Location where Qemu snapshot disk images can be placed</td>
 </tr>
 <tr>
+<td>scratchVg</td>
+<td>None</td>
+<td>Volume group where host-local logican volumes can be allocated</td>
+</tr>
+<tr>
 <td>pollDelay</td>
 <td>1.0</td>
 <td>How often to check and see if a VM has exited</td>

Modified: incubator/tashi/site/xdocs/documentation-options.xml
URL: http://svn.apache.org/viewvc/incubator/tashi/site/xdocs/documentation-options.xml?rev=1178110&r1=1178109&r2=1178110&view=diff
==============================================================================
--- incubator/tashi/site/xdocs/documentation-options.xml (original)
+++ incubator/tashi/site/xdocs/documentation-options.xml Sun Oct  2 00:49:08 2011
@@ -311,6 +311,11 @@
 <td>Location where Qemu snapshot disk images can be placed</td>
 </tr>
 <tr>
+<td>scratchVg</td>
+<td>None</td>
+<td>Volume group where host-local logican volumes can be allocated</td>
+</tr>
+<tr>
 <td>pollDelay</td>
 <td>1.0</td>
 <td>How often to check and see if a VM has exited</td>

Modified: incubator/tashi/trunk/etc/TashiDefaults.cfg
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/etc/TashiDefaults.cfg?rev=1178110&r1=1178109&r2=1178110&view=diff
==============================================================================
--- incubator/tashi/trunk/etc/TashiDefaults.cfg (original)
+++ incubator/tashi/trunk/etc/TashiDefaults.cfg Sun Oct  2 00:49:08 2011
@@ -117,6 +117,7 @@ migrateTimeout = 300.0
 maxParallelMigrations = 10
 useMigrateArgument = False
 statsInterval = 0.0
+#scratchVg = vgscratch
 
 [XenPV]
 vmNamePrefix = tashi

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=1178110&r1=1178109&r2=1178110&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Sun Oct  2 00:49:08 2011
@@ -105,6 +105,7 @@ class Qemu(VmControlInterface):
 		self.consolePortLock = threading.Lock()
 		self.migrationSemaphore = threading.Semaphore(int(self.config.get("Qemu", "maxParallelMigrations")))
 		self.stats = {}
+		self.scratchVg = self.config.get("Qemu", "scratchVg")
 		# XXXstroucki revise
 		self.scratchDir = self.config.get("Qemu", "scratchDir")
 		if len(self.scratchDir) == 0:
@@ -178,11 +179,15 @@ class Qemu(VmControlInterface):
 						f.write(i)
 					f.close()
 				#XXXstroucki remove scratch storage
-				scratch_name = child.instance.name
-				log.info("Removing scratch for " + scratch_name)
-				#cmd = "/sbin/lvremove -f vgscratch/lv" + scratch_name
-				cmd = "/sbin/lvremove -f vgscratch"
-    				result = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE).wait()
+				try:
+					if self.scratchVg is not None:
+						scratch_name = child.instance.name
+						log.info("Removing scratch for " + scratch_name)
+						cmd = "/sbin/lvremove -f %s" % self.scratchVg
+    						result = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE).wait()
+				except:
+					pass
+
 				try:
 					if (not child.migratingOut):
 						self.nm.vmStateChange(vmId, None, InstanceState.Exited)
@@ -395,17 +400,19 @@ class Qemu(VmControlInterface):
 
 		try:
 			if scratchSize > 0:
+				if self.scratchVg is None:
+					raise Exception, "No scratch volume group defined"
 				# create scratch disk
 				# XXXstroucki: needs to be cleaned somewhere
 				# XXXstroucki: clean user provided instance name
 				scratch_name = "lv" + instance.name
 				# XXXstroucki hold lock
 				# XXXstroucki check for capacity
-				cmd = "/sbin/lvcreate -n" + scratch_name + " -L" + str(scratchSize) + "G vgscratch"
+				cmd = "/sbin/lvcreate -n" + scratch_name + " -L" + str(scratchSize) + "G " + self.scratchVg
 				result = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE).wait()
 				index += 1
 
-				thisDiskList = [ "file=/dev/vgscratch/%s" % scratch_name ]
+				thisDiskList = [ "file=/dev/%s/%s" % (self.scratchVg, scratch_name) ]
 				thisDiskList.append("if=%s" % diskInterface)
 				thisDiskList.append("index=%d" % index)
 				thisDiskList.append("cache=off")



Mime
View raw message