- if (nsr_vnfr.vnfd.id == vnfr_cp_ref.vnfd_id_ref and
- nsr_vnfr.member_vnf_index == vnfr_cp_ref.member_vnf_index_ref):
- vnfr_cp_ref.vnfr_id_ref = nsr_vnfr.id
- vnfr_cp_ref.vnfr_name_ref = nsr_vnfr.name
- vnfr_cp_ref.vnfr_connection_point_ref = rsp_cp_ref.vnfd_connection_point_ref
-
- vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
- self._log.debug(" Received VNFR is %s", vnfr)
- while vnfr.operational_status != 'running':
- self._log.info("Received vnf op status is %s; retrying",vnfr.operational_status)
- if vnfr.operational_status == 'failed':
- self._log.error("Fetching VNFR for %s failed", vnfr.id)
- raise NsrInstantiationFailed("Failed NS %s instantiation due to VNFR %s failure" % (self.id, vnfr.id))
- yield from asyncio.sleep(2, loop=self._loop)
- vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
- self._log.debug("Received VNFR is %s", vnfr)
-
- vnfr_cp_ref.connection_point_params.mgmt_address = vnfr.mgmt_interface.ip_address
- for cp in vnfr.connection_point:
- if cp.name == vnfr_cp_ref.vnfr_connection_point_ref:
- vnfr_cp_ref.connection_point_params.port_id = cp.connection_point_id
- vnfr_cp_ref.connection_point_params.name = self._nsr.name + '.' + cp.name
- for vdu in vnfr.vdur:
- for ext_intf in vdu.external_interface:
- if ext_intf.name == vnfr_cp_ref.vnfr_connection_point_ref:
- vnfr_cp_ref.connection_point_params.vm_id = vdu.vim_id
- self._log.debug("VIM ID for CP %s in VNFR %s is %s",cp.name,nsr_vnfr.id,
+ if (nsr_vnfr.vnfd.id == vnfr_cp_ref.vnfd_id_ref and
+ nsr_vnfr.member_vnf_index == vnfr_cp_ref.member_vnf_index_ref):
+ vnfr_cp_ref.vnfr_id_ref = nsr_vnfr.id
+ vnfr_cp_ref.vnfr_name_ref = nsr_vnfr.name
+ vnfr_cp_ref.vnfr_connection_point_ref = rsp_cp_ref.vnfd_connection_point_ref
+
+ vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
+ self._log.debug(" Received VNFR is %s", vnfr)
+ while vnfr.operational_status != 'running':
+ self._log.info("Received vnf op status is %s; retrying",vnfr.operational_status)
+ if vnfr.operational_status == 'failed':
+ self._log.error("Fetching VNFR for %s failed", vnfr.id)
+ raise NsrInstantiationFailed("Failed NS %s instantiation due to VNFR %s failure" % (self.id, vnfr.id))
+ yield from asyncio.sleep(2, loop=self._loop)
+ vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
+ self._log.debug("Received VNFR is %s", vnfr)
+
+ vnfr_cp_ref.connection_point_params.mgmt_address = vnfr.mgmt_interface.ip_address
+ for cp in vnfr.connection_point:
+ if cp.name == vnfr_cp_ref.vnfr_connection_point_ref:
+ vnfr_cp_ref.connection_point_params.port_id = cp.connection_point_id
+ vnfr_cp_ref.connection_point_params.name = self._nsr.name + '.' + cp.name
+ for vdu in vnfr.vdur:
+ for ext_intf in vdu.external_interface:
+ if ext_intf.name == vnfr_cp_ref.vnfr_connection_point_ref:
+ vnfr_cp_ref.connection_point_params.vm_id = vdu.vim_id
+ self._log.debug("VIM ID for CP %s in VNFR %s is %s",cp.name,nsr_vnfr.id,
- if (nsr_vnfr.vnfd.id == vnffgd_classifier.vnfd_id_ref and
- nsr_vnfr.member_vnf_index == vnffgd_classifier.member_vnf_index_ref):
- vnffgr_classifier.vnfr_id_ref = nsr_vnfr.id
- vnffgr_classifier.vnfr_name_ref = nsr_vnfr.name
- vnffgr_classifier.vnfr_connection_point_ref = vnffgd_classifier.vnfd_connection_point_ref
-
- if nsr_vnfr.vnfd.service_function_chain == 'CLASSIFIER':
- vnffgr_classifier.sff_name = nsr_vnfr.name
-
- vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
- self._log.debug(" Received VNFR is %s", vnfr)
- while vnfr.operational_status != 'running':
- self._log.info("Received vnf op status is %s; retrying",vnfr.operational_status)
- if vnfr.operational_status == 'failed':
- self._log.error("Fetching VNFR for %s failed", vnfr.id)
- raise NsrInstantiationFailed("Failed NS %s instantiation due to VNFR %s failure" % (self.id, vnfr.id))
- yield from asyncio.sleep(2, loop=self._loop)
- vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
- self._log.debug("Received VNFR is %s", vnfr)
-
- for cp in vnfr.connection_point:
- if cp.name == vnffgr_classifier.vnfr_connection_point_ref:
- vnffgr_classifier.port_id = cp.connection_point_id
- vnffgr_classifier.ip_address = cp.ip_address
- for vdu in vnfr.vdur:
- for ext_intf in vdu.external_interface:
- if ext_intf.name == vnffgr_classifier.vnfr_connection_point_ref:
- vnffgr_classifier.vm_id = vdu.vim_id
- self._log.debug("VIM ID for CP %s in VNFR %s is %s",cp.name,nsr_vnfr.id,
- vnfr_cp_ref.connection_point_params.vm_id)
- break
+ if (nsr_vnfr.vnfd.id == vnffgd_classifier.vnfd_id_ref and
+ nsr_vnfr.member_vnf_index == vnffgd_classifier.member_vnf_index_ref):
+ vnffgr_classifier.vnfr_id_ref = nsr_vnfr.id
+ vnffgr_classifier.vnfr_name_ref = nsr_vnfr.name
+ vnffgr_classifier.vnfr_connection_point_ref = vnffgd_classifier.vnfd_connection_point_ref
+
+ if nsr_vnfr.vnfd.service_function_chain == 'CLASSIFIER':
+ vnffgr_classifier.sff_name = nsr_vnfr.name
+
+ vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
+ self._log.debug(" Received VNFR is %s", vnfr)
+ while vnfr.operational_status != 'running':
+ self._log.info("Received vnf op status is %s; retrying",vnfr.operational_status)
+ if vnfr.operational_status == 'failed':
+ self._log.error("Fetching VNFR for %s failed", vnfr.id)
+ raise NsrInstantiationFailed("Failed NS %s instantiation due to VNFR %s failure" % (self.id, vnfr.id))
+ yield from asyncio.sleep(2, loop=self._loop)
+ vnfr = yield from self._nsr.fetch_vnfr(nsr_vnfr.xpath)
+ self._log.debug("Received VNFR is %s", vnfr)
+
+ for cp in vnfr.connection_point:
+ if cp.name == vnffgr_classifier.vnfr_connection_point_ref:
+ vnffgr_classifier.port_id = cp.connection_point_id
+ vnffgr_classifier.ip_address = cp.ip_address
+ for vdu in vnfr.vdur:
+ for ext_intf in vdu.external_interface:
+ if ext_intf.name == vnffgr_classifier.vnfr_connection_point_ref:
+ vnffgr_classifier.vm_id = vdu.vim_id
+ self._log.debug("VIM ID for CP %s in VNFR %s is %s",cp.name,nsr_vnfr.id,
+ vnfr_cp_ref.connection_point_params.vm_id)
+ break
- cloud_account_name, om_datacenter_name, nsr_id, group_name, group_instance_id,
- placement_groups, restart_mode=False):
+ cloud_account_name, om_datacenter_name, nsr_id, group_name, group_instance_id,
+ placement_groups, restart_mode=False):
- "id": self.id,
- "nsr_id_ref": self._nsr_id,
- "name": self.name,
- "cloud_account": self._cloud_account_name,
- "om_datacenter": self._om_datacenter_name,
- "config_status": self.config_status
- }
+ "id": self.id,
+ "nsr_id_ref": self._nsr_id,
+ "name": self.name,
+ "cloud_account": self._cloud_account_name,
+ "om_datacenter": self._om_datacenter_name,
+ "config_status": self.config_status
+ }
- loop=self._loop,
- host=NsrRpcDtsHandler.NETCONF_IP_ADDRESS,
- port=NsrRpcDtsHandler.NETCONF_PORT,
- username=NsrRpcDtsHandler.NETCONF_USER,
- password=NsrRpcDtsHandler.NETCONF_PW,
- allow_agent=False,
- look_for_keys=False,
- hostkey_verify=False,
- )
+ loop=self._loop,
+ host=NsrRpcDtsHandler.NETCONF_IP_ADDRESS,
+ port=NsrRpcDtsHandler.NETCONF_PORT,
+ username=NsrRpcDtsHandler.NETCONF_USER,
+ password=NsrRpcDtsHandler.NETCONF_PW,
+ allow_agent=False,
+ look_for_keys=False,
+ hostkey_verify=False,
+ )
- # Opdata based calls, disabled for now!
- # if action == ScalingRpcHandler.ACTION.SCALE_OUT:
- # self.scale_nsr_out(
- # msg.nsr_id_ref,
- # msg.scaling_group_name_ref,
- # msg.instance_id,
- # xact)
- # else:
- # self.scale_nsr_in(
- # msg.nsr_id_ref,
- # msg.scaling_group_name_ref,
- # msg.instance_id)
+ # Opdata based calls, disabled for now!
+ # if action == ScalingRpcHandler.ACTION.SCALE_OUT:
+ # self.scale_nsr_out(
+ # msg.nsr_id_ref,
+ # msg.scaling_group_name_ref,
+ # msg.instance_id,
+ # xact)
+ # else:
+ # self.scale_nsr_in(
+ # msg.nsr_id_ref,
+ # msg.scaling_group_name_ref,
+ # msg.instance_id)
- self._dts,
- self.log,
- self.loop,
- self._nsr_pub_handler,
- self._vnfr_pub_handler,
- self._vlr_pub_handler,
- self._ro_plugin_selector,
- self._vnffgmgr,
- self._vnfd_pub_handler,
- self._cloud_account_handler
- )
+ self._dts,
+ self.log,
+ self.loop,
+ self._nsr_pub_handler,
+ self._vnfr_pub_handler,
+ self._vlr_pub_handler,
+ self._ro_plugin_selector,
+ self._vnffgmgr,
+ self._vnfd_pub_handler,
+ self._cloud_account_handler
+ )