Package com.cloud.dc

Examples of com.cloud.dc.ClusterVO


                CapacityState capacityState = (allocationState == AllocationState.Disabled) ? CapacityState.Disabled
                        : CapacityState.Enabled;
                capacity.setCapacityState(capacityState);
            } else {
                if (storagePool.getClusterId() != null) {
                    ClusterVO cluster = ApiDBUtils.findClusterById(storagePool.getClusterId());
                    if (cluster != null) {
                        AllocationState allocationState = _configMgr.findClusterAllocationState(cluster);
                        CapacityState capacityState = (allocationState == AllocationState.Disabled) ? CapacityState.Disabled
                                : CapacityState.Enabled;
                        capacity.setCapacityState(capacityState);
View Full Code Here


        }

        if (hypervisorType.equals(HypervisorType.KVM)) {
            List<HostVO> hosts = null;
            if(scope.equals(ScopeType.CLUSTER)){
                ClusterVO cluster = _clusterDao.findById(storagePool.getClusterId());
                hosts = _resourceMgr.listAllHostsInCluster(cluster.getId());
            } else if (scope.equals(ScopeType.ZONE)){
                hosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(hypervisorType, volume.getDataCenterId());
            }
            if (hosts != null && !hosts.isEmpty()) {
                HostVO host = hosts.get(0);
View Full Code Here

            return false;
        }

        Long clusterId = pool.getClusterId();
        if (clusterId != null) {
            ClusterVO cluster = _clusterDao.findById(clusterId);
            if (!(cluster.getHypervisorType() == dskCh.getHypervisorType())) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("StoragePool's Cluster does not have required hypervisorType, skipping this pool");
                }
                return false;
            }
View Full Code Here

        HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), "10.223.0.1", "10.233.2.2/25", 8, "test");
        pod = podDao.persist(pod);
        podId = pod.getId();
        // create xen cluster
        ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
        cluster.setHypervisorType(Hypervisor.HypervisorType.XenServer.toString());
        cluster.setClusterType(Cluster.ClusterType.CloudManaged);
        cluster.setManagedState(Managed.ManagedState.Managed);
        cluster = clusterDao.persist(cluster);
        clusterId = cluster.getId();

        imageStore = new ImageStoreVO();
        imageStore.setName(UUID.randomUUID().toString());
        imageStore.setDataCenterId(dcId);
        imageStore.setProviderName(DataStoreProvider.NFS_IMAGE);
View Full Code Here

        HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), "255.255.255.255", "", 8, "test");
        pod = podDao.persist(pod);
        podId = pod.getId();

        ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
        cluster.setHypervisorType(HypervisorType.XenServer.toString());
        cluster.setClusterType(ClusterType.CloudManaged);
        cluster.setManagedState(ManagedState.Managed);
        cluster = clusterDao.persist(cluster);
        clusterId = cluster.getId();

        DataStoreProvider provider = providerMgr.getDataStoreProvider(DataStoreProvider.DEFAULT_PRIMARY);
        storage = new StoragePoolVO();
        storage.setDataCenterId(dcId);
        storage.setPodId(podId);
View Full Code Here

        HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), this.getHostGateway(), this.getHostCidr(), 8, "test");
        pod = podDao.persist(pod);
        podId = pod.getId();
        // create xen cluster
        ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
        cluster.setHypervisorType(HypervisorType.XenServer.toString());
        cluster.setClusterType(ClusterType.CloudManaged);
        cluster.setManagedState(ManagedState.Managed);
        cluster = clusterDao.persist(cluster);
        clusterId = cluster.getId();
        // create xen host

        host = new HostVO(this.getHostGuid());
        host.setName("devcloud xen host");
        host.setType(Host.Type.Routing);
        host.setPrivateIpAddress(this.getHostIp());
        host.setDataCenterId(dc.getId());
        host.setVersion("6.0.1");
        host.setAvailable(true);
        host.setSetup(true);
        host.setPodId(podId);
        host.setLastPinged(0);
        host.setResourceState(ResourceState.Enabled);
        host.setHypervisorType(HypervisorType.XenServer);
        host.setClusterId(cluster.getId());

        host = hostDao.persist(host);

        imageStore = new ImageStoreVO();
        imageStore.setName("test");
