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/07/19 19:28:55 UTC
svn commit: r1363494 - in /incubator/tashi/branches/stable: ./ INSTALL
src/tashi/client/tashi-client.py
src/tashi/clustermanager/clustermanagerservice.py
src/tashi/rpycservices/rpycservices.py
Author: stroucki
Date: Thu Jul 19 19:28:55 2012
New Revision: 1363494
URL: http://svn.apache.org/viewvc?rev=1363494&view=rev
Log:
Merge stable from trunk. It does add one new function "setHostNotes", to allow that field to be set from the client, instead of having to twiddle the database.
Modified:
incubator/tashi/branches/stable/ (props changed)
incubator/tashi/branches/stable/INSTALL
incubator/tashi/branches/stable/src/tashi/client/tashi-client.py
incubator/tashi/branches/stable/src/tashi/clustermanager/clustermanagerservice.py
incubator/tashi/branches/stable/src/tashi/rpycservices/rpycservices.py
Propchange: incubator/tashi/branches/stable/
------------------------------------------------------------------------------
Merged /incubator/tashi/trunk:r1362324-1363491
Modified: incubator/tashi/branches/stable/INSTALL
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stable/INSTALL?rev=1363494&r1=1363493&r2=1363494&view=diff
==============================================================================
--- incubator/tashi/branches/stable/INSTALL (original)
+++ incubator/tashi/branches/stable/INSTALL Thu Jul 19 19:28:55 2012
@@ -60,7 +60,8 @@ brctl sethello br0 1
ifdown eth0;ifconfig eth0 0.0.0.0;brctl addif br0 eth0;dhclient br0
# create a script /etc/qemu-ifup.0 which will allow virtual machines
-# to be attached to the default network (0).
+# to be attached to the default network (0). Check your setup for the
+# correct paths. E.g. in Debian, brctl is in /usr/sbin/brctl
cat /etc/qemu-ifup.0
#!/bin/sh
@@ -77,6 +78,9 @@ chmod 700 /etc/qemu-ifup.0
If you don't have RPyC version 3.1 installed, download a copy from
http://sourceforge.net/projects/rpyc/files/main/ and install it.
+If you wish to run the Tashi components in debugging mode, you
+will want iPython from http://ipython.org/.
+
Prepare a virtual machine image in qcow2 format for Tashi to deploy. You
can create this with practically any consumer or professional
virtualization system, by converting the resulting disk image via
Modified: incubator/tashi/branches/stable/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stable/src/tashi/client/tashi-client.py?rev=1363494&r1=1363493&r2=1363494&view=diff
==============================================================================
--- incubator/tashi/branches/stable/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stable/src/tashi/client/tashi-client.py Thu Jul 19 19:28:55 2012
@@ -201,11 +201,11 @@ def getSlots(cores, memory):
countbymemory = int((h.memory - h.usedMemory) / memory)
count += max(0, min(countbycores, countbymemory))
- print "%d" % (count),
- print (lambda:"instances", lambda:"instance")[count == 1](),
- print "with %d" % (cores),
- print (lambda:"cores", lambda:"core")[cores == 1](),
- print "and %d MB memory could be created." % (memory)
+ print "%d" % (count), "available",
+ print ("slots", "slot")[count == 1],
+ print "for instances with %d" % (cores),
+ print ("cores", "core")[cores == 1],
+ print "and %d MB of memory." % (memory)
def createMany(instance, count):
# will create instances from 0 to count-1
@@ -288,6 +288,7 @@ argLists = {
'copyImage': [('src', str, lambda: requiredArg('src'),True), ('dst', str, lambda: requiredArg('dst'), True)],
'getHosts': [],
'setHostState': [('host', checkHid, lambda: requiredArg('host'), True), ('state', str, lambda: requiredArg('state'), True)],
+'setHostNotes': [('host', checkHid, lambda: requiredArg('host'), True), ('notes', str, lambda: requiredArg('notes'), True)],
'getUsers': [],
'getNetworks': [],
'getInstances': [],
@@ -315,6 +316,7 @@ convertArgs = {
'getSlots' : '[cores, memory]',
'copyImage' : '[src, dst]',
'setHostState' : '[host, state]',
+'setHostNotes' : '[host, notes]',
}
# Descriptions
@@ -333,6 +335,7 @@ description = {
'getSlots': 'Get a count of how many VMs could be started in the cluster',
'getHosts': 'Gets a list of hosts running Node Managers',
'setHostState': 'Set the state of a host, eg. Normal or Drained',
+'setHostNotes': 'Provide an annotation to a host',
'getUsers': 'Gets a list of users',
'getNetworks': 'Gets a list of available networks for VMs to be placed on',
'getInstances': 'Gets a list of all VMs in the cluster',
@@ -360,6 +363,7 @@ examples = {
'getSlots': ['--cores 1 --memory 128'],
'getHosts': [''],
'setHostState': ['--host vmhost1 --state Drained'],
+'setHostNotes': ['--host vmhost1 --notes "Memory error"'],
'getUsers': [''],
'getNetworks': [''],
'getInstances': [''],
Modified: incubator/tashi/branches/stable/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stable/src/tashi/clustermanager/clustermanagerservice.py?rev=1363494&r1=1363493&r2=1363494&view=diff
==============================================================================
--- incubator/tashi/branches/stable/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/branches/stable/src/tashi/clustermanager/clustermanagerservice.py Thu Jul 19 19:28:55 2012
@@ -585,6 +585,17 @@ class ClusterManagerService(object):
return "Host state set to %s." % hostStates[hostState]
# extern
+ def setHostNotes(self, hostId, notes):
+ hostNotes = notes
+ host = self.data.acquireHost(hostId)
+ try:
+ host.notes = hostNotes
+ finally:
+ self.data.releaseHost(host)
+
+ return 'Host notes set to "%s".' % hostNotes
+
+ # extern
def getNetworks(self):
networks = self.data.getNetworks()
for network in networks:
Modified: incubator/tashi/branches/stable/src/tashi/rpycservices/rpycservices.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stable/src/tashi/rpycservices/rpycservices.py?rev=1363494&r1=1363493&r2=1363494&view=diff
==============================================================================
--- incubator/tashi/branches/stable/src/tashi/rpycservices/rpycservices.py (original)
+++ incubator/tashi/branches/stable/src/tashi/rpycservices/rpycservices.py Thu Jul 19 19:28:55 2012
@@ -19,7 +19,7 @@ import rpyc
from tashi.rpycservices.rpyctypes import Instance, Host, User
import cPickle
-clusterManagerRPCs = ['createVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'migrateVm', 'pauseVm', 'unpauseVm', 'getHosts', 'getNetworks', 'getUsers', 'getInstances', 'vmmSpecificCall', 'registerNodeManager', 'vmUpdate', 'activateVm', 'registerHost', 'getImages', 'copyImage', 'setHostState']
+clusterManagerRPCs = ['createVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'migrateVm', 'pauseVm', 'unpauseVm', 'getHosts', 'getNetworks', 'getUsers', 'getInstances', 'vmmSpecificCall', 'registerNodeManager', 'vmUpdate', 'activateVm', 'registerHost', 'getImages', 'copyImage', 'setHostState', 'setHostNotes']
nodeManagerRPCs = ['instantiateVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'prepReceiveVm', 'prepSourceVm', 'migrateVm', 'receiveVm', 'pauseVm', 'unpauseVm', 'getVmInfo', 'listVms', 'vmmSpecificCall', 'getHostInfo', 'liveCheck']
accountingRPCs = ['record']