Mechanism driver API: resource_provider_uuid5_namespace

A UUID v5 namespace for mechanism drivers wanting to report resource
providers to Placement.

Change-Id: I65ea084739b190b0553b63d0775baf0c27504ede
Needed-By: https://review.openstack.org/586597
Partial-Bug: #1578989
Related-Change: https://review.openstack.org/574781
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
This commit is contained in:
Bence Romsics
2018-07-24 14:58:55 +02:00
parent 579e0ccabb
commit c2e205b85a
2 changed files with 26 additions and 0 deletions

View File

@@ -55,6 +55,19 @@ class MechanismDriver(object):
methods that are part of the database transaction.
"""
# Used in generating resource provider UUIDs for physical network
# interfaces. Each mechanism driver supporting Placement should have its
# own UUID v5 namespace (which is a UUID v1 in turn). When set to a
# concrete value use a uuid.UUID() object, not the string format.
# It will be used when hashing RP UUIDs from:
# (mech driver namespace, hostname, physical bridge/interface name)
# When needed generate new namespace UUIDs by:
# python -c 'import uuid ; print uuid.uuid1()'
# See also:
# https://tools.ietf.org/html/rfc4122
# https://stackoverflow.com/a/7816117
resource_provider_uuid5_namespace = None
@abc.abstractmethod
def initialize(self):
"""Perform driver initialization.

View File

@@ -0,0 +1,13 @@
---
features:
- |
New MechanismDriver API class property:
``resource_provider_uuid5_namespace``. Mechanism drivers wanting
to support resource provider information reporting to Placement
(eg. reporting resource providers to guarantee some minimum bandwidth
allocated on them later) must set this class property to a UUID
object unique to that mechanism driver. It will be used as a UUID
v5 namespace in generating UUIDs for resource providers. The default
implementation sets it to ``None``, meaning that the mechanism driver
does not support resource provider information reporting to Placement.
Unaffected drivers need not be changed.