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 2012/02/08 04:23:58 UTC
svn commit: r1241771 - in /incubator/tashi/trunk: ./ doc/ etc/ src/tashi/
src/tashi/client/ src/tashi/clustermanager/ src/tashi/nodemanager/
src/tashi/nodemanager/vmcontrol/
Author: stroucki
Date: Wed Feb 8 04:23:57 2012
New Revision: 1241771
URL: http://svn.apache.org/viewvc?rev=1241771&view=rev
Log:
merge stroucki-accounting back into trunk
Added:
incubator/tashi/trunk/INSTALL
- copied unchanged from r1241770, incubator/tashi/branches/stroucki-accounting/INSTALL
incubator/tashi/trunk/doc/INSTALL2
- copied unchanged from r1241770, incubator/tashi/branches/stroucki-accounting/doc/INSTALL2
incubator/tashi/trunk/doc/RELEASES
- copied unchanged from r1241770, incubator/tashi/branches/stroucki-accounting/doc/RELEASES
Modified:
incubator/tashi/trunk/ (props changed)
incubator/tashi/trunk/Makefile
incubator/tashi/trunk/NOTICE
incubator/tashi/trunk/etc/NodeManager.cfg
incubator/tashi/trunk/etc/TashiDefaults.cfg
incubator/tashi/trunk/src/tashi/client/tashi-client.py
incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py
incubator/tashi/trunk/src/tashi/util.py
Propchange: incubator/tashi/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 8 04:23:57 2012
@@ -1,3 +1,4 @@
/incubator/tashi/branches/cmu:1178106-1187632
-/incubator/tashi/branches/stroucki-accounting:1221525-1235611
+/incubator/tashi/branches/stroucki-accounting:1221525-1241770
+/incubator/tashi/branches/stroucki-accounting/branches/stroucki-accounting:1221525-1235607
/incubator/tashi/branches/zoni-dev/trunk:1034098-1177646
Modified: incubator/tashi/trunk/Makefile
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/Makefile?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/Makefile (original)
+++ incubator/tashi/trunk/Makefile Wed Feb 8 04:23:57 2012
@@ -27,6 +27,15 @@ default: bin src/utils/nmd
all: bin src/utils/nmd src/tags doc/html aws
@echo Done
+package: src DISCLAIMER INSTALL LICENSE NOTICE README
+ @echo "Building package in apache-tashi.tar.gz"
+ rm -rf apache-tashi.tar.gz apache-tashi
+ mkdir apache-tashi
+ cp -rp doc etc Makefile src DISCLAIMER INSTALL LICENSE NOTICE README apache-tashi/
+ find apache-tashi -type d -name ".svn"|xargs rm -rf
+ tar zcf apache-tashi.tar.gz apache-tashi
+ rm -rf apache-tashi
+
doc: rmdoc doc/html
@echo Done
@@ -35,7 +44,7 @@ clean: rmnmd rmbin rmtags rmdoc rmaws
@echo Done
version:
- sed -i "s/version = .*/version = \"`date`\"/" src/tashi/version.py
+ sed -i "s/version = .*/version = \"`date +%Y-%m-%d`\"/" src/tashi/version.py
aws: src/tashi/aws/wsdl/AmazonEC2_services_types.py src/tashi/aws/wsdl/AmazonEC2_services_server.py
@@ -51,21 +60,15 @@ src/tashi/aws/wsdl/2009-04-04.ec2.wsdl:
rmaws:
if test -e src/tashi/aws/wsdl/2009-04-04.ec2.wsdl; then echo Removing aws...; rm -f src/tashi/aws/wsdl/2009-04-04.ec2.wsdl; rm -f src/tashi/aws/wsdl/AmazonEC2_*.py; fi
-# Implicit builds
-# src/utils/nmd: src/utils/Makefile src/utils/nmd.c
-# @echo Building nmd...
-# (cd src/utils; make)
-# ln -s ../src/utils/nmd ./bin/nmd
-
src/utils/nmd: src/utils/nmd.py
- ln -s ../src/utils/nmd.py ./bin/nmd.py
+ ln -s ../src/utils/nmd.py ./bin/nmd
#rmnmd:
# if test -e src/utils/nmd; then echo Removing nmd...; (cd src/utils; make clean); rm -f bin/nmd; fi
rmnmd:
- echo Removing nmd...; rm -f bin/nmd.py
+ echo Removing nmd...; rm -f bin/nmd
-bin: bindir bin/clustermanager.py bin/nodemanager.py bin/tashi-client.py bin/primitive.py bin/zoni-cli.py bin/accounting.py
+bin: bindir bin/clustermanager bin/nodemanager bin/tashi-client bin/primitive bin/zoni-cli bin/accounting
bindir:
if test ! -d bin; then mkdir bin; fi
rmbin: rmclustermanager rmnodemanager rmtashi-client rmprimitive rmzoni-cli rmaccounting
@@ -74,31 +77,31 @@ bin/getInstances:
if test ! -e bin/getInstances; then (echo "Generating client symlinks..."; cd bin; PYTHONPATH=../src ../src/tashi/client/client.py --makesyms); fi
rmclients:
if test -e bin/getInstances; then (echo Removing client symlinks...; cd bin; PYTHONPATH=../src ../src/tashi/client/client.py --rmsyms; cd ..); fi
-bin/accounting.py: src/tashi/accounting/accounting.py
+bin/accounting: src/tashi/accounting/accounting.py
@echo Symlinking in Accounting server...
- (cd bin; ln -s ../src/tashi/accounting/accounting.py .)
+ (cd bin; ln -s ../src/tashi/accounting/accounting.py accounting)
rmaccounting:
- if test -e bin/accounting.py; then echo Removing Accounting server symlink...; rm bin/accounting.py; fi
-bin/clustermanager.py: src/tashi/clustermanager/clustermanager.py
+ if test -e bin/accounting; then echo Removing Accounting server symlink...; rm bin/accounting; fi
+bin/clustermanager: src/tashi/clustermanager/clustermanager.py
@echo Symlinking in clustermanager...
- (cd bin; ln -s ../src/tashi/clustermanager/clustermanager.py .)
+ (cd bin; ln -s ../src/tashi/clustermanager/clustermanager.py clustermanager)
rmclustermanager:
- if test -e bin/clustermanager.py; then echo Removing clustermanager symlink...; rm bin/clustermanager.py; fi
-bin/nodemanager.py: src/tashi/nodemanager/nodemanager.py
+ if test -e bin/clustermanager; then echo Removing clustermanager symlink...; rm bin/clustermanager; fi
+bin/nodemanager: src/tashi/nodemanager/nodemanager.py
@echo Symlinking in nodemanager...
- (cd bin; ln -s ../src/tashi/nodemanager/nodemanager.py .)
+ (cd bin; ln -s ../src/tashi/nodemanager/nodemanager.py nodemanager)
rmnodemanager:
- if test -e bin/nodemanager.py; then echo Removing nodemanager symlink...; rm bin/nodemanager.py; fi
-bin/primitive.py: src/tashi/agents/primitive.py
+ if test -e bin/nodemanager; then echo Removing nodemanager symlink...; rm bin/nodemanager; fi
+bin/primitive: src/tashi/agents/primitive.py
@echo Symlinking in primitive...
- (cd bin; ln -s ../src/tashi/agents/primitive.py .)
+ (cd bin; ln -s ../src/tashi/agents/primitive.py primitive)
rmprimitive:
- if test -e bin/primitive.py; then echo Removing primitve-agent symlink...; rm bin/primitive.py; fi
-bin/tashi-client.py:
+ if test -e bin/primitive; then echo Removing primitve-agent symlink...; rm bin/primitive; fi
+bin/tashi-client:
@echo Symlinking in tashi-client...
- (cd bin; ln -s ../src/tashi/client/tashi-client.py .)
+ (cd bin; ln -s ../src/tashi/client/tashi-client.py tashi-client)
rmtashi-client:
- if test -e bin/tashi-client.py; then echo Removing tashi-client symlink...; rm bin/tashi-client.py; fi
+ if test -e bin/tashi-client; then echo Removing tashi-client symlink...; rm bin/tashi-client; fi
src/tags:
@echo Generating tags...
(cd src; ctags-exuberant -R --c++-kinds=+p --fields=+iaS --extra=+q -f ./tags .)
@@ -112,14 +115,15 @@ rmdoc:
if test -d doc/html; then echo Removing HTML docs...; rm -rf ./doc/html; fi
# Zoni
-bin/zoni-cli.py:
+bin/zoni-cli:
@echo Symlinking in zoni-cli...
- (cd bin; ln -s ../src/zoni/client/zoni-cli.py .)
+ (cd bin; ln -s ../src/zoni/client/zoni-cli .)
+# why necessarily put this in /usr/local/bin like nothing else?
usr/local/bin/zoni:
@echo Creating /usr/local/bin/zoni
(echo '#!/bin/bash\nPYTHONPATH=$(shell pwd)/src $(shell pwd)/bin/zoni-cli.py $$*' > /usr/local/bin/zoni; chmod 755 /usr/local/bin/zoni)
rmzoni-cli:
- if test -e bin/zoni-cli.py; then echo Removing zoni-cli symlink...; rm bin/zoni-cli.py; fi
+ if test -e bin/zoni-cli; then echo Removing zoni-cli symlink...; rm bin/zoni-cli; fi
if test -e /usr/local/bin/zoni; then echo Removing zoni...; rm /usr/local/bin/zoni; fi
## for now only print warnings having to do with bad indentation. pylint doesn't make it easy to enable only 1,2 checks
Modified: incubator/tashi/trunk/NOTICE
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/NOTICE?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/NOTICE (original)
+++ incubator/tashi/trunk/NOTICE Wed Feb 8 04:23:57 2012
@@ -1,5 +1,5 @@
Apache Tashi
-Copyright 2008-2011 The Apache Software Foundation
+Copyright 2008-2012 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Modified: incubator/tashi/trunk/etc/NodeManager.cfg
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/etc/NodeManager.cfg?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/etc/NodeManager.cfg (original)
+++ incubator/tashi/trunk/etc/NodeManager.cfg Wed Feb 8 04:23:57 2012
@@ -58,7 +58,7 @@ handlers = consoleHandler
propagate = 1
[Vfs]
-prefix = /dfs
+prefix = /tmp
[XenPV]
vmNamePrefix = tashi
@@ -75,7 +75,6 @@ convertExceptions = True
port = 9883
registerHost = False
registerFrequency = 10.0
-infoFile = /var/tmp/nm.dat
clusterManagerHost = localhost ; Clustermanager hostname
clusterManagerPort = 9882
statsInterval = 0.0
Modified: incubator/tashi/trunk/etc/TashiDefaults.cfg
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/etc/TashiDefaults.cfg?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/etc/TashiDefaults.cfg (original)
+++ incubator/tashi/trunk/etc/TashiDefaults.cfg Wed Feb 8 04:23:57 2012
@@ -106,7 +106,6 @@ convertExceptions = True
port = 9883
registerHost = False
registerFrequency = 10.0
-infoFile = /var/tmp/nm.dat
# Clustermanger hostname
clusterManagerHost = localhost
clusterManagerPort = 9882
@@ -114,7 +113,7 @@ statsInterval = 0.0
;bind = 0.0.0.0 ; not supported (Thrift is missing support to specify what to bind to!)
[Qemu]
-qemuBin = /usr/local/bin/qemu-system-x86_64
+qemuBin = /usr/bin/kvm
infoDir = /var/tmp/VmControlQemu/
pollDelay = 1.0
migrationRetries = 10
@@ -136,7 +135,7 @@ defaultVmType = pygrub
defaultDiskType=qcow
[Vfs]
-prefix = /dfs
+prefix = /tmp
[LocalityService]
host = localityserverhostname
@@ -155,12 +154,12 @@ clusterManagerTimeout = 5.0
publisher = tashi.messaging.GangliaPublisher
[Primitive]
-hook1 = tashi.agents.DhcpDns
+#hook1 = tashi.agents.DhcpDns
scheduleDelay = 2.0
densePack = False
[MauiWiki]
-hook1 = tashi.agents.DhcpDns
+#hook1 = tashi.agents.DhcpDns
refreshTime = 5
authuser = changeme
authkey = 1111
Modified: incubator/tashi/trunk/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/client/tashi-client.py?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/trunk/src/tashi/client/tashi-client.py Wed Feb 8 04:23:57 2012
@@ -211,6 +211,7 @@ extraViews = {
'getSlots': (getSlots, None),
'getImages': (None, ['id', 'imageName', 'imageSize']),
'copyImage': (None, None),
+'createVm': (None, ['id', 'hostId', 'name', 'user', 'state', 'disk', 'memory', 'cores']),
'createMany': (createMany, ['id', 'hostId', 'name', 'user', 'state', 'disk', 'memory', 'cores']),
'destroyMany': (destroyMany, None),
'getVmLayout': (getVmLayout, ['id', 'name', 'state', 'instances', 'usedMemory', 'memory', 'usedCores', 'cores']),
@@ -575,7 +576,8 @@ def main():
if (type(res) == types.ListType):
makeTable(res, keys)
else:
- pprint(res)
+ makeTable([res], keys)
+
except IOError:
pass
except Exception, e:
Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Wed Feb 8 04:23:57 2012
@@ -277,6 +277,7 @@ class ClusterManagerService(object):
instance.state != InstanceState.Orphaned:
continue
+ # XXXstroucki should lock instance here?
if (self.instanceLastContactTime[instanceId] < (self.__now() - self.allowDecayed)):
try:
instance = self.data.acquireInstance(instanceId)
Modified: incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/nodemanagerservice.py Wed Feb 8 04:23:57 2012
@@ -47,7 +47,6 @@ class NodeManagerService(object):
self.log = logging.getLogger(__file__)
self.convertExceptions = boolean(config.get('NodeManagerService', 'convertExceptions'))
self.registerFrequency = float(config.get('NodeManagerService', 'registerFrequency'))
- self.infoFile = self.config.get('NodeManagerService', 'infoFile')
self.statsInterval = float(self.config.get('NodeManagerService', 'statsInterval'))
self.registerHost = boolean(config.get('NodeManagerService', 'registerHost'))
try:
@@ -225,9 +224,17 @@ class NodeManagerService(object):
def __getInstance(self, vmId):
instance = self.instances.get(vmId, None)
- if (instance is None):
- raise TashiException(d={'errno':Errors.NoSuchVmId,'msg':"There is no vmId %d on this host" % (vmId)})
- return instance
+ if instance is not None:
+ return instance
+
+ # refresh self.instances if not found
+ self.__loadVmInfo()
+ instance = self.instances.get(vmId, None)
+ if instance is not None:
+ return instance
+
+
+ raise TashiException(d={'errno':Errors.NoSuchVmId,'msg':"There is no vmId %d on this host" % (vmId)})
# remote
# Called from VMM to update 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=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/trunk/src/tashi/nodemanager/vmcontrol/qemu.py Wed Feb 8 04:23:57 2012
@@ -205,9 +205,10 @@ class Qemu(VmControlInterface):
try:
if self.scratchVg is not None:
log.info("Removing any scratch for %s" % (name))
- cmd = "/sbin/lvremove -f %s" % self.scratchVg
- result = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE).wait()
+ cmd = "/sbin/lvremove --quiet -f %s" % self.scratchVg
+ result = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE, stderr=open(os.devnull, "w"), close_fds=True).wait()
except:
+ log.warning("Problem cleaning scratch volumes")
pass
# let the NM know
@@ -463,7 +464,7 @@ class Qemu(VmControlInterface):
scratchName = "lv%s" % instance.name
# XXXstroucki hold lock
# XXXstroucki check for capacity
- cmd = "/sbin/lvcreate -n%s -L %dG %s" % (scratchName, scratchSize, self.scratchVg)
+ cmd = "/sbin/lvcreate --quiet -n%s -L %dG %s" % (scratchName, scratchSize, self.scratchVg)
# XXXstroucki check result
result = subprocess.Popen(cmd.split(), executable=cmd.split()[0], stdout=subprocess.PIPE).wait()
index += 1
@@ -621,7 +622,7 @@ class Qemu(VmControlInterface):
self.nm.vmStateChange(vmId, None, InstanceState.Running)
# XXXstroucki Should make sure Running state is saved
# otherwise on restart it will appear as Activating
- # until we update the state in __matchSystemPids
+ # until we update the state in __matchHostPids
child.instance.state = InstanceState.Running
self.__saveChildInfo(child)
return vmId
Modified: incubator/tashi/trunk/src/tashi/util.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/util.py?rev=1241771&r1=1241770&r2=1241771&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/util.py (original)
+++ incubator/tashi/trunk/src/tashi/util.py Wed Feb 8 04:23:57 2012
@@ -209,7 +209,7 @@ def getConfig(additionalNames=[], additi
"""Creates many permutations of a list of locations to look for config
files and then loads them"""
config = ConfigParser.ConfigParser()
- baseLocations = ['./etc/', '/usr/share/tashi/', '/etc/tashi/', os.path.expanduser('~/.tashi/')]
+ baseLocations = ['/usr/local/tashi/etc/', '/usr/share/tashi/', '/etc/tashi/', os.path.expanduser('~/.tashi/')]
names = ['Tashi'] + additionalNames
names = reduce(lambda x, y: x + [y+"Defaults", y], names, [])
allLocations = reduce(lambda x, y: x + reduce(lambda z, a: z + [y + a + ".cfg"], names, []), baseLocations, []) + additionalFiles