From 69d6b86f56cff0af76edc30fd01148e79fdd688a Mon Sep 17 00:00:00 2001 From: Bence Romsics Date: Tue, 24 Jul 2018 15:13:15 +0200 Subject: [PATCH] ovs/sriov mech drivers: resource_provider_uuid5_namespace Set a UUID v5 namespace for the Open vSwitch mechanism driver and another for the SR-IOV mechanism driver. These will be used to deterministically generate Placement Resource Provider UUIDs. Change-Id: I365a0aeefffe68bd7d5ba5f6697b814bf2713a19 Depends-On: https://review.openstack.org/586567 Partial-Bug: #1578989 See-Also: https://review.openstack.org/502306 (nova spec) See-Also: https://review.openstack.org/508149 (neutron spec) --- .../ml2/drivers/mech_sriov/mech_driver/mech_driver.py | 5 +++++ .../ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py b/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py index 77ecb00bb17..14d718375b8 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import uuid + from neutron_lib.api.definitions import portbindings from neutron_lib import constants from neutron_lib.plugins.ml2 import api @@ -41,6 +43,9 @@ class SriovNicSwitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase): L2 Agent presents in order to manage port update events. """ + resource_provider_uuid5_namespace = uuid.UUID( + '87f1895c-73bb-11e8-9008-c4d987b2a692') + def __init__(self, agent_type=constants.AGENT_TYPE_NIC_SWITCH, vif_details={portbindings.CAP_PORT_FILTER: False}, diff --git a/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py b/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py index 8d67ca2ffd6..e024ad7dd94 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py +++ b/neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py @@ -14,6 +14,7 @@ # under the License. import os +import uuid from neutron_lib.api.definitions import portbindings from neutron_lib.callbacks import events @@ -48,6 +49,9 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase): network. """ + resource_provider_uuid5_namespace = uuid.UUID( + '87ee7d5c-73bb-11e8-9008-c4d987b2a692') + def __init__(self): sg_enabled = securitygroups_rpc.is_firewall_enabled() hybrid_plug_required = (not cfg.CONF.SECURITYGROUP.firewall_driver or