CLOUDSTACK-7313 Fixed issues in provisioning vpx in SDX from CS

(cherry picked from commit 0f528df228ac51581b8ff6f63e8ffb6db3d94d39)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rajesh Battala 2014-09-28 09:20:13 +05:30 committed by Rohit Yadav
parent bd190192b9
commit 782adc106e
2 changed files with 12 additions and 4 deletions

View File

@ -931,7 +931,7 @@ 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_profile_name(profileName); ns_obj.set_profile_name("ns_nsroot_profile");
// 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
@ -959,7 +959,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_state().equalsIgnoreCase("up") && System.currentTimeMillis() - startTick < startWaitMilliSeconds) { while (!newVpx.get_instance_state().equalsIgnoreCase("up") && System.currentTimeMillis() - startTick < startWaitMilliSeconds) {
try { try {
Thread.sleep(10000); Thread.sleep(10000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
@ -970,7 +970,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_state().equalsIgnoreCase("up")) { if (!newVpx.get_instance_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));
} }
@ -981,6 +981,8 @@ public class NetscalerResource implements ServerResource {
while (System.currentTimeMillis() - startTick < nsServiceWaitMilliSeconds) { while (System.currentTimeMillis() - startTick < nsServiceWaitMilliSeconds) {
try { try {
nitro_service _netscalerService = new nitro_service(cmd.getLoadBalancerIP(), "https"); nitro_service _netscalerService = new nitro_service(cmd.getLoadBalancerIP(), "https");
_netscalerService.set_certvalidation(false);
_netscalerService.set_hostnameverification(false);
_netscalerService.set_credential(username, password); _netscalerService.set_credential(username, password);
apiCallResult = _netscalerService.login(); apiCallResult = _netscalerService.login();
if (apiCallResult.errorcode == 0) { if (apiCallResult.errorcode == 0) {

View File

@ -17,6 +17,7 @@
package com.cloud.network; package com.cloud.network;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -519,8 +520,13 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
null, false); null, false);
String publicIPNetmask = publicIp.getVlanNetmask(); String publicIPNetmask = publicIp.getVlanNetmask();
String publicIPgateway = publicIp.getVlanGateway(); String publicIPgateway = publicIp.getVlanGateway();
String publicIPVlanTag = publicIp.getVlanTag();
String publicIP = publicIp.getAddress().toString(); String publicIP = publicIp.getAddress().toString();
String publicIPVlanTag="";
try {
publicIPVlanTag = BroadcastDomainType.getValue(publicIp.getVlanTag());
} catch (URISyntaxException e) {
s_logger.error("Failed to parse public ip vlan tag" + e.getMessage());
}
String url = String url =
"https://" + lbIP + "?publicinterface=" + publicIf + "&privateinterface=" + privateIf + "&lbdevicededicated=" + dedicatedLb + "https://" + lbIP + "?publicinterface=" + publicIf + "&privateinterface=" + privateIf + "&lbdevicededicated=" + dedicatedLb +