CLOUDSTACK-4037: [GSLB] removeFromGSLBRule is not cleaning the

cloudsite1 infro from the second site NetScaler device

ensuring when a site no longer participates in GSLB, complete GSLB
config for that rule is wiped out on the GSLB provider for that site
This commit is contained in:
Murali Reddy 2013-08-06 05:53:48 +05:30
parent ab9ce67e19
commit c83fd94d26
2 changed files with 12 additions and 1 deletions

View File

@ -93,6 +93,10 @@ public class GlobalLoadBalancerConfigCommand extends Command {
return revoked;
}
public void setForRevoke(boolean revoke) {
this.revoked = revoke;
}
@Override
public boolean executeInSequence() {
return false;

View File

@ -661,7 +661,6 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
for (Pair<Long,Long> zoneId: gslbSiteIds) {
List<SiteLoadBalancerConfig> slbs = new ArrayList<SiteLoadBalancerConfig>();
// set site as 'local' for the site in that zone
for (Pair<Long,Long> innerLoopZoneId: gslbSiteIds) {
SiteLoadBalancerConfig siteLb = zoneSiteLoadbalancerMap.get(innerLoopZoneId.first());
@ -670,6 +669,14 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR
}
gslbConfigCmd.setSiteLoadBalancers(slbs);
gslbConfigCmd.setForRevoke(revoke);
// revoke GSLB configuration completely on the site GSLB provider for the sites that no longer
// are participants of a GSLB rule
SiteLoadBalancerConfig siteLb = zoneSiteLoadbalancerMap.get(zoneId.first());
if (siteLb.forRevoke()) {
gslbConfigCmd.setForRevoke(true);
}
try {
_gslbProvider.applyGlobalLoadBalancerRule(zoneId.first(), zoneId.second(), gslbConfigCmd);