Skip to content

Commit 4b728ab

Browse files
Murali reddyMurali reddy
authored andcommitted
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
1 parent a338fe5 commit 4b728ab

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import com.cloud.configuration.Config;
4242
import com.cloud.configuration.ConfigurationManager;
4343
import com.cloud.configuration.dao.ConfigurationDao;
44+
import com.cloud.dc.DataCenter;
4445
import com.cloud.dc.DataCenterVO;
4546
import com.cloud.dc.dao.DataCenterDao;
4647
import com.cloud.deploy.DeployDestination;
@@ -138,9 +139,7 @@ public boolean implement(Network guestConfig, NetworkOffering offering, DeployDe
138139
try {
139140
return manageGuestNetworkWithExternalLoadBalancer(true, guestConfig);
140141
} catch (InsufficientCapacityException capacityException) {
141-
// TODO: handle out of capacity exception in graceful manner when multiple providers are avaialble for the
142-
// network
143-
return false;
142+
throw new ResourceUnavailableException("There are no F5 load balancer devices with the free capacity for implementing this network", DataCenter.class, guestConfig.getDataCenterId());
144143
}
145144
}
146145

0 commit comments

Comments
 (0)