summaryrefslogtreecommitdiffstats
path: root/ocata
diff options
context:
space:
mode:
authorYun Huang <yun.huang@windriver.com>2018-04-20 14:17:09 +0800
committerYun Huang <yun.huang@windriver.com>2018-04-20 14:20:44 +0800
commit633badbc4e082f206341583fc4a95ba5f5865937 (patch)
treefd95a8695985dcce5fbba0987bb3b3f70e8c3b17 /ocata
parentafdb47f8170613bf11f8d77aa4ea9e3b40357214 (diff)
Fix HPA memorypagesize unit issue for ocata
Change-Id: I5f5d50720b0e4e81cbe22c77499c00a862d639ad Issue-ID: MULTICLOUD-206 Signed-off-by: Yun Huang <yun.huang@windriver.com>
Diffstat (limited to 'ocata')
-rw-r--r--ocata/ocata/registration/views/registration.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/ocata/ocata/registration/views/registration.py b/ocata/ocata/registration/views/registration.py
index 25ec0dbf..4dd87675 100644
--- a/ocata/ocata/registration/views/registration.py
+++ b/ocata/ocata/registration/views/registration.py
@@ -211,8 +211,21 @@ class Registry(newton_registration.Registry):
hugepages_capability['version'] = 'v1'
hugepages_capability['attributes'] = []
- hugepages_capability['attributes'].append({'hpa-attribute-key': 'memoryPageSize',
- 'hpa-attribute-value':{'value': str(extra_specs['hw:mem_page_size'])}})
+ if extra_specs['hw:mem_page_size'] == 'large':
+ hugepages_capability['attributes'].append({'hpa-attribute-key': 'memoryPageSize',
+ 'hpa-attribute-value':{'value': '2',
+ 'unit': 'MB'}})
+ elif extra_specs['hw:mem_page_size'] == 'small':
+ hugepages_capability['attributes'].append({'hpa-attribute-key': 'memoryPageSize',
+ 'hpa-attribute-value':{'value': '4',
+ 'unit': 'KB'}})
+ elif extra_specs['hw:mem_page_size'] == 'any':
+ self._logger.info("Currently HPA feature memoryPageSize did not support 'any' page!!")
+ else :
+ hugepages_capability['attributes'].append({'hpa-attribute-key': 'memoryPageSize',
+ 'hpa-attribute-value':{'value': str(extra_specs['hw:mem_page_size']),
+ 'unit': 'KB'}})
+
return hugepages_capability
def _get_numa_capabilities(self, extra_specs):