From 2e8e2f98f59eecfc37a2645bd353de7f592d8149 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 1 May 2013 13:53:20 -0700 Subject: [PATCH] InternalLB: don't allow to upgrade the network from the network offering with internal LB to the offering with public LB, and vice versa --- server/src/com/cloud/network/NetworkServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 8b775284d59..8c389043834 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -2194,6 +2194,14 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { return false; } } + + //can't update from internal LB to public LB + if (areServicesSupportedByNetworkOffering(oldNetworkOfferingId, Service.Lb) && areServicesSupportedByNetworkOffering(newNetworkOfferingId, Service.Lb)) { + if (oldNetworkOffering.getPublicLb() != newNetworkOffering.getPublicLb() || oldNetworkOffering.getInternalLb() != newNetworkOffering.getInternalLb()) { + throw new InvalidParameterValueException("Original and new offerings support different types of LB - Internal vs Public," + + " can't upgrade"); + } + } return canIpsUseOffering(publicIps, newNetworkOfferingId); }