InternalLB: don't allow to upgrade the network from the network offering with internal LB to the offering with public LB, and vice versa

This commit is contained in:
Alena Prokharchyk 2013-05-01 13:53:20 -07:00
parent c773d204c8
commit 2e8e2f98f5
1 changed files with 8 additions and 0 deletions

View File

@ -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);
}