Examples of DedicatedResourceVO


Examples of com.cloud.dc.DedicatedResourceVO

        if (isPublic != null && isPublic) {
            zone.setDomainId(null);
            zone.setDomain(null);

            // release the dedication for this zone
            DedicatedResourceVO resource = _dedicatedDao.findByZoneId(zoneId);
            Long resourceId = null;
            if (resource != null) {
                resourceId = resource.getId();
                if (!_dedicatedDao.remove(resourceId)) {
                    throw new CloudRuntimeException("Failed to delete dedicated Zone Resource " + resourceId);
                }
                // find the group associated and check if there are any more
                // resources under that group
                List<DedicatedResourceVO> resourcesInGroup = _dedicatedDao.listByAffinityGroupId(resource.getAffinityGroupId());
                if (resourcesInGroup.isEmpty()) {
                    // delete the group
                    _affinityGroupService.deleteAffinityGroup(resource.getAffinityGroupId(), null, null, null);
                }
            }
        }

        if (!_zoneDao.update(zoneId, zone)) {
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

            zone = _zoneDao.persist(zone);
            if (domainId != null) {
                // zone is explicitly dedicated to this domain
                // create affinity group associated and dedicate the zone.
                AffinityGroup group = createDedicatedAffinityGroup(null, domainId, null);
                DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(zone.getId(), null, null, null,
                        domainId, null, group.getId());
                _dedicatedDao.persist(dedicatedResource);
            }

            // Create default system networks
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

                    "Cannot perform this operation, Zone is currently disabled: "
                            + zone.getId());
        }

        // check if zone is dedicated
        DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(zone.getId());
        if (dedicatedZone != null) {
            DomainVO domain = _domainDao.findById(dedicatedZone.getDomainId());
            if (domain == null) {
                throw new CloudRuntimeException("Unable to find the domain "
                        + zone.getDomainId() + " for the zone: " + zone);
            }
            // check that caller can operate with domain
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

        return migratedVm;
    }

    private boolean checkIfHostIsDedicated(HostVO host) {
        long hostId = host.getId();
        DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId);
        DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId());
        DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId());
        if(dedicatedHost != null || dedicatedClusterOfHost != null || dedicatedPodOfHost != null) {
            return true;
        } else {
            return false;
        }
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

        }
    }

    private Long accountOfDedicatedHost(HostVO host) {
        long hostId = host.getId();
        DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId);
        DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId());
        DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId());
        if(dedicatedHost != null) {
            return dedicatedHost.getAccountId();
        }
        if(dedicatedClusterOfHost != null) {
            return dedicatedClusterOfHost.getAccountId();
        }
        if(dedicatedPodOfHost != null) {
            return dedicatedPodOfHost.getAccountId();
        }
        return null;
    }
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

        return null;
    }

    private Long domainOfDedicatedHost(HostVO host) {
        long hostId = host.getId();
        DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId);
        DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId());
        DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId());
        if(dedicatedHost != null) {
            return dedicatedHost.getDomainId();
        }
        if(dedicatedClusterOfHost != null) {
            return dedicatedClusterOfHost.getDomainId();
        }
        if(dedicatedPodOfHost != null) {
            return dedicatedPodOfHost.getDomainId();
        }
        return null;
    }
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

        if (isPublic != null && isPublic) {
            zone.setDomainId(null);
            zone.setDomain(null);

            // release the dedication for this zone
            DedicatedResourceVO resource = _dedicatedDao.findByZoneId(zoneId);
            Long resourceId = null;
            if (resource != null) {
                resourceId = resource.getId();
                if (!_dedicatedDao.remove(resourceId)) {
                    throw new CloudRuntimeException("Failed to delete dedicated Zone Resource " + resourceId);
                }
                // find the group associated and check if there are any more
                // resources under that group
                List<DedicatedResourceVO> resourcesInGroup = _dedicatedDao.listByAffinityGroupId(resource.getAffinityGroupId());
                if (resourcesInGroup.isEmpty()) {
                    // delete the group
                    _affinityGroupService.deleteAffinityGroup(resource.getAffinityGroupId(), null, null, null);
                }
            }
        }

        if (!_zoneDao.update(zoneId, zone)) {
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

                DataCenterVO zone = _zoneDao.persist(zoneFinal);
            if (domainId != null) {
                // zone is explicitly dedicated to this domain
                // create affinity group associated and dedicate the zone.
                AffinityGroup group = createDedicatedAffinityGroup(null, domainId, null);
                    DedicatedResourceVO dedicatedResource = new DedicatedResourceVO(zone.getId(), null, null, null, domainId, null, group.getId());
                _dedicatedDao.persist(dedicatedResource);
            }

            // Create default system networks
            createDefaultSystemNetworks(zone.getId());
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

                    "Cannot perform this operation, Zone is currently disabled: "
                            + zone.getId());
        }

        // check if zone is dedicated
        DedicatedResourceVO dedicatedZone = _dedicatedDao.findByZoneId(zone.getId());
        if (dedicatedZone != null) {
            DomainVO domain = _domainDao.findById(dedicatedZone.getDomainId());
            if (domain == null) {
                throw new CloudRuntimeException("Unable to find the domain " + zone.getDomainId() + " for the zone: " + zone);
            }
            // check that caller can operate with domain
            _configMgr.checkZoneAccess(caller, zone);
View Full Code Here

Examples of com.cloud.dc.DedicatedResourceVO

        }
    }

    private boolean checkIfHostIsDedicated(HostVO host) {
        long hostId = host.getId();
        DedicatedResourceVO dedicatedHost = _dedicatedDao.findByHostId(hostId);
        DedicatedResourceVO dedicatedClusterOfHost = _dedicatedDao.findByClusterId(host.getClusterId());
        DedicatedResourceVO dedicatedPodOfHost = _dedicatedDao.findByPodId(host.getPodId());
        if (dedicatedHost != null || dedicatedClusterOfHost != null || dedicatedPodOfHost != null) {
            return true;
        } else {
            return false;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.