mirror of https://github.com/apache/cloudstack.git
Add vmware cluster will automatically bring in all hosts under the cluster
This commit is contained in:
parent
215d894414
commit
6ebdafd4c3
|
|
@ -85,6 +85,7 @@ import com.cloud.api.commands.UpdateHostCmd;
|
|||
import com.cloud.capacity.CapacityVO;
|
||||
import com.cloud.capacity.dao.CapacityDao;
|
||||
import com.cloud.configuration.dao.ConfigurationDao;
|
||||
import com.cloud.dc.ClusterDetailsDao;
|
||||
import com.cloud.dc.ClusterVO;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenterIpAddressVO;
|
||||
|
|
@ -226,7 +227,8 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
|
|||
@Inject protected StoragePoolHostDao _storagePoolHostDao = null;
|
||||
@Inject protected GuestOSCategoryDao _guestOSCategoryDao = null;
|
||||
@Inject protected DetailsDao _hostDetailsDao = null;
|
||||
@Inject protected ClusterDao _clusterDao;
|
||||
@Inject protected ClusterDao _clusterDao = null;
|
||||
@Inject protected ClusterDetailsDao _clusterDetailsDao = null;
|
||||
|
||||
@Inject(adapter=DeploymentPlanner.class)
|
||||
private Adapters<DeploymentPlanner> _planners;
|
||||
|
|
@ -579,10 +581,8 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
|
|||
try {
|
||||
cluster = _clusterDao.persist(cluster);
|
||||
} catch (Exception e) {
|
||||
cluster = _clusterDao.findBy(clusterName, podId);
|
||||
if (cluster == null) {
|
||||
throw new CloudRuntimeException("Unable to create cluster " + clusterName + " in pod " + podId + " and data center " + dcId, e);
|
||||
}
|
||||
// no longer tolerate exception during the cluster creation phase
|
||||
throw new CloudRuntimeException("Unable to create cluster " + clusterName + " in pod " + podId + " and data center " + dcId, e);
|
||||
}
|
||||
clusterId = cluster.getId();
|
||||
result.add(cluster);
|
||||
|
|
@ -591,6 +591,13 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
|
|||
return result;
|
||||
}
|
||||
|
||||
// save cluster details for later cluster/host cross-checking
|
||||
Map<String, String> details = new HashMap<String, String>();
|
||||
details.put("url", url);
|
||||
details.put("username", username);
|
||||
details.put("password", password);
|
||||
_clusterDetailsDao.persist(cluster.getId(), details);
|
||||
|
||||
boolean success = false;
|
||||
try {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import com.cloud.configuration.dao.ResourceLimitDaoImpl;
|
|||
import com.cloud.consoleproxy.AgentBasedStandaloneConsoleProxyManager;
|
||||
import com.cloud.dao.EntityManager;
|
||||
import com.cloud.dao.EntityManagerImpl;
|
||||
import com.cloud.dc.ClusterDetailsDaoImpl;
|
||||
import com.cloud.dc.dao.AccountVlanMapDaoImpl;
|
||||
import com.cloud.dc.dao.ClusterDaoImpl;
|
||||
import com.cloud.dc.dao.DataCenterDaoImpl;
|
||||
|
|
@ -234,6 +235,7 @@ public class DefaultComponentLibrary implements ComponentLibrary {
|
|||
addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
|
||||
addDao("PortForwardingRulesDao", PortForwardingRulesDaoImpl.class);
|
||||
addDao("UsageEventDao", UsageEventDaoImpl.class);
|
||||
addDao("ClusterDetailsDao", ClusterDetailsDaoImpl.class);
|
||||
}
|
||||
|
||||
Map<String, ComponentInfo<Manager>> _managers = new HashMap<String, ComponentInfo<Manager>>();
|
||||
|
|
|
|||
|
|
@ -58,11 +58,7 @@ function hostToMidmenu(jsonObj, $midmenuItem1) {
|
|||
$iconContainer.find("#icon").attr("src", "images/midmenuicon_host.png");
|
||||
|
||||
$midmenuItem1.find("#first_row").text(fromdb(jsonObj.name).substring(0,25));
|
||||
|
||||
if(!!jsonObj.clustertype && jsonObj.clustertype == "ExternalManaged")
|
||||
$midmenuItem1.find("#second_row").text("Externally managed cluster");
|
||||
else
|
||||
$midmenuItem1.find("#second_row").text(jsonObj.ipaddress.substring(0,25));
|
||||
$midmenuItem1.find("#second_row").text(jsonObj.ipaddress.substring(0,25));
|
||||
|
||||
updateHostStateInMidMenu(jsonObj, $midmenuItem1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue