void setClusterGuid(ClusterVO cluster, String guid) { cluster.setGuid(guid); try { _clusterDao.update(cluster.getId(), cluster); } catch (EntityExistsException e) { QueryBuilder<ClusterVO> sc = QueryBuilder.create(ClusterVO.class); sc.and(sc.entity().getGuid(), Op.EQ, guid); List<ClusterVO> clusters = sc.list(); ClusterVO clu = clusters.get(0); List<HostVO> clusterHosts = _resourceMgr.listAllHostsInCluster(clu.getId()); if (clusterHosts == null || clusterHosts.size() == 0) { clu.setGuid(null); _clusterDao.update(clu.getId(), clu); _clusterDao.update(cluster.getId(), cluster); return; } throw e; } }
_clusterDao.update(clusterId, cluster);
if (clu.getGuid() == null) { clu.setGuid(UUID.randomUUID().toString()); _clusterDao.update(clusterId, clu);
clu.setGuid(UUID.randomUUID().toString()); clusterDao.update(clusterId, clu); Map<String, String> clusterDetails = clusterDetailsDao .findDetails(clusterId);
if (clu.getGuid() == null) { clu.setGuid(UUID.randomUUID().toString()); _clusterDao.update(clusterId, clu);
_clusterDao.update(clusterId, clu);
_clusterDao.update(clusterId, cluster);
if (cluster.getGuid() == null) { cluster.setGuid(startup.getPool()); _clusterDao.update(cluster.getId(), cluster); } else if (!cluster.getGuid().equals(startup.getPool())) { String msg = "pool uuid for cluster " + cluster.getId() + " changed from " + cluster.getGuid() + " to " + startup.getPool();
if (cluster.getGuid() == null) { cluster.setGuid(startup.getPool()); _clusterDao.update(cluster.getId(), cluster);
_clusterDao.update(cluster.getId(), cluster); try { cluster.setManagedState(Managed.ManagedState.PrepareUnmanaged); _clusterDao.update(cluster.getId(), cluster); List<HostVO> hosts = listAllHosts(Host.Type.Routing, cluster.getId(), cluster.getPodId(), cluster.getDataCenterId()); for (final HostVO host : hosts) { _clusterDao.update(cluster.getId(), cluster); _clusterDao.update(cluster.getId(), cluster);
final ClusterVO cluster = _clusterDao.findById(clusterId); cluster.setGuid(null); _clusterDao.update(clusterId, cluster);