Beispiel #1
0
    def _invoke_driver_thread(self, vdu, instance, vdu_name, mgmt_ip, method,
                              arguments, event):
        global launchd_threads_info
        LOG.debug(_("Configuration of the remote VNF %s being intiated"),
                  instance)
        _thr_id = str(uuid.generate_uuid()).split('-')[1]
        try:

            driver_thread = ImplThread(self._configure_service,
                                       self._condition,
                                       vdu,
                                       instance,
                                       mgmt_ip,
                                       method,
                                       arguments,
                                       event,
                                       _id=_thr_id)
            self._condition.acquire()
            launchd_threads_info[_thr_id] = {
                'vm_name': instance,
                'thread_obj': driver_thread,
                'vnfd': vdu['_vnfd'],
                'vdu': vdu_name
            }
            self._condition.release()
            driver_thread.start()
        except RuntimeError:
            LOG.warning(_("Configuration by the Driver Failed!"))
 def _invoke_driver_thread(self, vdu, instance, vdu_name):
     global launchd_threads_info
     LOG.debug(_("Configuration of the remote VNF %s being intiated"), instance)
     _thr_id = str(uuid.generate_uuid()).split('-')[1]   
     try:
        driver_thread = ImplThread(self._configure_service, self._condition, vdu, instance, _id = _thr_id)
        self._condition.acquire()
        launchd_threads_info[_thr_id] = {'vm_name': instance, 'thread_obj': driver_thread, 'vnfd': vdu['_vnfd'], 'vdu':vdu_name}
        self._condition.release()
        driver_thread.start()
     except RuntimeError:
        LOG.warning(_("Configuration by the Driver Failed!"))
Beispiel #3
0
    def postConfigure(self, context, conf):
        LOG.debug(_(" In post configure"))
        for instance in conf['instances_list']:
            mgmt_ip = conf['mgmt-ip'][instance]
            _thr_id = str(uuid.generate_uuid()).split('-')[1]
            vdu = {}
            vdu['name'] = conf['vdu']
            kwargs = {
                'conf': self.ns_config,
                'username': self.drv_conf[vdu['name']]['_username'],
                'password': self.drv_conf[vdu['name']]['_password']
            }

            drv_obj = importutils.import_object(conf['driver'], **kwargs)
            self.drv_conf[vdu['name']]['config'] = {}
            self.drv_conf[vdu['name']]['config']['_driver'] = conf['driver']
            vdu['config'] = {}
            vdu['config']['_drv_obj'] = drv_obj
            method = 'postconfigure'
            arguments = conf['data']
            configThread = ImplThread(self._configure_service,
                                      self._condition,
                                      vdu,
                                      instance,
                                      mgmt_ip,
                                      method,
                                      arguments,
                                      conf['event'],
                                      _id=_thr_id)
            self._condition.acquire()
            launchd_threads_info[_thr_id] = {
                'vm_name': instance,
                'thread_obj': configThread,
                'vnfd': conf['vnf'],
                'vdu': conf['vdu'],
                'conf': conf,
                'event': "postconfigure"
            }
            self._condition.release()
            configThread.start()
Beispiel #4
0
def generate_request_id():
    return 'req-%s' % uuidutils.generate_uuid()
Beispiel #5
0
def generate_request_id():
    return 'req-%s' % uuidutils.generate_uuid()