From 4ce2bf2f89708e59f488d3f6cef8735ba34d8a83 Mon Sep 17 00:00:00 2001 From: alena Date: Wed, 2 Nov 2011 11:52:23 -0700 Subject: [PATCH] SourceNat service is supported for Isolated network offerings only --- .../com/cloud/configuration/ConfigurationManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 9e718a81746..6afbdae8906 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2866,6 +2866,9 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura } if (cmd.getSourceNatService()) { + if (guestType == GuestType.Shared) { + throw new InvalidParameterValueException("Source nat service is is not supported for network offerings with guest ip type " + GuestType.Shared); + } serviceProviderMap.put(Network.Service.SourceNat, defaultProviders); } @@ -3176,6 +3179,9 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura } if (cmd.getSourceNatService()) { + if (offering.getGuestType() == GuestType.Shared) { + throw new InvalidParameterValueException("Source nat service is is not supported for network offerings with guest ip type " + GuestType.Shared); + } serviceProviderMap.put(Network.Service.SourceNat, defaultProviders); }