- def check_res_status(self):
- logger.info("[NF instantiation] confirm all vms are active start")
- vnfcs = self.create_res_result['resource_result']['affectedvnfc']
- for vnfc in vnfcs:
- if 'success' != vnfc['status']:
- logger.error("VNFC_STATUS_IS_NOT_ACTIVE[vduid=%s]" % vnfc['vduId'])
- raise NFLCMException(msgid="VNFC_STATUS_IS_NOT_ACTIVE[vduid=%s]", args=vnfc['vduId'])
-
- JobUtil.add_job_status(self.job_id, 80, 'SAVE_VNFC_TO_DB')
- vls = self.create_res_result['resource_result']['affectedvirtuallink']
- cps = self.create_res_result['resource_result']['affectedcp']
+ # def check_res_status(self):
+ # logger.info("[NF instantiation] confirm all vms are active start")
+ # vnfcs = self.create_res_result['resource_result']['affectedvnfc']
+ # for vnfc in vnfcs:
+ # if 'success' != vnfc['status']:
+ # logger.error("VNFC_STATUS_IS_NOT_ACTIVE[vduid=%s]" % vnfc['vduId'])
+ # raise NFLCMException(msgid="VNFC_STATUS_IS_NOT_ACTIVE[vduid=%s]", args=vnfc['vduId'])
+ #
+ # JobUtil.add_job_status(self.job_id, 80, 'SAVE_VNFC_TO_DB')
+ # vls = self.create_res_result['resource_result']['affectedvirtuallink']
+ # cps = self.create_res_result['resource_result']['affectedcp']
+ #
+ # for vnfc in vnfcs:
+ # if 'failed' == vnfc['status']:
+ # continue
+ # compute_resource = vnfc['computeresource']
+ # vminst = VmInstModel.objects.filter(resouceid=compute_resource['resourceid']).first()
+ # VNFCInstModel.objects.create(
+ # vnfcinstanceid=vnfc['vnfcinstanceid'],
+ # vduid=vnfc['vduid'],
+ # vdutype=vnfc['vdutype'],
+ # nfinstid=self.nf_inst_id,
+ # vmid=vminst.vmid)
+ # for vl in vls:
+ # if 'failed' == vl['status']:
+ # continue
+ # network_resource = vl['networkresource']
+ # subnet_resource = vl['subnetworkresource']
+ # networkinst = NetworkInstModel.objects.filter(resouceid=network_resource['resourceid']).first()
+ # subnetinst = SubNetworkInstModel.objects.filter(resouceid=subnet_resource['resourceid']).first()
+ # VLInstModel.objects.create(
+ # vlinstanceid=vl['virtuallinkinstanceid'],
+ # vldid=vl['virtuallinkdescid'],
+ # ownertype='0',
+ # ownerid=self.nf_inst_id,
+ # relatednetworkid=networkinst.networkid,
+ # relatedsubnetworkid=subnetinst.subnetworkid)
+ # # # for vs in vss:
+ # for cp in cps:
+ # if 'failed' == cp['status']:
+ # continue
+ # port_resource = cp['portresource']
+ # portinst = PortInstModel.objects.filter(resouceid=port_resource['resourceid']).first()
+ # ttt = portinst.portid
+ # CPInstModel.objects.create(
+ # cpinstanceid=cp['cpinstanceid'],
+ # cpdid=cp['cpdid'],
+ # relatedtype='2',
+ # relatedport=portinst.portid,
+ # ownertype=cp['ownertype'],
+ # ownerid=cp['ownerid'],
+ # vlinstanceid=cp['virtuallinkinstanceid'])
+ # # self.add_job(43, 'INST_DPLY_VM_PRGS')
+ # logger.info("[NF instantiation] confirm all vms are active end")