@Override public List<DedicatedResourceVO> doInTransaction(TransactionStatus status) { // find or create the affinity group by name under this account/domain AffinityGroup group = findOrCreateDedicatedAffinityGroup(domainId, accountIdFinal); if (group == null) { s_logger.error("Unable to dedicate zone due to, failed to create dedication affinity group"); throw new CloudRuntimeException("Failed to dedicate zone. Please contact Cloud Support."); } DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(null, null, clusterId, null, null, null, group.getId()); try { dedicatedResource.setDomainId(domainId); if (accountIdFinal != null) { dedicatedResource.setAccountId(accountIdFinal); } dedicatedResource = _dedicatedDao.persist(dedicatedResource); } catch (Exception e) { s_logger.error("Unable to dedicate cluster due to " + e.getMessage(), e); throw new CloudRuntimeException("Failed to dedicate cluster. Please contact Cloud Support.", e); } List<DedicatedResourceVO> result = new ArrayList<DedicatedResourceVO>(); result.add(dedicatedResource); return result; } });
@Override public List<DedicatedResourceVO> doInTransaction(TransactionStatus status) { // find or create the affinity group by name under this account/domain AffinityGroup group = findOrCreateDedicatedAffinityGroup(domainId, accountIdFinal); if (group == null) { s_logger.error("Unable to dedicate zone due to, failed to create dedication affinity group"); throw new CloudRuntimeException("Failed to dedicate zone. Please contact Cloud Support."); } DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(null, podId, null, null, null, null, group.getId()); try { dedicatedResource.setDomainId(domainId); if (accountIdFinal != null) { dedicatedResource.setAccountId(accountIdFinal); } dedicatedResource = _dedicatedDao.persist(dedicatedResource); } catch (Exception e) { s_logger.error("Unable to dedicate pod due to " + e.getMessage(), e); throw new CloudRuntimeException("Failed to dedicate pod. Please contact Cloud Support."); } List<DedicatedResourceVO> result = new ArrayList<DedicatedResourceVO>(); result.add(dedicatedResource); return result; } });
@Override public List<DedicatedResourceVO> doInTransaction(TransactionStatus status) { // find or create the affinity group by name under this account/domain AffinityGroup group = findOrCreateDedicatedAffinityGroup(domainId, accountIdFinal); if (group == null) { s_logger.error("Unable to dedicate zone due to, failed to create dedication affinity group"); throw new CloudRuntimeException("Failed to dedicate zone. Please contact Cloud Support."); } DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(null, null, null, hostId, null, null, group.getId()); try { dedicatedResource.setDomainId(domainId); if (accountIdFinal != null) { dedicatedResource.setAccountId(accountIdFinal); } dedicatedResource = _dedicatedDao.persist(dedicatedResource); } catch (Exception e) { s_logger.error("Unable to dedicate host due to " + e.getMessage(), e); throw new CloudRuntimeException("Failed to dedicate host. Please contact Cloud Support.", e); } List<DedicatedResourceVO> result = new ArrayList<DedicatedResourceVO>(); result.add(dedicatedResource); return result; } });
@Override public List<DedicatedResourceVO> doInTransaction(TransactionStatus status) { // find or create the affinity group by name under this account/domain AffinityGroup group = findOrCreateDedicatedAffinityGroup(domainId, accountIdFinal); if (group == null) { s_logger.error("Unable to dedicate zone due to, failed to create dedication affinity group"); throw new CloudRuntimeException("Failed to dedicate zone. Please contact Cloud Support."); } DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(zoneId, null, null, null, null, null, group.getId()); try { dedicatedResource.setDomainId(domainId); if (accountIdFinal != null) { dedicatedResource.setAccountId(accountIdFinal); } dedicatedResource = _dedicatedDao.persist(dedicatedResource); // save the domainId in the zone dc.setDomainId(domainId); if (!_zoneDao.update(zoneId, dc)) { throw new CloudRuntimeException("Failed to dedicate zone, could not set domainId. Please contact Cloud Support."); } } catch (Exception e) { s_logger.error("Unable to dedicate zone due to " + e.getMessage(), e); throw new CloudRuntimeException("Failed to dedicate zone. Please contact Cloud Support."); } List<DedicatedResourceVO> result = new ArrayList<DedicatedResourceVO>(); result.add(dedicatedResource); return result; } });
@Override public DataCenterVO doInTransaction(final TransactionStatus status) { final DataCenterVO zone = _zoneDao.persist(zoneFinal); CallContext.current().putContextParameter(DataCenter.class, zone.getUuid()); if (domainId != null) { // zone is explicitly dedicated to this domain // create affinity group associated and dedicate the zone. final AffinityGroup group = createDedicatedAffinityGroup(null, domainId, null); final DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(zone.getId(), null, null, null, domainId, null, group.getId()); _dedicatedDao.persist(dedicatedResource); } // Create default system networks createDefaultSystemNetworks(zone.getId()); return zone; } });