X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Ftango%2F__init__.py;h=0a1f6ae05d66cd49c189ef9ad22fc914e70bf1ca;hp=ea3bc545060dc35bbcc1aca0c5f32fe80b104058;hb=aa8823c85d94a4fa72de058076195296334cdb91;hpb=f8f135c271341479200232641823520a541f33b0 diff --git a/src/emuvim/api/tango/__init__.py b/src/emuvim/api/tango/__init__.py index ea3bc54..0a1f6ae 100755 --- a/src/emuvim/api/tango/__init__.py +++ b/src/emuvim/api/tango/__init__.py @@ -31,7 +31,7 @@ # partner consortium (www.5gtango.eu). import logging import threading -import llcm +from emuvim.api.tango import llcm LOG = logging.getLogger("5gtango.llcm") @@ -45,7 +45,8 @@ class TangoLLCMEndpoint(object): """ def __init__(self, listenip, port, deploy_sap=False, docker_management=False, - auto_deploy=False, auto_delete=False, sap_vnfd_path=None): + auto_deploy=False, auto_delete=False, sap_vnfd_path=None, + placement_algorithm_obj=None, env_conf_folder=None): self.dcs = {} self.ip = listenip self.port = port @@ -54,7 +55,14 @@ class TangoLLCMEndpoint(object): llcm.AUTO_DEPLOY = auto_deploy llcm.AUTO_DELETE = auto_delete llcm.SAP_VNFD = sap_vnfd_path + if placement_algorithm_obj is None: + # Default placement is RR placement + placement_algorithm_obj = llcm.RoundRobinDcPlacement() + llcm.PLACEMENT_ALGORITHM_OBJ = placement_algorithm_obj + llcm.PER_INSTANCE_ENV_CONFIGURATION_FOLDER = env_conf_folder LOG.info("Created 5GTANGO LLCM API endpoint %s" % self) + LOG.info("Using placement algorithm: {}".format( + placement_algorithm_obj)) def __repr__(self): return "%s(%s:%d)" % (self.__class__.__name__, self.ip, self.port)