View Full Code Here

            } catch (ConfigurationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        } else if (host.getHypervisorType() == HypervisorType.VMware) {
            ClusterVO cluster = clusterDao.findById(host.getClusterId());
            String url = clusterDetailsDao.findDetail(cluster.getId(), "url").getValue();
            URI uri;
            try {
                uri = new URI(url);
                String userName = clusterDetailsDao.findDetail(cluster.getId(), "username").getValue();
                String password = clusterDetailsDao.findDetail(cluster.getId(), "password").getValue();
                VmwareServerDiscoverer discover = new VmwareServerDiscoverer();

                Map<? extends ServerResource, Map<String, String>> resources =
                    discover.find(host.getDataCenterId(), host.getPodId(), host.getClusterId(), uri, userName, password, null);
                for (Map.Entry<? extends ServerResource, Map<String, String>> entry : resources.entrySet()) {
View Full Code Here

            HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), this.getHostGateway(), this.getHostCidr(), 8, "test");
            pod = podDao.persist(pod);
            podId = pod.getId();
            // create xen cluster
            ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
            cluster.setHypervisorType(HypervisorType.VMware.toString());
            cluster.setClusterType(ClusterType.ExternalManaged);
            cluster.setManagedState(ManagedState.Managed);
            cluster = clusterDao.persist(cluster);
            clusterId = cluster.getId();

            // setup vcenter
            ClusterDetailsVO clusterDetailVO = new ClusterDetailsVO(cluster.getId(), "url", null);
            this.clusterDetailsDao.persist(clusterDetailVO);
            clusterDetailVO = new ClusterDetailsVO(cluster.getId(), "username", null);
            this.clusterDetailsDao.persist(clusterDetailVO);
            clusterDetailVO = new ClusterDetailsVO(cluster.getId(), "password", null);
            this.clusterDetailsDao.persist(clusterDetailVO);
            // create xen host

            host = new HostVO(this.getHostGuid());
            host.setName("devcloud vmware host");
            host.setType(Host.Type.Routing);
            host.setPrivateIpAddress(this.getHostIp());
            host.setDataCenterId(dc.getId());
            host.setVersion("6.0.1");
            host.setAvailable(true);
            host.setSetup(true);
            host.setPodId(podId);
            host.setLastPinged(0);
            host.setResourceState(ResourceState.Enabled);
            host.setHypervisorType(HypervisorType.VMware);
            host.setClusterId(cluster.getId());

            host = hostDao.persist(host);

            imageStore = new ImageStoreVO();
            imageStore.setName(imageStoreName);
View Full Code Here

            HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), this.getHostGateway(), this.getHostCidr(), 8, "test");
            pod = podDao.persist(pod);
            podId = pod.getId();
            // create xen cluster
            ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
            cluster.setHypervisorType(this.getHypervisor().toString());
            cluster.setClusterType(ClusterType.CloudManaged);
            cluster.setManagedState(ManagedState.Managed);
            cluster = clusterDao.persist(cluster);
            clusterId = cluster.getId();
            // create xen host

            host = new HostVO(this.getHostGuid());
            host.setName("devcloud xen host");
            host.setType(Host.Type.Routing);
            host.setPrivateIpAddress(this.getHostIp());
            host.setDataCenterId(dc.getId());
            host.setVersion("6.0.1");
            host.setAvailable(true);
            host.setSetup(true);
            host.setPodId(podId);
            host.setLastPinged(0);
            host.setResourceState(ResourceState.Enabled);
            host.setHypervisorType(this.getHypervisor());
            host.setClusterId(cluster.getId());

            host = hostDao.persist(host);

            imageStore = new ImageStoreVO();
            imageStore.setName(imageStoreName);
View Full Code Here

            HostPodVO pod = new HostPodVO(UUID.randomUUID().toString(), dc.getId(), this.getHostGateway(), this.getHostCidr(), 8, "test");
            pod = podDao.persist(pod);
            podId = pod.getId();
            // create xen cluster
            ClusterVO cluster = new ClusterVO(dc.getId(), pod.getId(), "devcloud cluster");
            cluster.setHypervisorType(this.getHypervisor().toString());
            cluster.setClusterType(ClusterType.CloudManaged);
            cluster.setManagedState(ManagedState.Managed);
            cluster = clusterDao.persist(cluster);
            clusterId = cluster.getId();
            // create xen host

            host = new HostVO(this.getHostGuid());
            host.setName("devcloud xen host");
            host.setType(Host.Type.Routing);
            host.setPrivateIpAddress(this.getHostIp());
            host.setDataCenterId(dc.getId());
            host.setVersion("6.0.1");
            host.setAvailable(true);
            host.setSetup(true);
            host.setPodId(podId);
            host.setLastPinged(0);
            host.setResourceState(ResourceState.Enabled);
            host.setHypervisorType(this.getHypervisor());
            host.setClusterId(cluster.getId());

            host = hostDao.persist(host);

            imageStore = new ImageStoreVO();
            imageStore.setName(imageStoreName);
View Full Code Here

TOP

Related Classes of com.cloud.dc.ClusterVO

Copyright © 2018 www.massapicom. 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.