+ for device in new_flavor_dict.get('extended', {}).get('devices', ()):
+ if 'image name' in device:
+ del device['image name']
+ numas = new_flavor_dict.get('extended', {}).get('numas')
+ if numas:
+ numa = numas[0]
+ # translate memory, cpus to EPA
+ if "cores" not in numa and "threads" not in numa and "paired-threads" not in numa:
+ numa["paired-threads"] = new_flavor_dict["vcpus"]
+ if "memory" not in numa:
+ numa["memory"] = int(math.ceil(new_flavor_dict["ram"]/1024.0))
+ for iface in numa.get("interfaces", ()):
+ if not iface.get("bandwidth"):
+ iface["bandwidth"] = "1 Mbps"
+