From ca8d1b70240c0f178aeb16b72c725241a51578b6 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Wed, 21 Jun 2017 09:16:14 +0300 Subject: [PATCH] NSX|v: disable service insertion if no driver configured When the service insertion service plugin is configured without the nsx driver port creation (and instances deployment) are failing because there is no service insertion security group. This patch make sure the nsx plugin knows the service insertion is disabled in this case. Depends-on: I4e7027cd456d7b16bb0c6136d9a556ad11246219 Change-Id: Idd7d4ccd1d7af8a6852803db00a3507f20d5f5a4 --- vmware_nsx/services/flowclassifier/nsx_v/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/services/flowclassifier/nsx_v/utils.py b/vmware_nsx/services/flowclassifier/nsx_v/utils.py index 3395a1dda1..ff9ecdbd68 100644 --- a/vmware_nsx/services/flowclassifier/nsx_v/utils.py +++ b/vmware_nsx/services/flowclassifier/nsx_v/utils.py @@ -38,8 +38,15 @@ class NsxvServiceInsertionHandler(object): self._enabled = False self._sg_id = None if self.is_service_insertion_enabled(): - self._enabled = True self._sg_id = self.get_service_inserion_sg_id() + if not self._sg_id: + # failed to create the security group or the driver + # was not configured + LOG.error("Failed to enable service insertion. " + "Security group not found.") + self._enabled = False + else: + self._enabled = True self._initialized = True def is_service_insertion_enabled(self):