From 7056de616f534be06abb3cdb9d87e5775535b90c Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Thu, 9 Nov 2017 11:29:39 +0800 Subject: Fix vfc-lcm hw vnfname adapt Change-Id: Iae12bb1d259e5ae8b1a693633fbaa36b5de55f7a Issue-ID: VFC-589 Signed-off-by: ying.yunlong --- lcm/ns/vnfs/create_vnfs.py | 5 +++-- lcm/workflows/build_in.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lcm/ns/vnfs/create_vnfs.py b/lcm/ns/vnfs/create_vnfs.py index 9356ed72..a2f01b3a 100644 --- a/lcm/ns/vnfs/create_vnfs.py +++ b/lcm/ns/vnfs/create_vnfs.py @@ -81,6 +81,7 @@ class CreateVnfs(Thread): if REPORT_TO_AAI: self.create_vnf_in_aai() self.create_vserver_in_aai() + JobUtil.add_job_status(self.job_id, 100, 'vnf instantiation success', 0) except NSLCMException as e: self.vnf_inst_failed_handle(e.message) except Exception: @@ -119,7 +120,8 @@ class CreateVnfs(Thread): if self.vnf_id == vnf_info['vnf_id']: self.vnfd_id = vnf_info['properties']['id'] if 'name' not in vnf_info['properties']: - self.vnf_inst_name = self.vnfd_id + str(uuid.uuid4()) + # HW vnf instance name must start with alphabet + self.vnf_inst_name = 'vnf' + self.vnfd_id + str(uuid.uuid4()) else: self.vnf_inst_name = vnf_info['properties']['name'] + str(uuid.uuid4()) self.vnf_inst_name = self.vnf_inst_name[:30] @@ -255,7 +257,6 @@ class CreateVnfs(Thread): logger.debug("save_info_to_db start") do_biz_with_share_lock("set-vnflist-in-vnffginst-%s" % self.ns_inst_id, self.save_vnf_inst_id_in_vnffg) NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(status=VNF_STATUS.ACTIVE, lastuptime=now_time()) - JobUtil.add_job_status(self.job_id, 100, 'vnf instantiation success', 0) logger.debug("save_info_to_db end") def vnf_inst_failed_handle(self, error_msg): diff --git a/lcm/workflows/build_in.py b/lcm/workflows/build_in.py index f58ec7e5..9086bc8b 100644 --- a/lcm/workflows/build_in.py +++ b/lcm/workflows/build_in.py @@ -192,7 +192,7 @@ class JobWaitThread(Thread): self.job_id = job_id self.ns_job_id = ns_job_id self.index = index - self.retry_count = 60 + self.retry_count = 600 self.interval_second = 3 def run(self): -- cgit 1.2.3-korg