From e86425b7170abd3417440a7702b9f9ff64332a17 Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Wed, 15 Feb 2012 19:05:44 +0530 Subject: [PATCH] bug 13722: When we try to create a network when there is no capacity in F5, we should not attempt to create the network Reviewed-By:Jana status 13722: resolved fixed thorwing resource unavaiable exception when there is not enough capacity to implement network --- .../cloud/network/element/F5ExternalLoadBalancerElement.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java b/server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java index 2a18f9cc0db..676f2b53c8a 100644 --- a/server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java +++ b/server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java @@ -41,6 +41,7 @@ import com.cloud.api.response.F5LoadBalancerResponse; import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.dao.ConfigurationDao; +import com.cloud.dc.DataCenter; import com.cloud.dc.DataCenterVO; import com.cloud.dc.dao.DataCenterDao; import com.cloud.deploy.DeployDestination; @@ -138,9 +139,7 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan try { return manageGuestNetworkWithExternalLoadBalancer(true, guestConfig); } catch (InsufficientCapacityException capacityException) { - // TODO: handle out of capacity exception in graceful manner when multiple providers are avaialble for the -// network - return false; + throw new ResourceUnavailableException("There are no F5 load balancer devices with the free capacity for implementing this network", DataCenter.class, guestConfig.getDataCenterId()); } }