This class is used by topology definition scripts.
"""
- def __init__(self, controller=RemoteController, dc_emulation_max_cpu=1.0, **kwargs):
+ def __init__(self, controller=RemoteController,
+ dc_emulation_max_cpu=1.0, # fraction of overall CPU time for emulation
+ dc_emulation_max_mem=512, # emulation max mem in MB
+ **kwargs):
"""
Create an extended version of a Dockernet network
:param dc_emulation_max_cpu: max. CPU time used by containers in data centers
self.monitor_agent = DCNetworkMonitor(self)
# initialize resource model registrar
- self.rm_registrar = ResourceModelRegistrar(dc_emulation_max_cpu)
+ self.rm_registrar = ResourceModelRegistrar(
+ dc_emulation_max_cpu, dc_emulation_max_mem)
def addDatacenter(self, label, metadata={}):
"""
Global registry to keep track of all existing resource models.
"""
- def __init__(self, dc_emulation_max_cpu):
+ def __init__(self, dc_emulation_max_cpu, dc_emulation_max_mem):
self.e_cpu = dc_emulation_max_cpu
+ self.e_mem = dc_emulation_max_mem
# pointer to all resource models assigned to DCs
self._resource_models = dict()
- LOG.info("Resource model registrar created with dc_emulation_max_cpu=%r" % dc_emulation_max_cpu)
+ LOG.info("Resource model registrar created with dc_emulation_max_cpu=%r and dc_emulation_max_mem=%r"
+ % (dc_emulation_max_cpu, dc_emulation_max_mem))
def register(self, dc, rm):
"""