You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2013/11/13 13:52:10 UTC

git commit: updated refs/heads/master to 0068da7

Updated Branches:
  refs/heads/master 52b048481 -> 0068da719


CLOUDSTACK-5142: Guest IP address for F5 is not being selected from the
defined IP Range in Shared Network

ensure that for shared network, acuqire guest ip should return IP from
the 'startip'-'endip' range of the network.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0068da71
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0068da71
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0068da71

Branch: refs/heads/master
Commit: 0068da71985b9ad5e2a5e7706bf7fd3026b5d4e8
Parents: 52b0484
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed Nov 13 18:20:10 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Wed Nov 13 18:21:55 2013 +0530

----------------------------------------------------------------------
 .../ExternalLoadBalancerDeviceManagerImpl.java       | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0068da71/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index 8d54541..3e0cd77 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -778,7 +778,20 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 String loadBalancingIpAddress = existedGuestIp;
 
                 if (loadBalancingIpAddress == null) {
-                    loadBalancingIpAddress = _ipAddrMgr.acquireGuestIpAddress(network, null);
+                    if (network.getGuestType() == Network.GuestType.Isolated) {
+                        loadBalancingIpAddress = _ipAddrMgr.acquireGuestIpAddress(network, null);
+                    } else if (network.getGuestType() == Network.GuestType.Shared) {
+                        try {
+                            PublicIp directIp = _ipAddrMgr.assignPublicIpAddress(network.getDataCenterId(),
+                                    null, _accountDao.findById(network.getAccountId()), VlanType.DirectAttached, network.getId(),
+                                    null, true);
+                            loadBalancingIpAddress = directIp.getAddress().addr();
+                        } catch (InsufficientCapacityException capException) {
+                            String msg = "Ran out of guest IP addresses from the shared network.";
+                            s_logger.error(msg);
+                            throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
+                        }
+                    }
                 }
 
                 if (loadBalancingIpAddress == null) {