mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Review 16080 Move Netscaler plugin from non-oss to oss and upgrade the nitro API to 10.1
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
This commit is contained in:
parent
28ac2f758e
commit
356daf3eed
@ -95,6 +95,11 @@
|
|||||||
<artifactId>cloud-plugin-network-palo-alto</artifactId>
|
<artifactId>cloud-plugin-network-palo-alto</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cloudstack</groupId>
|
||||||
|
<artifactId>cloud-plugin-network-netscaler</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.cloudstack</groupId>
|
<groupId>org.apache.cloudstack</groupId>
|
||||||
<artifactId>cloud-plugin-network-ovs</artifactId>
|
<artifactId>cloud-plugin-network-ovs</artifactId>
|
||||||
@ -659,21 +664,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
|
||||||
<id>netscaler</id>
|
|
||||||
<activation>
|
|
||||||
<property>
|
|
||||||
<name>noredist</name>
|
|
||||||
</property>
|
|
||||||
</activation>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.cloudstack</groupId>
|
|
||||||
<artifactId>cloud-plugin-network-netscaler</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>srx</id>
|
<id>srx</id>
|
||||||
<activation>
|
<activation>
|
||||||
|
|||||||
@ -30,12 +30,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.citrix.netscaler.nitro</groupId>
|
<groupId>com.citrix.netscaler.nitro</groupId>
|
||||||
<artifactId>nitro</artifactId>
|
<artifactId>nitro</artifactId>
|
||||||
<version>10.0.e</version>
|
<version>10.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cloud.com.citrix</groupId>
|
<groupId>com.citrix.netscaler.nitro</groupId>
|
||||||
<artifactId>netscaler-sdx</artifactId>
|
<artifactId>sdx_nitro</artifactId>
|
||||||
<version>1.0</version>
|
<version>10.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -72,10 +72,10 @@ import com.citrix.netscaler.nitro.resource.config.ssl.sslvserver_sslcertkey_bind
|
|||||||
import com.citrix.netscaler.nitro.resource.stat.lb.lbvserver_stats;
|
import com.citrix.netscaler.nitro.resource.stat.lb.lbvserver_stats;
|
||||||
import com.citrix.netscaler.nitro.service.nitro_service;
|
import com.citrix.netscaler.nitro.service.nitro_service;
|
||||||
import com.citrix.netscaler.nitro.util.filtervalue;
|
import com.citrix.netscaler.nitro.util.filtervalue;
|
||||||
import com.citrix.sdx.nitro.resource.config.device_profile;
|
import com.citrix.sdx.nitro.resource.config.mps.device_profile;
|
||||||
import com.citrix.sdx.nitro.resource.config.mps;
|
import com.citrix.sdx.nitro.resource.config.mps.mps;
|
||||||
import com.citrix.sdx.nitro.resource.config.ns;
|
import com.citrix.sdx.nitro.resource.config.ns.ns;
|
||||||
import com.citrix.sdx.nitro.resource.config.xen_vpx_image;
|
import com.citrix.sdx.nitro.resource.config.xen.xen_nsvpx_image;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
@ -692,7 +692,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
String intermediateCertFileName = intermediateCertKeyName + ".pem";
|
String intermediateCertFileName = intermediateCertKeyName + ".pem";
|
||||||
|
|
||||||
if (!SSL.isSslCertKeyPresent(_netscalerService, intermediateCertKeyName)) {
|
if (!SSL.isSslCertKeyPresent(_netscalerService, intermediateCertKeyName)) {
|
||||||
byte[] certData = intermediateCert.getEncoded();
|
intermediateCert.getEncoded();
|
||||||
StringWriter textWriter = new StringWriter();
|
StringWriter textWriter = new StringWriter();
|
||||||
PEMWriter pemWriter = new PEMWriter(textWriter);
|
PEMWriter pemWriter = new PEMWriter(textWriter);
|
||||||
pemWriter.writeObject(intermediateCert);
|
pemWriter.writeObject(intermediateCert);
|
||||||
@ -914,8 +914,8 @@ public class NetscalerResource implements ServerResource {
|
|||||||
ns_obj.set_password(password);
|
ns_obj.set_password(password);
|
||||||
|
|
||||||
// configure VPX instances with defaults
|
// configure VPX instances with defaults
|
||||||
ns_obj.set_feature_license("Standard");
|
ns_obj.set_license("Standard");
|
||||||
ns_obj.set_memory_total(new Double(2048));
|
ns_obj.set_vm_memory_total(new Double(2048));
|
||||||
ns_obj.set_throughput(new Double(1000));
|
ns_obj.set_throughput(new Double(1000));
|
||||||
ns_obj.set_pps(new Double(1000000));
|
ns_obj.set_pps(new Double(1000000));
|
||||||
ns_obj.set_number_of_ssl_cores(0);
|
ns_obj.set_number_of_ssl_cores(0);
|
||||||
@ -927,11 +927,11 @@ public class NetscalerResource implements ServerResource {
|
|||||||
" as there are no admin profile to use for creating VPX."));
|
" as there are no admin profile to use for creating VPX."));
|
||||||
}
|
}
|
||||||
String profileName = profiles[0].get_name();
|
String profileName = profiles[0].get_name();
|
||||||
ns_obj.set_nsroot_profile(profileName);
|
ns_obj.set_profile_name(profileName);
|
||||||
|
|
||||||
// use the first VPX image of the available VPX images on the SDX to create an instance of VPX
|
// use the first VPX image of the available VPX images on the SDX to create an instance of VPX
|
||||||
// TODO: should enable the option to choose the template while adding the SDX device in to CloudStack
|
// TODO: should enable the option to choose the template while adding the SDX device in to CloudStack
|
||||||
xen_vpx_image[] vpxImages = xen_vpx_image.get(_netscalerSdxService);
|
xen_nsvpx_image[] vpxImages = xen_nsvpx_image.get(_netscalerSdxService);
|
||||||
if (!(vpxImages != null && vpxImages.length >= 1)) {
|
if (!(vpxImages != null && vpxImages.length >= 1)) {
|
||||||
new Answer(cmd, new ExecutionException("Failed to create VPX instance on the netscaler SDX device " + _ip +
|
new Answer(cmd, new ExecutionException("Failed to create VPX instance on the netscaler SDX device " + _ip +
|
||||||
" as there are no VPX images on SDX to use for creating VPX."));
|
" as there are no VPX images on SDX to use for creating VPX."));
|
||||||
@ -955,7 +955,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
// wait for VPX instance to start-up
|
// wait for VPX instance to start-up
|
||||||
long startTick = System.currentTimeMillis();
|
long startTick = System.currentTimeMillis();
|
||||||
long startWaitMilliSeconds = 600000;
|
long startWaitMilliSeconds = 600000;
|
||||||
while (!newVpx.get_ns_state().equalsIgnoreCase("up") && System.currentTimeMillis() - startTick < startWaitMilliSeconds) {
|
while (!newVpx.get_state().equalsIgnoreCase("up") && System.currentTimeMillis() - startTick < startWaitMilliSeconds) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@ -966,7 +966,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if vpx instance never came up then error out
|
// if vpx instance never came up then error out
|
||||||
if (!newVpx.get_ns_state().equalsIgnoreCase("up")) {
|
if (!newVpx.get_state().equalsIgnoreCase("up")) {
|
||||||
return new Answer(cmd, new ExecutionException("Failed to start VPX instance " + vpxName + " created on the netscaler SDX device " + _ip));
|
return new Answer(cmd, new ExecutionException("Failed to start VPX instance " + vpxName + " created on the netscaler SDX device " + _ip));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1108,8 +1108,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
// Unbind GSLB service with GSLB virtual server
|
// Unbind GSLB service with GSLB virtual server
|
||||||
GSLB.deleteVserverServiceBinding(_netscalerService, serviceName, vserverName);
|
GSLB.deleteVserverServiceBinding(_netscalerService, serviceName, vserverName);
|
||||||
|
|
||||||
// delete 'gslbservice' object
|
GSLB.getServiceObject(_netscalerService, serviceName);
|
||||||
gslbservice service = GSLB.getServiceObject(_netscalerService, serviceName);
|
|
||||||
GSLB.deleteService(_netscalerService, serviceName);
|
GSLB.deleteService(_netscalerService, serviceName);
|
||||||
|
|
||||||
// delete the GSLB service monitor
|
// delete the GSLB service monitor
|
||||||
@ -2380,7 +2379,10 @@ public class NetscalerResource implements ServerResource {
|
|||||||
|
|
||||||
// remove subnet IP
|
// remove subnet IP
|
||||||
try {
|
try {
|
||||||
nsip subnetIp = nsip.get(_netscalerService, vlanSelfIp);
|
nsip _vlanSelfIp = new nsip();
|
||||||
|
_vlanSelfIp.set_ipaddress(vlanSelfIp);
|
||||||
|
|
||||||
|
nsip subnetIp = nsip.get(_netscalerService, _vlanSelfIp);
|
||||||
apiCallResult = nsip.delete(_netscalerService, subnetIp);
|
apiCallResult = nsip.delete(_netscalerService, subnetIp);
|
||||||
if (apiCallResult.errorcode != 0) {
|
if (apiCallResult.errorcode != 0) {
|
||||||
throw new ExecutionException("Failed to remove subnet ip:" + vlanSelfIp + " from the NetScaler device due to" + apiCallResult.message);
|
throw new ExecutionException("Failed to remove subnet ip:" + vlanSelfIp + " from the NetScaler device due to" + apiCallResult.message);
|
||||||
@ -2425,9 +2427,12 @@ public class NetscalerResource implements ServerResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean nsSnipExists(String subnetIP) throws ExecutionException {
|
private boolean nsSnipExists(String subnetIp) throws ExecutionException {
|
||||||
try {
|
try {
|
||||||
nsip snip = nsip.get(_netscalerService, subnetIP);
|
nsip _subnetIp = new nsip();
|
||||||
|
_subnetIp.set_ipaddress(subnetIp);
|
||||||
|
|
||||||
|
nsip snip = nsip.get(_netscalerService, _subnetIp);
|
||||||
return (snip != null);
|
return (snip != null);
|
||||||
} catch (nitro_exception e) {
|
} catch (nitro_exception e) {
|
||||||
if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
|
if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
|
||||||
@ -2603,7 +2608,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
|
|
||||||
private boolean isServiceGroupBoundToVirtualServer(String nsVirtualServerName, String serviceGroupName) throws ExecutionException {
|
private boolean isServiceGroupBoundToVirtualServer(String nsVirtualServerName, String serviceGroupName) throws ExecutionException {
|
||||||
|
|
||||||
lbvserver_servicegroup_binding vserver_servicegroup_binding = new lbvserver_servicegroup_binding();
|
new lbvserver_servicegroup_binding();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
lbvserver_servicegroup_binding[] result =
|
lbvserver_servicegroup_binding[] result =
|
||||||
@ -2955,7 +2960,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
int srcPort = loadBalancerTO.getSrcPort();
|
int srcPort = loadBalancerTO.getSrcPort();
|
||||||
String lbProtocol = getNetScalerProtocol(loadBalancerTO);
|
String lbProtocol = getNetScalerProtocol(loadBalancerTO);
|
||||||
String lbAlgorithm = loadBalancerTO.getAlgorithm();
|
String lbAlgorithm = loadBalancerTO.getAlgorithm();
|
||||||
String vmGroupIdentifier = generateAutoScaleVmGroupIdentifier(loadBalancerTO);
|
generateAutoScaleVmGroupIdentifier(loadBalancerTO);
|
||||||
String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort);
|
String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort);
|
||||||
AutoScaleVmGroupTO vmGroupTO = loadBalancerTO.getAutoScaleVmGroupTO();
|
AutoScaleVmGroupTO vmGroupTO = loadBalancerTO.getAutoScaleVmGroupTO();
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
@ -3008,7 +3013,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
private synchronized boolean removeAutoScaleConfig(LoadBalancerTO loadBalancerTO) throws Exception, ExecutionException {
|
private synchronized boolean removeAutoScaleConfig(LoadBalancerTO loadBalancerTO) throws Exception, ExecutionException {
|
||||||
String srcIp = loadBalancerTO.getSrcIp();
|
String srcIp = loadBalancerTO.getSrcIp();
|
||||||
int srcPort = loadBalancerTO.getSrcPort();
|
int srcPort = loadBalancerTO.getSrcPort();
|
||||||
String vmGroupIdentifier = generateAutoScaleVmGroupIdentifier(loadBalancerTO);
|
generateAutoScaleVmGroupIdentifier(loadBalancerTO);
|
||||||
|
|
||||||
String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort);
|
String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort);
|
||||||
String serviceGroupName = generateAutoScaleServiceGroupName(loadBalancerTO);
|
String serviceGroupName = generateAutoScaleServiceGroupName(loadBalancerTO);
|
||||||
@ -3064,7 +3069,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
AutoScaleVmProfileTO profileTO = vmGroupTO.getProfile();
|
AutoScaleVmProfileTO profileTO = vmGroupTO.getProfile();
|
||||||
List<AutoScalePolicyTO> policies = vmGroupTO.getPolicies();
|
List<AutoScalePolicyTO> policies = vmGroupTO.getPolicies();
|
||||||
int interval = vmGroupTO.getInterval();
|
int interval = vmGroupTO.getInterval();
|
||||||
List<Pair<String, String>> counterParams = profileTO.getCounterParamList();
|
profileTO.getCounterParamList();
|
||||||
String snmpCommunity = null;
|
String snmpCommunity = null;
|
||||||
int snmpPort = DEFAULT_SNMP_PORT;
|
int snmpPort = DEFAULT_SNMP_PORT;
|
||||||
long cur_prirotiy = 1;
|
long cur_prirotiy = 1;
|
||||||
@ -3572,7 +3577,7 @@ public class NetscalerResource implements ServerResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAutoScaleSupportedInNetScaler() throws ExecutionException {
|
private boolean isAutoScaleSupportedInNetScaler() throws ExecutionException {
|
||||||
autoscaleprofile autoscaleProfile = new autoscaleprofile();
|
new autoscaleprofile();
|
||||||
try {
|
try {
|
||||||
autoscaleprofile.get(_netscalerService);
|
autoscaleprofile.get(_netscalerService);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@ -47,6 +47,7 @@
|
|||||||
<module>network-elements/ovs</module>
|
<module>network-elements/ovs</module>
|
||||||
<module>network-elements/juniper-contrail</module>
|
<module>network-elements/juniper-contrail</module>
|
||||||
<module>network-elements/palo-alto</module>
|
<module>network-elements/palo-alto</module>
|
||||||
|
<module>network-elements/netscaler</module>
|
||||||
<module>network-elements/nicira-nvp</module>
|
<module>network-elements/nicira-nvp</module>
|
||||||
<module>network-elements/bigswitch-vns</module>
|
<module>network-elements/bigswitch-vns</module>
|
||||||
<module>network-elements/midonet</module>
|
<module>network-elements/midonet</module>
|
||||||
@ -136,17 +137,6 @@
|
|||||||
<module>network-elements/f5</module>
|
<module>network-elements/f5</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
|
||||||
<id>netscaler</id>
|
|
||||||
<activation>
|
|
||||||
<property>
|
|
||||||
<name>noredist</name>
|
|
||||||
</property>
|
|
||||||
</activation>
|
|
||||||
<modules>
|
|
||||||
<module>network-elements/netscaler</module>
|
|
||||||
</modules>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>srx</id>
|
<id>srx</id>
|
||||||
<activation>
|
<activation>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user