bug 13305: don't allow to create ip forwarding rules when elasticIP is enabled for the network offering

status 13305: resolved fixed

Reviewed-by: Will Chan
This commit is contained in:
Alena Prokharchyk 2012-01-25 09:56:58 -08:00
parent 88d3f1ba03
commit 7ea3c8933d
1 changed files with 6 additions and 0 deletions

View File

@ -272,6 +272,12 @@ public class RulesManagerImpl implements RulesManager, RulesService, Manager {
Long domainId = ipAddress.getAllocatedInDomainId();
_networkMgr.checkIpForService(ipAddress, Service.StaticNat);
Network network = _networkMgr.getNetwork(networkId);
NetworkOffering off = _configMgr.getNetworkOffering(network.getNetworkOfferingId());
if (off.getElasticIp()) {
throw new InvalidParameterValueException("Can't create ip forwarding rules for the network where elasticIP service is enabled");
}
String dstIp = _networkMgr.getIpInNetwork(ipAddress.getAssociatedWithVmId(), networkId);