try:
flavor_vim_id = None
flavor_vim_id=vim.get_flavor_id_from_data(flavor_dict)
- flavor_create="false"
+ flavor_created="false"
except vimconn.vimconnException as e:
pass
try:
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:
for sce_vnf in instanceDict['vnfs']:
for vm in sce_vnf['vms']:
if vm["uuid"] == vdu_id:
+ # TODO revise this should not be vm["uuid"] instance_vms["vm_id"]
vm_interfaces = vm["interfaces"]
break
"status": "SCHEDULED",
"item": "instance_vms",
"item_id": vdu_id,
- "related": vm["related"],
+ "related": target_vm["related"],
"extra": yaml.safe_dump({"params": vm_interfaces},
default_flow_style=True, width=256)
}
pass
db_instance_vm = {
"uuid": vm_uuid,
+ 'related': vm_uuid,
'instance_vnf_id': target_vm['instance_vnf_id'],
'vm_id': target_vm['vm_id'],
- 'vim_name': vm_name
+ 'vim_name': vm_name,
}
db_instance_vms.append(db_instance_vm)
"status": "SCHEDULED",
"item": "instance_vms",
"item_id": vm_uuid,
- "related": target_vm["related"],
+ "related": vm_uuid,
# ALF
# ALF
# TODO examinar parametros, quitar MAC o incrementar. Incrementar IP y colocar las dependencias con ACTION-asdfasd.
#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