zone.setDnsProvider(Network.Provider.ExternalDhcpServer.getName()); zone.setDhcpProvider(Network.Provider.ExternalDhcpServer.getName()); _dcDao.update(zone.getId(), zone);
@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 void doInTransactionWithoutResult(TransactionStatus status) { Long resourceId = resourceFinal.getId(); if (!_dedicatedDao.remove(resourceId)) { throw new CloudRuntimeException("Failed to delete Resource " + resourceId); } if (zoneId != null) { // remove the domainId set in zone DataCenterVO dc = _zoneDao.findById(zoneId); if (dc != null) { dc.setDomainId(null); dc.setDomain(null); if (!_zoneDao.update(zoneId, dc)) { throw new CloudRuntimeException("Failed to release dedicated zone, could not clear domainId. Please contact Cloud Support."); } } } } });
privateIp = new PrivateIpVO(startIp, privateNetwork.getId(), nextMac, vpcId, sourceNat); _privateIpDao.persist(privateIp); _dcDao.update(dc.getId(), dc);
if (!_zoneDao.update(zoneId, zone)) { throw new CloudRuntimeException("Failed to edit zone. Please contact Cloud Support.");
_privateIpDao.persist(privateIp); _dcDao.update(dc.getId(), dc);