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:
9827764
)
Change cpu_min to cpu_pct to avoid name conflict with attributes affecting rlimits
author
Andy Bavier
<acb@cs.princeton.edu>
Mon, 21 Jan 2008 19:39:20 +0000
(19:39 +0000)
committer
Andy Bavier
<acb@cs.princeton.edu>
Mon, 21 Jan 2008 19:39:20 +0000
(19:39 +0000)
database.py
patch
|
blob
|
history
sliver_vs.py
patch
|
blob
|
history
diff --git
a/database.py
b/database.py
index
8681539
..
92c5ef4
100644
(file)
--- a/
database.py
+++ b/
database.py
@@
-23,7
+23,7
@@
import bwmon
# We enforce minimum allocations to keep the clueless from hosing their slivers.
# Disallow disk loans because there's currently no way to punish slivers over quota.
# We enforce minimum allocations to keep the clueless from hosing their slivers.
# Disallow disk loans because there's currently no way to punish slivers over quota.
-MINIMUM_ALLOCATION = {'cpu_
min
': 0, 'cpu_share': 1, 'net_min_rate': 0, 'net_max_rate': 8, 'net_i2_min_rate': 0, 'net_i2_max_rate': 8, 'net_share': 1}
+MINIMUM_ALLOCATION = {'cpu_
pct
': 0, 'cpu_share': 1, 'net_min_rate': 0, 'net_max_rate': 8, 'net_i2_min_rate': 0, 'net_i2_max_rate': 8, 'net_share': 1}
LOANABLE_RESOURCES = MINIMUM_ALLOCATION.keys()
DB_FILE = '/root/sliver_mgr_db.pickle'
LOANABLE_RESOURCES = MINIMUM_ALLOCATION.keys()
DB_FILE = '/root/sliver_mgr_db.pickle'
diff --git
a/sliver_vs.py
b/sliver_vs.py
index
b0497c4
..
2f183c8
100644
(file)
--- a/
sliver_vs.py
+++ b/
sliver_vs.py
@@
-162,21
+162,21
@@
class Sliver_VS(accounts.Account, vserver.VServer):
logger.log('%s: setting net share to %d' % (self.name, net_limits[-1]))
self.set_bwlimit(*net_limits)
logger.log('%s: setting net share to %d' % (self.name, net_limits[-1]))
self.set_bwlimit(*net_limits)
- cpu_
min = self.rspec['cpu_min
']
+ cpu_
pct = self.rspec['cpu_pct
']
cpu_share = self.rspec['cpu_share']
if self.rspec['enabled'] > 0:
cpu_share = self.rspec['cpu_share']
if self.rspec['enabled'] > 0:
- if cpu_
min
> 0:
- logger.log('%s: setting cpu reservation to %d%%' % (self.name, cpu_
min
))
+ if cpu_
pct
> 0:
+ logger.log('%s: setting cpu reservation to %d%%' % (self.name, cpu_
pct
))
else:
else:
- cpu_
min
= 0
+ cpu_
pct
= 0
if cpu_share > 0:
logger.log('%s: setting cpu share to %d' % (self.name, cpu_share))
else:
cpu_share = 0
if cpu_share > 0:
logger.log('%s: setting cpu share to %d' % (self.name, cpu_share))
else:
cpu_share = 0
- self.set_sched_config(cpu_
min
, cpu_share)
+ self.set_sched_config(cpu_
pct
, cpu_share)
# if IP address isn't set (even to 0.0.0.0), sliver won't be able to use network
if self.rspec['ip_addresses'] != '0.0.0.0':
logger.log('%s: setting IP address(es) to %s' % (self.name, self.rspec['ip_addresses']))
# if IP address isn't set (even to 0.0.0.0), sliver won't be able to use network
if self.rspec['ip_addresses'] != '0.0.0.0':
logger.log('%s: setting IP address(es) to %s' % (self.name, self.rspec['ip_addresses']))