mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Remove AutoScale entities while deleting autoscaled loadbalancer.
This commit is contained in:
parent
aea87da410
commit
264f777a2d
@ -311,6 +311,5 @@ public class EventTypes {
|
|||||||
public static final String EVENT_AUTOSCALEVMGROUP_DELETE = "AUTOSCALEVMGROUP.DELETE";
|
public static final String EVENT_AUTOSCALEVMGROUP_DELETE = "AUTOSCALEVMGROUP.DELETE";
|
||||||
public static final String EVENT_AUTOSCALEVMGROUP_UPDATE = "AUTOSCALEVMGROUP.UPDATE";
|
public static final String EVENT_AUTOSCALEVMGROUP_UPDATE = "AUTOSCALEVMGROUP.UPDATE";
|
||||||
public static final String EVENT_AUTOSCALEVMGROUP_ENABLE = "AUTOSCALEVMGROUP.ENABLE";
|
public static final String EVENT_AUTOSCALEVMGROUP_ENABLE = "AUTOSCALEVMGROUP.ENABLE";
|
||||||
public static final String EVENT_AUTOSCALEVMGROUP_DISABLE = "AUTOSCALEVMGROUP.DIABLE";
|
public static final String EVENT_AUTOSCALEVMGROUP_DISABLE = "AUTOSCALEVMGROUP.DISABLE";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -755,8 +755,9 @@ public class AutoScaleManagerImpl<Type> implements AutoScaleManager, AutoScaleSe
|
|||||||
return _lbRulesMgr.configureLbAutoScaleVmGroup(vmGroupid, currentState);
|
return _lbRulesMgr.configureLbAutoScaleVmGroup(vmGroupid, currentState);
|
||||||
} catch (ResourceUnavailableException re) {
|
} catch (ResourceUnavailableException re) {
|
||||||
throw re;
|
throw re;
|
||||||
} catch (RuntimeException re) {
|
} catch (Exception e) {
|
||||||
s_logger.warn("Exception during configureLbAutoScaleVmGrouop in lb rules manager", re);
|
s_logger.warn("Exception during configureLbAutoScaleVmGroup in lb rules manager", e);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -227,6 +227,7 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
|
|||||||
@Inject
|
@Inject
|
||||||
UserDao _userDao;
|
UserDao _userDao;
|
||||||
|
|
||||||
|
|
||||||
// Will return a string. For LB Stickiness this will be a json, for autoscale this will be "," separated values
|
// Will return a string. For LB Stickiness this will be a json, for autoscale this will be "," separated values
|
||||||
@Override
|
@Override
|
||||||
public String getLBCapability(long networkid, String capabilityName) {
|
public String getLBCapability(long networkid, String capabilityName) {
|
||||||
@ -351,7 +352,6 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
|
|||||||
_lbDao.persist(loadBalancer);
|
_lbDao.persist(loadBalancer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// LBTODO
|
|
||||||
try {
|
try {
|
||||||
success = applyAutoScaleConfig(loadBalancer, vmGroup, currentState);
|
success = applyAutoScaleConfig(loadBalancer, vmGroup, currentState);
|
||||||
} catch (ResourceUnavailableException e) {
|
} catch (ResourceUnavailableException e) {
|
||||||
@ -862,10 +862,19 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
|
|||||||
|
|
||||||
if (apply) {
|
if (apply) {
|
||||||
try {
|
try {
|
||||||
|
if (_autoScaleVmGroupDao.isAutoScaleLoadBalancer(loadBalancerId)) {
|
||||||
|
// Get the associated VmGroup
|
||||||
|
AutoScaleVmGroupVO vmGroup = _autoScaleVmGroupDao.listByAll(loadBalancerId, null).get(0);
|
||||||
|
if (!applyAutoScaleConfig(lb, vmGroup,vmGroup.getState())) {
|
||||||
|
s_logger.warn("Unable to apply the autoscale config");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (!applyLoadBalancerConfig(loadBalancerId)) {
|
if (!applyLoadBalancerConfig(loadBalancerId)) {
|
||||||
s_logger.warn("Unable to apply the load balancer config");
|
s_logger.warn("Unable to apply the load balancer config");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (ResourceUnavailableException e) {
|
} catch (ResourceUnavailableException e) {
|
||||||
if (rollBack && isRollBackAllowedForProvider(lb)) {
|
if (rollBack && isRollBackAllowedForProvider(lb)) {
|
||||||
if (backupMaps != null) {
|
if (backupMaps != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user