X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fnfvo.py;h=0782023c2547c962fca66f96f469c78386c4bf27;hb=refs%2Fheads%2Fv6.0;hp=15f04d6e73e7d475fa719753be3eaae96cf6b22f;hpb=b7aa1bb3eaee2b986d3e192a4e3980c2fb1446b9;p=osm%2FRO.git diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index 15f04d6e..0782023c 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -1282,13 +1282,21 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): numa["threads"] = max(db_flavor["vcpus"], 1) epa_vcpu_set = True if vdu["guest-epa"].get("cpu-quota") and not epa_vcpu_set: - extended["cpu-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("cpu-quota")) + cpuquota = get_resource_allocation_params(vdu["guest-epa"].get("cpu-quota")) + if cpuquota: + extended["cpu-quota"] = cpuquota if vdu["guest-epa"].get("mem-quota"): - extended["mem-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("mem-quota")) + vduquota = get_resource_allocation_params(vdu["guest-epa"].get("mem-quota")) + if vduquota: + extended["mem-quota"] = vduquota if vdu["guest-epa"].get("disk-io-quota"): - extended["disk-io-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("disk-io-quota")) + diskioquota = get_resource_allocation_params(vdu["guest-epa"].get("disk-io-quota")) + if diskioquota: + extended["disk-io-quota"] = diskioquota if vdu["guest-epa"].get("vif-quota"): - extended["vif-quota"] = get_resource_allocation_params(vdu["guest-epa"].get("vif-quota")) + vifquota = get_resource_allocation_params(vdu["guest-epa"].get("vif-quota")) + if vifquota: + extended["vif-quota"] = vifquota if numa: extended["numas"] = [numa] if extended: @@ -5181,7 +5189,13 @@ def datacenter_action(mydb, tenant_id, datacenter, action_dict): #get datacenter info datacenter_id, myvim = get_datacenter_by_name_uuid(mydb, tenant_id, datacenter) - if 'net-update' in action_dict: + if 'check-connectivity' in action_dict: + try: + myvim.check_vim_connectivity() + except vimconn.vimconnException as e: + #logger.error("nfvo.datacenter_action() Not possible to get_network_list from VIM: %s ", str(e)) + raise NfvoException(str(e), e.http_code) + elif 'net-update' in action_dict: try: nets = myvim.get_network_list(filter_dict={'shared': True, 'admin_state_up': True, 'status': 'ACTIVE'}) #print content