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
This commit is contained in:
Adit Sarfaty 2016-12-20 11:58:18 +02:00
parent 793a87b1b6
commit c788def174

View File

@ -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