X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=slivermanager.py;h=624853e72bc8ad59ce4e9123f38c8f2d2b184717;hb=1b4f53e648b13f7629970787b6ec03387e2d966a;hp=ce1f255bb8a517c3797456cbd997ebb167b303f9;hpb=0d641521588473a60d835b8b13a9567f6d49effc;p=nodemanager.git diff --git a/slivermanager.py b/slivermanager.py index ce1f255..624853e 100644 --- a/slivermanager.py +++ b/slivermanager.py @@ -23,18 +23,19 @@ try: sliver_class_to_register = sliver_lxc.Sliver_LXC sliver_password_shell = sliver_lxc.Sliver_LXC.SHELL except: - import sliver_vs - implementation='vs' - sliver_default_type='sliver.VServer' - sliver_class_to_register = sliver_vs.Sliver_VS - sliver_password_shell = sliver_vs.Sliver_VS.SHELL - -# temporary - hopefully bwlimit will be packaged separately and there will be no need to do this any longer -try: - from bwlimitlxc import bwmin, bwmax -except: - try : from bwlimit import bwmin, bwmax - except: bwmin, bwmax = 8, 1000*1000*1000 + try: + import sliver_vs + implementation='vs' + sliver_default_type='sliver.VServer' + sliver_class_to_register = sliver_vs.Sliver_VS + sliver_password_shell = sliver_vs.Sliver_VS.SHELL + except: + logger.log("Could not import either sliver_lxc or sliver_vs - bailing out") + exit(1) + +# just being safe +try : from plnode.bwlimit import bwmin, bwmax +except: bwmin, bwmax = 8, 1000*1000*1000 priority=10 @@ -45,6 +46,7 @@ DEFAULT_ALLOCATION = { 'cpu_pct': 0, # percent CPU reserved 'cpu_share': 1, # proportional share 'cpu_cores': "0b", # reserved cpu cores [b] + 'cpu_freezable': 0, # freeze processes if cpu_cores is 0 # bandwidth parameters 'net_min_rate': bwmin / 1000, # kbps 'net_max_rate': bwmax / 1000, # kbps