mirror of https://github.com/apache/cloudstack.git
cluster guid is set up when old host reconnect happens after upgrade, prohibit adding host to the cluster before guid is etup
This commit is contained in:
parent
71f968a3e1
commit
b219d3e83e
|
|
@ -73,6 +73,7 @@ import com.cloud.agent.manager.allocator.PodAllocator;
|
|||
import com.cloud.agent.transport.Request;
|
||||
import com.cloud.agent.transport.Response;
|
||||
import com.cloud.alert.AlertManager;
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.commands.AddClusterCmd;
|
||||
import com.cloud.api.commands.AddHostCmd;
|
||||
import com.cloud.api.commands.AddSecondaryStorageCmd;
|
||||
|
|
@ -792,6 +793,20 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
|
|||
clusterName = "Standalone-" + url;
|
||||
}
|
||||
|
||||
if ( clusterId != null ) {
|
||||
ClusterVO cluster = _clusterDao.findById(clusterId);
|
||||
if ( cluster == null ) {
|
||||
throw new InvalidParameterValueException("can not fine cluster for clusterId " + clusterId);
|
||||
} else {
|
||||
if ( cluster.getGuid() == null ) {
|
||||
List<HostVO> hosts = _hostDao.listByCluster(clusterId);
|
||||
if ( ! hosts.isEmpty() ) {
|
||||
throw new CloudRuntimeException("Guid is not updated for cluster " + clusterId + " need to wait hosts in this cluster up");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.getHypervisor().equalsIgnoreCase(Hypervisor.HypervisorType.BareMetal.toString())) {
|
||||
if (memCapacity == null) {
|
||||
memCapacity = Long.valueOf(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue