From e03693f0aa4e39f53a414a0fd70cbca09dfd8487 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Fri, 17 Dec 2010 16:30:12 -0800 Subject: [PATCH] Make AddClusterCmd API generic to all hypervisors, change UI accordingly also --- api/src/com/cloud/api/ApiConstants.java | 1 + .../api/commands/AddExternalClusterCmd.java | 102 ------------------ .../cloud/api/response/ClusterResponse.java | 11 ++ .../com/cloud/resource/ResourceService.java | 4 +- .../classes/resources/messages.properties | 2 +- .../classes/resources/messages_en.properties | 2 +- client/tomcatconf/commands.properties.in | 2 +- .../cloud/agent/manager/AgentManagerImpl.java | 17 ++- .../src/com/cloud/api/ApiResponseHelper.java | 1 + ui/jsp/pod.jsp | 26 +++-- ui/jsp/zone.jsp | 25 +++-- ui/scripts/cloud.core.cluster.js | 1 + ui/scripts/cloud.core.pod.js | 85 ++++++++++----- ui/scripts/cloud.core.zone.js | 82 +++++++++----- 14 files changed, 180 insertions(+), 181 deletions(-) delete mode 100644 api/src/com/cloud/api/commands/AddExternalClusterCmd.java diff --git a/api/src/com/cloud/api/ApiConstants.java b/api/src/com/cloud/api/ApiConstants.java index a89fd2b4f93..9397fdd8682 100755 --- a/api/src/com/cloud/api/ApiConstants.java +++ b/api/src/com/cloud/api/ApiConstants.java @@ -35,6 +35,7 @@ public class ApiConstants { public static final String CLEANUP = "cleanup"; public static final String CLUSTER_ID = "clusterid"; public static final String CLUSTER_NAME = "clustername"; + public static final String CLUSTER_TYPE = "clustertype"; public static final String COMPONENT = "component"; public static final String CPU_NUMBER = "cpunumber"; public static final String CPU_SPEED = "cpuspeed"; diff --git a/api/src/com/cloud/api/commands/AddExternalClusterCmd.java b/api/src/com/cloud/api/commands/AddExternalClusterCmd.java deleted file mode 100644 index 5a855204d17..00000000000 --- a/api/src/com/cloud/api/commands/AddExternalClusterCmd.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.cloud.api.commands; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.log4j.Logger; - -import com.cloud.api.ApiConstants; -import com.cloud.api.BaseCmd; -import com.cloud.api.Implementation; -import com.cloud.api.Parameter; -import com.cloud.api.ServerApiException; -import com.cloud.api.response.HostResponse; -import com.cloud.api.response.ListResponse; -import com.cloud.exception.DiscoveryException; -import com.cloud.host.Host; - -@Implementation(description="Adds a new external cluster", responseObject=HostResponse.class) -public class AddExternalClusterCmd extends BaseCmd { - public static final Logger s_logger = Logger.getLogger(AddExternalClusterCmd.class.getName()); - - private static final String s_name = "addexternalclusterresponse"; - - @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name") - private String clusterName; - - @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="the password for the host") - private String password; - - @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host") - private Long podId; - - @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the host URL") - private String url; - - @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="the username for the host") - private String username; - - @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the host") - private Long zoneId; - - @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=false, description="hypervisor type of the host") - private String hypervisor; - - public String getClusterName() { - return clusterName; - } - - public String getPassword() { - return password; - } - - public Long getPodId() { - return podId; - } - - public String getUrl() { - return url; - } - - public String getUsername() { - return username; - } - - public Long getZoneId() { - return zoneId; - } - - public String getHypervisor() { - return hypervisor; - } - - @Override - public String getCommandName() { - return s_name; - } - - @Override - public void execute(){ - try { - List result = _resourceService.discoverExternalCluster(this); - ListResponse response = new ListResponse(); - List hostResponses = new ArrayList(); - if (result != null) { - for (Host host : result) { - HostResponse hostResponse = _responseGenerator.createHostResponse(host); - hostResponses.add(hostResponse); - } - } else { - throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add external host cluster"); - } - - response.setResponses(hostResponses); - response.setResponseName(getCommandName()); - - this.setResponseObject(response); - } catch (DiscoveryException ex) { - s_logger.warn("Exception: ", ex); - throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage()); - } - } -} diff --git a/api/src/com/cloud/api/response/ClusterResponse.java b/api/src/com/cloud/api/response/ClusterResponse.java index 734b70b8aa1..4739e7a5616 100644 --- a/api/src/com/cloud/api/response/ClusterResponse.java +++ b/api/src/com/cloud/api/response/ClusterResponse.java @@ -40,6 +40,9 @@ public class ClusterResponse extends BaseResponse { @SerializedName("zonename") @Param(description="the Zone name of the cluster") private String zoneName; + @SerializedName("hypervisortype") @Param(description="the hypervisor type of the cluster") + private String hypervisorType; + @SerializedName("clustertype") @Param(description="the type of the cluster") private String clusterType; @@ -98,4 +101,12 @@ public class ClusterResponse extends BaseResponse { public void setClusterType(String clusterType) { this.clusterType = clusterType; } + + public String getHypervisorType() { + return this.hypervisorType; + } + + public void setHypervisorType(String hypervisorType) { + this.hypervisorType = hypervisorType; + } } diff --git a/api/src/com/cloud/resource/ResourceService.java b/api/src/com/cloud/resource/ResourceService.java index 30bad2aa144..5d9b3ca9a1c 100644 --- a/api/src/com/cloud/resource/ResourceService.java +++ b/api/src/com/cloud/resource/ResourceService.java @@ -19,7 +19,7 @@ package com.cloud.resource; import java.util.List; -import com.cloud.api.commands.AddExternalClusterCmd; +import com.cloud.api.commands.AddClusterCmd; import com.cloud.api.commands.AddHostCmd; import com.cloud.api.commands.AddSecondaryStorageCmd; import com.cloud.api.commands.CancelMaintenanceCmd; @@ -55,7 +55,7 @@ public interface ResourceService { * @throws DiscoveryException * @throws InvalidParameterValueException */ - List discoverExternalCluster(AddExternalClusterCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException; + List discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException; List discoverHosts(AddHostCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException; List discoverHosts(AddSecondaryStorageCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException; diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 14da56cf983..f33798b3c44 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -18,7 +18,7 @@ label.add=Add label.add.zone=Add Zone label.adding.zone=Adding Zone label.add.host=Add Host -label.add.cluster=Add External Cluster +label.add.cluster=Add Cluster label.add.primarystorage=Add Primary Storage label.add.secondarystorage=Add Secondary Storage label.add.pod=Add Pod diff --git a/client/WEB-INF/classes/resources/messages_en.properties b/client/WEB-INF/classes/resources/messages_en.properties index 14da56cf983..f33798b3c44 100644 --- a/client/WEB-INF/classes/resources/messages_en.properties +++ b/client/WEB-INF/classes/resources/messages_en.properties @@ -18,7 +18,7 @@ label.add=Add label.add.zone=Add Zone label.adding.zone=Adding Zone label.add.host=Add Host -label.add.cluster=Add External Cluster +label.add.cluster=Add Cluster label.add.primarystorage=Add Primary Storage label.add.secondarystorage=Add Secondary Storage label.add.pod=Add Pod diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 68ace2d04a9..8f090dbe753 100755 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -166,7 +166,7 @@ listCapacity=com.cloud.api.commands.ListCapacityCmd;1 #### host commands addHost=com.cloud.api.commands.AddHostCmd;1 -addExternalCluster=com.cloud.api.commands.AddExternalClusterCmd;1 +addCluster=com.cloud.api.commands.AddClusterCmd;1 add=com.cloud.api.commands.AddHostCmd;1 reconnectHost=com.cloud.api.commands.ReconnectHostCmd;1 updateHost=com.cloud.api.commands.UpdateHostCmd;1 diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 4b849c8a376..e52ca6546c5 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -73,7 +73,7 @@ import com.cloud.agent.transport.Response; import com.cloud.alert.AlertManager; import com.cloud.api.BaseCmd; import com.cloud.api.ServerApiException; -import com.cloud.api.commands.AddExternalClusterCmd; +import com.cloud.api.commands.AddClusterCmd; import com.cloud.api.commands.AddHostCmd; import com.cloud.api.commands.AddSecondaryStorageCmd; import com.cloud.api.commands.CancelMaintenanceCmd; @@ -545,7 +545,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS } @Override - public List discoverExternalCluster(AddExternalClusterCmd cmd) + public List discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException { Long dcId = cmd.getZoneId(); Long podId = cmd.getPodId(); @@ -587,6 +587,13 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS throw new InvalidParameterValueException("Please specify a valid hypervisor name"); } + Cluster.ClusterType clusterType = null; + if(cmd.getClusterType() != null && !cmd.getClusterType().isEmpty()) { + clusterType = Cluster.ClusterType.valueOf(cmd.getClusterType()); + } + if(clusterType == null) + clusterType = Cluster.ClusterType.CloudManaged; + Discoverer discoverer = getMatchingDiscover(hypervisorType); if(discoverer == null) { throw new InvalidParameterValueException("Please specify a valid hypervisor"); @@ -596,7 +603,8 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS if (clusterName != null) { ClusterVO cluster = new ClusterVO(dcId, podId, clusterName); cluster.setHypervisorType(cmd.getHypervisor()); - cluster.setClusterType(Cluster.ClusterType.ExternalManaged); + + cluster.setClusterType(clusterType); try { cluster = _clusterDao.persist(cluster); } catch (Exception e) { @@ -608,6 +616,9 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS clusterId = cluster.getId(); } + if(clusterType == Cluster.ClusterType.CloudManaged) + return _hostDao.listByCluster(clusterId); + boolean success = false; try { try { diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 74ddb5941f8..7dec7f07366 100644 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -869,6 +869,7 @@ public class ApiResponseHelper implements ResponseGenerator { clusterResponse.setName(cluster.getName()); clusterResponse.setPodId(cluster.getPodId()); clusterResponse.setZoneId(cluster.getDataCenterId()); + clusterResponse.setHypervisorType(cluster.getHypervisorType().toString()); clusterResponse.setClusterType(cluster.getClusterType().toString()); HostPodVO pod = ApiDBUtils.findPodById(cluster.getPodId()); clusterResponse.setPodName(pod.getName()); diff --git a/ui/jsp/pod.jsp b/ui/jsp/pod.jsp index 72e8edf0a7f..2efcfda7596 100644 --- a/ui/jsp/pod.jsp +++ b/ui/jsp/pod.jsp @@ -239,7 +239,6 @@ -
  • @@ -317,32 +316,43 @@
  • -
  • +
  • + + + +
  • +
  • -
  • +
  • + vCenter User:
  • -
  • +
  • - -
  • +
  • diff --git a/ui/jsp/zone.jsp b/ui/jsp/zone.jsp index 96ad08d9cf7..a113c4e9315 100644 --- a/ui/jsp/zone.jsp +++ b/ui/jsp/zone.jsp @@ -580,9 +580,21 @@
  • +
  • + + + +
  • @@ -591,29 +603,28 @@
  • -
  • +
  • -
  • +
  • + vCenter User:
  • -
  • +
  • - -
  • +
  • diff --git a/ui/scripts/cloud.core.cluster.js b/ui/scripts/cloud.core.cluster.js index 6468ec9ff1a..af213af27f6 100644 --- a/ui/scripts/cloud.core.cluster.js +++ b/ui/scripts/cloud.core.cluster.js @@ -29,6 +29,7 @@ function afterLoadClusterJSP($leftmenuItem1) { function clusterJsonToRightPanel($leftmenuItem1) { var objCluster = $leftmenuItem1.data("jsonObj"); + clearAddButtonsOnTop(); if(objCluster.clustertype == "CloudManaged") initAddHostButton($("#midmenu_add_host_button"), "cluster_page", $leftmenuItem1); diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index 4a14dfa12ff..455d7371981 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -278,17 +278,41 @@ function initAddClusterButton($button, currentPageInRightPanel, $leftmenuItem1) dialogAddCluster.find("#zone_name").text(fromdb(podObj.zonename)); dialogAddCluster.find("#pod_name").text(fromdb(podObj.name)); } + + dialogAddCluster.find("#cluster_hypervisor").change(function() { + if($(this).val() == "VmWare") { + $('li[input_group]="vmware"', dialogAddCluster).show(); + dialogAddCluster.find("#type_dropdown").change(); + } else { + $('li[input_group]="vmware"', dialogAddCluster).hide(); + } + }).change(); + + dialogAddCluster.find("#type_dropdown").change(function() { + if($(this).val() == "ExternalManaged") { + $('li[input_sub_group]="external"', dialogAddCluster).show(); + } else { + $('li[input_sub_group]="external"', dialogAddCluster).hide(); + } + }); dialogAddCluster.dialog('option', 'buttons', { "Add": function() { var $thisDialog = $(this); - + + var hypervisor = $thisDialog.find("#cluster_hypervisor").val(); + var clusterType="CloudManaged"; + if(hypervisor == "VmWare") + clusterType = $thisDialog.find("#type_dropdown").val(); + // validate values - var isValid = true; - isValid &= validateString("vCenter Server", $thisDialog.find("#cluster_hostname"), $thisDialog.find("#cluster_hostname_errormsg")); - isValid &= validateString("vCenter user", $thisDialog.find("#cluster_username"), $thisDialog.find("#cluster_username_errormsg")); - isValid &= validateString("Password", $thisDialog.find("#cluster_password"), $thisDialog.find("#cluster_password_errormsg")); - isValid &= validateString("Datacenter", $thisDialog.find("#cluster_datacenter"), $thisDialog.find("#cluster_datacenter_errormsg")); + var isValid = true; + if(hypervisor == "VmWare" && clusterType != "CloudManaged") { + isValid &= validateString("vCenter Server", $thisDialog.find("#cluster_hostname"), $thisDialog.find("#cluster_hostname_errormsg")); + isValid &= validateString("vCenter user", $thisDialog.find("#cluster_username"), $thisDialog.find("#cluster_username_errormsg")); + isValid &= validateString("Password", $thisDialog.find("#cluster_password"), $thisDialog.find("#cluster_password_errormsg")); + isValid &= validateString("Datacenter", $thisDialog.find("#cluster_datacenter"), $thisDialog.find("#cluster_datacenter_errormsg")); + } isValid &= validateString("Cluster name", $thisDialog.find("#cluster_name"), $thisDialog.find("#cluster_name_errormsg")); if (!isValid) return; @@ -298,32 +322,37 @@ function initAddClusterButton($button, currentPageInRightPanel, $leftmenuItem1) var array1 = []; var hypervisor = $thisDialog.find("#cluster_hypervisor").val(); array1.push("&hypervisor="+hypervisor); - + array1.push("&clustertype=" + clusterType); array1.push("&zoneId="+zoneId); array1.push("&podId="+podId); - - var username = trim($thisDialog.find("#cluster_username").val()); - array1.push("&username="+todb(username)); - - var password = trim($thisDialog.find("#cluster_password").val()); - array1.push("&password="+todb(password)); - - var hostname = trim($thisDialog.find("#cluster_hostname").val()); - var dcName = trim($thisDialog.find("#cluster_datacenter").val()); + var clusterName = trim($thisDialog.find("#cluster_name").val()); + if(hypervisor == "VmWare" && clusterType != "CloudManaged") { + + var username = trim($thisDialog.find("#cluster_username").val()); + array1.push("&username="+todb(username)); + + var password = trim($thisDialog.find("#cluster_password").val()); + array1.push("&password="+todb(password)); + + var hostname = trim($thisDialog.find("#cluster_hostname").val()); + var dcName = trim($thisDialog.find("#cluster_datacenter").val()); + + var url; + if(hostname.indexOf("http://")==-1) + url = "http://" + todb(hostname); + else + url = hostname; + url += "/" + todb(dcName) + "/" + todb(clusterName); + array1.push("&url=" + todb(url)); + + clusterName = hostname + "/" + dcName + "/" + clusterName + } + + array1.push("&clustername=" + todb(clusterName)); - array1.push("&clustername=" + todb(hostname + "/" + dcName + "/" + clusterName)); - - var url; - if(hostname.indexOf("http://")==-1) - url = "http://" + todb(hostname); - else - url = hostname; - url += "/" + todb(dcName) + "/" + todb(clusterName); - array1.push("&url=" + todb(url)); - $.ajax({ - data: createURL("command=addExternalCluster" + array1.join("")), + data: createURL("command=addCluster" + array1.join("")), dataType: "json", success: function(json) { $thisDialog.find("#spinning_wheel").hide(); @@ -331,7 +360,7 @@ function initAddClusterButton($button, currentPageInRightPanel, $leftmenuItem1) showMiddleMenu(); - clickClusterNodeAfterAddHost("new_cluster_radio", podId, hostname + "/" + dcName + "/" + clusterName, null, $thisDialog); + clickClusterNodeAfterAddHost("new_cluster_radio", podId, clusterName, null, $thisDialog); }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() { diff --git a/ui/scripts/cloud.core.zone.js b/ui/scripts/cloud.core.zone.js index 6ae69ad38c1..2a997f57666 100644 --- a/ui/scripts/cloud.core.zone.js +++ b/ui/scripts/cloud.core.zone.js @@ -1002,16 +1002,40 @@ function initAddClusterButtonOnZonePage($button, zoneId, zoneName) { } }); + $dialogAddCluster.find("#cluster_hypervisor").change(function() { + if($(this).val() == "VmWare") { + $('li[input_group]="vmware"', $dialogAddCluster).show(); + $dialogAddCluster.find("#type_dropdown").change(); + } else { + $('li[input_group]="vmware"', $dialogAddCluster).hide(); + } + }).change(); + + $dialogAddCluster.find("#type_dropdown").change(function() { + if($(this).val() == "ExternalManaged") { + $('li[input_sub_group]="external"', $dialogAddCluster).show(); + } else { + $('li[input_sub_group]="external"', $dialogAddCluster).hide(); + } + }); + $dialogAddCluster.dialog('option', 'buttons', { "Add": function() { var $thisDialog = $(this); // validate values - var isValid = true; - isValid &= validateString("vCenter Server", $thisDialog.find("#cluster_hostname"), $thisDialog.find("#cluster_hostname_errormsg")); - isValid &= validateString("vCenter user", $thisDialog.find("#cluster_username"), $thisDialog.find("#cluster_username_errormsg")); - isValid &= validateString("Password", $thisDialog.find("#cluster_password"), $thisDialog.find("#cluster_password_errormsg")); - isValid &= validateString("Datacenter", $thisDialog.find("#cluster_datacenter"), $thisDialog.find("#cluster_datacenter_errormsg")); + var hypervisor = $thisDialog.find("#cluster_hypervisor").val(); + var clusterType="CloudManaged"; + if(hypervisor == "VmWare") + clusterType = $thisDialog.find("#type_dropdown").val(); + + var isValid = true; + if(hypervisor == "VmWare" && clusterType != "CloudManaged") { + isValid &= validateString("vCenter Server", $thisDialog.find("#cluster_hostname"), $thisDialog.find("#cluster_hostname_errormsg")); + isValid &= validateString("vCenter user", $thisDialog.find("#cluster_username"), $thisDialog.find("#cluster_username_errormsg")); + isValid &= validateString("Password", $thisDialog.find("#cluster_password"), $thisDialog.find("#cluster_password_errormsg")); + isValid &= validateString("Datacenter", $thisDialog.find("#cluster_datacenter"), $thisDialog.find("#cluster_datacenter_errormsg")); + } isValid &= validateString("Cluster name", $thisDialog.find("#cluster_name"), $thisDialog.find("#cluster_name_errormsg")); if (!isValid) return; @@ -1019,9 +1043,8 @@ function initAddClusterButtonOnZonePage($button, zoneId, zoneName) { $thisDialog.find("#spinning_wheel").show(); var array1 = []; - var hypervisor = $thisDialog.find("#cluster_hypervisor").val(); array1.push("&hypervisor="+hypervisor); - + array1.push("&clustertype=" + clusterType); array1.push("&zoneId="+zoneId); //expand zone in left menu tree (to show pod, cluster under the zone) @@ -1031,29 +1054,32 @@ function initAddClusterButtonOnZonePage($button, zoneId, zoneName) { var podId = $thisDialog.find("#pod_dropdown").val(); array1.push("&podId="+podId); - - var username = trim($thisDialog.find("#cluster_username").val()); - array1.push("&username="+todb(username)); - - var password = trim($thisDialog.find("#cluster_password").val()); - array1.push("&password="+todb(password)); - - var hostname = trim($thisDialog.find("#cluster_hostname").val()); - var dcName = trim($thisDialog.find("#cluster_datacenter").val()); + var clusterName = trim($thisDialog.find("#cluster_name").val()); + if(hypervisor == "VmWare" && clusterType != "CloudManaged") { + var username = trim($thisDialog.find("#cluster_username").val()); + array1.push("&username="+todb(username)); + + var password = trim($thisDialog.find("#cluster_password").val()); + array1.push("&password="+todb(password)); + + var hostname = trim($thisDialog.find("#cluster_hostname").val()); + var dcName = trim($thisDialog.find("#cluster_datacenter").val()); + var url; + if(hostname.indexOf("http://")==-1) + url = "http://" + todb(hostname); + else + url = hostname; + url += "/" + todb(dcName) + "/" + todb(clusterName); + array1.push("&url=" + todb(url)); + + clusterName = hostname + "/" + dcName + "/" + clusterName + } - array1.push("&clustername=" + todb(hostname + "/" + dcName + "/" + clusterName)); - - var url; - if(hostname.indexOf("http://")==-1) - url = "http://" + todb(hostname); - else - url = hostname; - url += "/" + todb(dcName) + "/" + todb(clusterName); - array1.push("&url=" + todb(url)); + array1.push("&clustername=" + todb(clusterName)); $.ajax({ - data: createURL("command=addExternalCluster" + array1.join("")), + data: createURL("command=addCluster" + array1.join("")), dataType: "json", success: function(json) { $thisDialog.find("#spinning_wheel").hide(); @@ -1061,7 +1087,7 @@ function initAddClusterButtonOnZonePage($button, zoneId, zoneName) { showMiddleMenu(); - clickClusterNodeAfterAddHost("new_cluster_radio", podId, hostname + "/" + dcName + "/" + clusterName, null, $thisDialog); + clickClusterNodeAfterAddHost("new_cluster_radio", podId, clusterName, null, $thisDialog); }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() { @@ -1110,7 +1136,7 @@ function initAddHostButtonOnZonePage($button, zoneId, zoneName) { } $podSelect.change(); } - }); + }); $dialogAddHost .dialog('option', 'buttons', {