You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2014/12/05 08:26:06 UTC
git commit: updated refs/heads/4.5 to 2d7f0c6
Repository: cloudstack
Updated Branches:
refs/heads/4.5 d5370a95d -> 2d7f0c693
CLOUDSTACK-8027: Update error msg for enable static nat
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2d7f0c69
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2d7f0c69
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2d7f0c69
Branch: refs/heads/4.5
Commit: 2d7f0c693b9a04af0f578b597b088e518dce220d
Parents: d5370a9
Author: Jayapal <ja...@apache.org>
Authored: Fri Dec 5 12:15:36 2014 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Fri Dec 5 12:55:41 2014 +0530
----------------------------------------------------------------------
.../src/com/cloud/network/rules/RulesManagerImpl.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2d7f0c69/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java
index 56a075d..bffc41d 100755
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@ -647,8 +647,10 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
if (oldIP != null) {
// If elasticIP functionality is supported in the network, we always have to disable static nat on the old
-// ip in order to re-enable it on the new one
+ // ip in order to re-enable it on the new one
Long networkId = oldIP.getAssociatedWithNetworkId();
+ VMInstanceVO vm = _vmInstanceDao.findById(vmId);
+
boolean reassignStaticNat = false;
if (networkId != null) {
Network guestNetwork = _networkModel.getNetwork(networkId);
@@ -660,13 +662,16 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
// If there is public ip address already associated with the vm, throw an exception
if (!reassignStaticNat) {
- throw new InvalidParameterValueException("Failed to enable static nat for the ip address id=" + ipAddress.getId() + " as vm id=" + vmId +
- " is already associated with ip id=" + oldIP.getId());
+ throw new InvalidParameterValueException("Failed to enable static nat on the ip " +
+ ipAddress.getAddress()+" with Id " +ipAddress.getUuid()+" as the vm " +vm.getInstanceName() + " with Id " +
+ vm.getUuid() +" is already associated with another public ip " + oldIP.getAddress() +" with id "+
+ oldIP.getUuid());
}
// unassign old static nat rule
s_logger.debug("Disassociating static nat for ip " + oldIP);
if (!disableStaticNat(oldIP.getId(), caller, callerUserId, true)) {
- throw new CloudRuntimeException("Failed to disable old static nat rule for vm id=" + vmId + " and ip " + oldIP);
+ throw new CloudRuntimeException("Failed to disable old static nat rule for vm "+ vm.getInstanceName() +
+ " with id "+vm.getUuid() +" and public ip " + oldIP);
}
}
}