Comment 1 for bug 1674896

Revision history for this message
jiangxing (jiangxing) wrote :

Should check the vnfs' status after ns_create in ns_db.create_ns_post,like this:

        vnf_status = []
        if len(output) > 0:
            for vnfd_name, vnfd_val in iteritems(vnfd_dict):
                for instance in vnfd_val['instances']:
                    if 'mgmt_url_' + instance in output:
                        mgmt_urls[instance] = ast.literal_eval(
                            output['mgmt_url_' + instance].strip())
                        vnf_ids[instance] = output['vnf_id_' + instance]
                        vnf_status.append(output["status_" + instance])
            vnf_ids = str(vnf_ids)
            mgmt_urls = str(mgmt_urls)

        if not vnf_ids:
            vnf_ids = None
        if not mgmt_urls:
            mgmt_urls = None
        status = constants.ACTIVE if mistral_obj.state == 'SUCCESS' \
            else constants.ERROR
        if vnf_status:
            if constants.ERROR in vnf_status:
                status = constants.ERROR

But how to process the vnf's status which is PENDING_CREATE should be more complex, we think need a notification from vnfm to nfvo after the vnf's ACTIVE.