Merge pull request #1337 from nitin-maharana/CloudStack-Nitin20_4.7

CLOUDSTACK-9235: Autoscale button is missing in VPCAutoscale button is missing. This should not be the case since we are able to add NS as the external LB provider in VPC.

Steps:
=====
1. Create a VPC offering with NS as the external LB provider
2. Create a VPC and configure the public tier with the above offering
3. Acquire an IP address and try to configure Load Balancing rule

Result:
======
Autoscale option is not visible at all for the LB.

Expected Result:
=============
Autoscale option should be available and should work exactly like the way it works for a normal isolated network with NS. If we choose NS as service provider for LB, autoscale should also be visible. If VR is chosen, only then we should not display autoscale.

Fix:
===
In case of VPC, it checks the services available.
If LB is there, It checks the provider is Netscaler then it shows the button or hides it.

* pr/1337:
  CLOUDSTACK-9235: Autoscale button is missing in VPC

Signed-off-by: Remi Bergsma <github@remi.nl>
This commit is contained in:
Remi Bergsma 2016-01-20 22:17:54 +01:00
commit c14183bd25
1 changed files with 11 additions and 18 deletions

View File

@ -3673,22 +3673,7 @@
success: function(json) {
var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
var services = networkOffering.service;
if (services != null) {
for (var i = 0; i < services.length; i++) {
if (services[i].name == 'Lb') {
var providers = services[i].provider;
if (providers != null) {
for (var k = 0; k < providers.length; k++) {
if (providers[k].name == 'Netscaler') {
lbProviderIsNetscaler = true;
break;
}
}
}
break;
}
}
}
lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
}
});
if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
@ -3697,8 +3682,16 @@
return 2; //hide Autoscale button (both header and form)
}
} else { //from VPC section
//VPC doesn't support autoscale
return 2;
var lbProviderIsNetscaler;
var services = args.context.vpc[0].service;
lbProviderIsNetscaler = checkIfNetScalerProviderIsEnabled(services);
if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
return false; //show AutoScale button
} else {
return 2; //hide Autoscale button (both header and form)
}
}
}
},