summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Popovych <popovych.andrey@gmail.com>2016-08-08 14:46:38 +0300
committerAndriy Popovych <popovych.andrey@gmail.com>2016-08-08 14:52:22 +0300
commit7531f8d65aa432a4cbf0d950b2b0fef982ddade7 (patch)
tree3a28071705292455b9ae7f07a806d51abe61a053
parentb8254231a14f8a54bb8a27de41d3a8296870755f (diff)
Add support for NIC attributes
Provide support for SR-IOV and DPDK through new API version for NICs. Change-Id: I1a927c0e7333a422f94dd2937638f8d2ca38512f Implements: blueprint nics-and-nodes-attributes-via-plugin
Notes
Notes (review): Code-Review+1: Artem Panchenko <apanchenko@mirantis.com> Code-Review+1: Artem Roma <aroma@mirantis.com> Code-Review+2: Nastya Urlapova <aurlapova@mirantis.com> Verified-1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+2: tatyana-leontovich <tleontovich@mirantis.com> Workflow+1: Nastya Urlapova <aurlapova@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 11 Aug 2016 08:57:23 +0000 Reviewed-on: https://review.openstack.org/352375 Project: openstack/fuel-ostf Branch: refs/heads/master
-rw-r--r--fuel_health/config.py37
-rw-r--r--fuel_plugin/ostf_adapter/mixins.py23
2 files changed, 44 insertions, 16 deletions
diff --git a/fuel_health/config.py b/fuel_health/config.py
index b81b558..214cda4 100644
--- a/fuel_health/config.py
+++ b/fuel_health/config.py
@@ -752,10 +752,18 @@ class NailgunConfig(object):
752 ifaces_resp = self.req_session.get( 752 ifaces_resp = self.req_session.get(
753 self.nailgun_url + api_url).json() 753 self.nailgun_url + api_url).json()
754 for iface in ifaces_resp: 754 for iface in ifaces_resp:
755 if ('sriov' in iface['interface_properties'] and 755 if 'interface_properties' in iface:
756 iface['interface_properties']['sriov']['enabled']): 756 if ('sriov' in iface['interface_properties'] and
757 sriov_physnets.append( 757 iface['interface_properties'][
758 iface['interface_properties']['sriov']['physnet']) 758 'sriov']['enabled']):
759 sriov_physnets.append(
760 iface['interface_properties']['sriov']['physnet'])
761 else:
762 if ('sriov' in iface['attributes'] and
763 iface['attributes']['sriov']['enabled']['value']):
764 sriov_physnets.append(
765 iface['attributes']['sriov']['physnet']['value'])
766
759 self.compute.sriov_physnets = sriov_physnets 767 self.compute.sriov_physnets = sriov_physnets
760 768
761 # Find first compute with enabled DPDK 769 # Find first compute with enabled DPDK
@@ -764,11 +772,22 @@ class NailgunConfig(object):
764 ifaces_resp = self.req_session.get( 772 ifaces_resp = self.req_session.get(
765 self.nailgun_url + api_url).json() 773 self.nailgun_url + api_url).json()
766 for iface in ifaces_resp: 774 for iface in ifaces_resp:
767 if 'dpdk' in iface['interface_properties']: 775 if 'interface_properties' in iface:
768 if 'enabled' in iface['interface_properties']['dpdk']: 776 if 'dpdk' in iface['interface_properties']:
769 if iface['interface_properties']['dpdk']['enabled']: 777 if 'enabled' in iface['interface_properties']['dpdk']:
770 self.compute.dpdk_compute_fqdn = compute['fqdn'] 778 if iface['interface_properties'][
771 break 779 'dpdk']['enabled']:
780 self.compute.dpdk_compute_fqdn = compute[
781 'fqdn']
782 break
783 else:
784 if 'dpdk' in iface['attributes']:
785 if 'enabled' in iface['attributes']['dpdk']:
786 if iface['attributes']['dpdk'][
787 'enabled']['value']:
788 self.compute.dpdk_compute_fqdn = compute[
789 'fqdn']
790 break
772 791
773 self.compute.compute_nodes = compute_ips 792 self.compute.compute_nodes = compute_ips
774 ceph_nodes = filter(lambda node: 'ceph-osd' in node['roles'], 793 ceph_nodes = filter(lambda node: 'ceph-osd' in node['roles'],
diff --git a/fuel_plugin/ostf_adapter/mixins.py b/fuel_plugin/ostf_adapter/mixins.py
index 16d0f17..7da8e50 100644
--- a/fuel_plugin/ostf_adapter/mixins.py
+++ b/fuel_plugin/ostf_adapter/mixins.py
@@ -168,13 +168,22 @@ def _get_cluster_attrs(cluster_id, token=None):
168 'api/nodes/{id}/interfaces'.format(id=compute_id)) 168 'api/nodes/{id}/interfaces'.format(id=compute_id))
169 ifaces_resp = REQ_SES.get(ifaces_url).json() 169 ifaces_resp = REQ_SES.get(ifaces_url).json()
170 for iface in ifaces_resp: 170 for iface in ifaces_resp:
171 if ('sriov' in iface['interface_properties'] and 171 if 'interface_properties' in iface:
172 iface['interface_properties']['sriov']['enabled']): 172 if ('sriov' in iface['interface_properties'] and
173 sriov_compute_ids.append(compute_id) 173 iface['interface_properties']['sriov']['enabled']):
174 if 'dpdk' in iface['interface_properties']: 174 sriov_compute_ids.append(compute_id)
175 if 'enabled' in iface['interface_properties']['dpdk']: 175 if 'dpdk' in iface['interface_properties']:
176 if iface['interface_properties']['dpdk']['enabled']: 176 if 'enabled' in iface['interface_properties']['dpdk']:
177 dpdk_compute_ids.append(compute_id) 177 if iface['interface_properties']['dpdk']['enabled']:
178 dpdk_compute_ids.append(compute_id)
179 else:
180 if ('sriov' in iface['attributes'] and
181 iface['attributes']['sriov']['enabled']['value']):
182 sriov_compute_ids.append(compute_id)
183 if 'dpdk' in iface['attributes']:
184 if 'enabled' in iface['attributes']['dpdk']:
185 if iface['attributes']['dpdk']['enabled']['value']:
186 dpdk_compute_ids.append(compute_id)
178 187
179 deployment_tags = set() 188 deployment_tags = set()
180 189