summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Haibin <haibin.huang@intel.com>2018-03-20 00:48:11 +0800
committerHuang Haibin <haibin.huang@intel.com>2018-03-20 00:53:10 +0800
commit020650684672fdbb992a9256695aaf36205fd4f3 (patch)
treee0dd997a973ba694ea50cafb791026ccd8b54986
parent857eb04a16c285509ceefb41c3b38c5433601d2e (diff)
update numa of HPA to support AAI schema
Change-Id: Icd69cf6f002e1d0d0e0998a47b7a440586cdf78c Issue-ID: MULTICLOUD-190 Signed-off-by: Huang Haibin <haibin.huang@intel.com>
-rw-r--r--ocata/ocata/registration/views/registration.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/ocata/ocata/registration/views/registration.py b/ocata/ocata/registration/views/registration.py
index 4707b928..03922445 100644
--- a/ocata/ocata/registration/views/registration.py
+++ b/ocata/ocata/registration/views/registration.py
@@ -125,6 +125,31 @@ class Registry(newton_registration.Registry):
hpa_caps.append("]")
hpa_caps.append("},")
+ elif (flavor['name'].find('onap.numa') != -1):
+ hpa_caps.append("{'hpaCapabilityID': '" + str(uuid4) + "', ")
+ hpa_caps.append("'hpaFeature': 'numa', ")
+ hpa_caps.append("'hardwareArchitecture': 'generic', ")
+ hpa_caps.append("'version': 'v1', ")
+
+ if len(properties):
+ flavor_info['flavor-properties'] = flavor['properties']
+ hpa_caps.append("[")
+ for p in range(len(properties)):
+ p_arr = properties[p].split('=')
+ value = p_arr[1]
+ index = p_arr[0].split('.')[1]
+ if (properties[p].find("hw:numa_nodes") != -1) :
+ hpa_caps.append("{'hpa-attribute-key':'numNodes', ")
+ hpa_caps.append("'hpa-attribute-value': {'value':'" + value + "'}}, ")
+ if (properties[p].find("hw:numa_cpus") != -1) :
+ hpa_caps.append("{'hpa-attribute-key':'numaCpus-" + index + "', ")
+ hpa_caps.append("'hpa-attribute-value': {'value':'[" + value + "]'}}, ")
+ if (properties[p] == ("hw:numa_mem") != -1) :
+ hpa_caps.append("{'hpa-attribute-key':'numaMem-"+ index +"', ")
+ hpa_caps.append("'hpa-attribute-value': {'value':'" + value + ", unit:'MB'}}, ")
+ hpa_caps.append("]")
+ hpa_caps.append("},")
+
else:
self._logger.info("can not support this flavor type")
hpa_caps.append("]")