diff options
author | Yun Huang <yun.huang@windriver.com> | 2018-03-28 15:21:54 +0800 |
---|---|---|
committer | Yun Huang <yun.huang@windriver.com> | 2018-03-28 15:21:54 +0800 |
commit | 2edb336618baca000c06e6951b8bb1e118e8dd01 (patch) | |
tree | c7aa990ce41b8c83d019b69a80d222164b81dad9 | |
parent | bfeb9185defd85249f195821af76360d706f8644 (diff) |
Add HPA ovsdpdk capabilities for TC
Change-Id: I233d3bd05b96795eae95bbb3475195ffe19f0e2e
Issue-ID: MULTICLOUD-200
Signed-off-by: Yun Huang <yun.huang@windriver.com>
-rw-r--r-- | windriver/titanium_cloud/registration/views/registration.py | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/windriver/titanium_cloud/registration/views/registration.py b/windriver/titanium_cloud/registration/views/registration.py index 769040ff..b3b2f006 100644 --- a/windriver/titanium_cloud/registration/views/registration.py +++ b/windriver/titanium_cloud/registration/views/registration.py @@ -59,11 +59,12 @@ class Registry(newton_registration.Registry): flavor_info['flavor-selflink'] = 'http://0.0.0.0', # add hpa capabilities - req_resouce = "/flavors/%s/os-extra_specs" % flavor['id'] - extraResp = self._get_list_resources(req_resouce, "compute", session, viminfo, vimid, "extra_specs") + if (flavor['name'].find('onap.') == 0): + req_resouce = "/flavors/%s/os-extra_specs" % flavor['id'] + extraResp = self._get_list_resources(req_resouce, "compute", session, viminfo, vimid, "extra_specs") - hpa_capabilities = self._get_hpa_capabilities(flavor, extraResp) - flavor_info['hpa_capabilities'] = hpa_capabilities + hpa_capabilities = self._get_hpa_capabilities(flavor, extraResp) + flavor_info['hpa_capabilities'] = hpa_capabilities self._update_resoure( cloud_owner, cloud_region_id, flavor['id'], @@ -129,7 +130,13 @@ class Registry(newton_registration.Registry): if len(caps_dict) > 0: self._logger.debug("pci_passthrough_capabilities_info: %s" % caps_dict) hpa_caps.append(caps_dict) - + + # ovsdpdk capabilities + caps_dict = self._get_ovsdpdk_capabilities(extra_specs) + if len(caps_dict) > 0: + self._logger.debug("ovsdpdk_capabilities_info: %s" % caps_dict) + hpa_caps.append(caps_dict) + return hpa_caps def _get_hpa_basic_capabilities(self, flavor): @@ -291,3 +298,17 @@ class Registry(newton_registration.Registry): 'hpa-attribute-value':{'value': str(value2[4])}}) return instruction_capability + + def _get_ovsdpdk_capabilities(self, extra_specs): + instruction_capability = {} + feature_uuid = uuid.uuid4() + + instruction_capability['hpaCapabilityID'] = str(feature_uuid) + instruction_capability['hpaFeature'] = 'ovsDpdk' + instruction_capability['hardwareArchitecture'] = 'Intel64' + instruction_capability['version'] = 'v1' + + instruction_capability['attributes'] = [] + instruction_capability['attributes'].append({'hpa-attribute-key': 'dataProcessingAccelerationLibrary', + 'hpa-attribute-value':{'value': str('v17.02')}}) + return instruction_capability |