git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b67854b
)
automatically restart a slice when its resource limits have been changed
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Thu, 10 May 2007 22:34:51 +0000
(22:34 +0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Thu, 10 May 2007 22:34:51 +0000
(22:34 +0000)
sliver_vs.py
patch
|
blob
|
history
diff --git
a/sliver_vs.py
b/sliver_vs.py
index
ac1f0ba
..
1bb6cb6
100644
(file)
--- a/
sliver_vs.py
+++ b/
sliver_vs.py
@@
-166,6
+166,17
@@
class Sliver_VS(accounts.Account, vserver.VServer):
else:
logger.log('%s: setting cpu share to %d' % (self.name, cpu_share))
self.set_sched_config(cpu_share, 0)
else:
logger.log('%s: setting cpu share to %d' % (self.name, cpu_share))
self.set_sched_config(cpu_share, 0)
+
+ if self.have_limits_changed():
+ logger.log('%s: limits have changed --- restarting' % self.name)
+ stopcount = 10
+ while self.isrunning() and stopcount > 0:
+ self.stop()
+ delay = 1
+ time.sleep(delay)
+ stopcount = stopcount - 1
+ self.start()
+
else: # tell vsh to disable remote login by setting CPULIMIT to 0
logger.log('%s: disabling remote login' % self.name)
self.set_sched_config(0, 0)
else: # tell vsh to disable remote login by setting CPULIMIT to 0
logger.log('%s: disabling remote login' % self.name)
self.set_sched_config(0, 0)