diff --git a/f5lbaasdriver/v2/bigip/plugin_rpc.py b/f5lbaasdriver/v2/bigip/plugin_rpc.py index 279942f3..3f988236 100644 --- a/f5lbaasdriver/v2/bigip/plugin_rpc.py +++ b/f5lbaasdriver/v2/bigip/plugin_rpc.py @@ -15,6 +15,8 @@ # limitations under the License. # +import uuid + from oslo_log import helpers as log_helpers from oslo_log import log as logging @@ -536,6 +538,9 @@ def create_port_on_subnet(self, context, subnet_id=None, if device_id: port_data['device_id'] = device_id + else: + port_data['device_id'] = str(uuid.uuid5( + uuid.NAMESPACE_DNS, str(host))) port_data[portbindings.HOST_ID] = host port_data[portbindings.VNIC_TYPE] = vnic_type port_data[portbindings.PROFILE] = binding_profile @@ -700,6 +705,9 @@ def create_port_on_network(self, context, network_id=None, } if device_id: port_data['device_id'] = device_id + else: + port_data['device_id'] = str(uuid.uuid5( + uuid.NAMESPACE_DNS, str(host))) port_data[portbindings.HOST_ID] = host port_data[portbindings.VNIC_TYPE] = vnic_type port_data[portbindings.PROFILE] = binding_profile