From c788def174ac06a0a3529901d2498d0baae3ba9a Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Tue, 20 Dec 2016 11:58:18 +0200 Subject: [PATCH] NSX|V Fix router resize for older NSX versions For NSX 6.2.2 there is a need to remove some of the fields from the edge configuration before POSTing the size update, or else the backend will fail. (Removing those fields on more advanced NSX versions will fail) Change-Id: I0e938738b617ce333c3f7ea2965e2f82ad9c7dd9 --- vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py b/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py index 819b9458f9..f5c120257c 100644 --- a/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from distutils import version import time from neutron.plugins.common import constants as plugin_const @@ -510,6 +511,11 @@ class EdgeApplianceDriver(object): LOG.debug('Edge %s is already with size %s', edge_id, size) return + ver = self.vcns.get_version() + if version.LooseVersion(ver) < version.LooseVersion('6.2.3'): + # remove some data that will make the update fail + edge_utils.remove_irrelevant_keys_from_edge_request(edge) + # set the new size in the request edge['appliances']['applianceSize'] = size # update the edge