Examples of VirtualMachineProfile


Examples of com.cloud.vm.VirtualMachineProfile

        verify(testOrchastrator._networksDao, times(1)).findById(nic.getNetworkId());
    }
    @Test
    public void testDontRemoveDhcpServiceWhenNotProvided() {
        // make local mocks
        VirtualMachineProfile vm =  mock(VirtualMachineProfile.class);
        NicVO nic = mock(NicVO.class);
        NetworkVO network = mock(NetworkVO.class);

        // make sure that release dhcp will *not* be called
        when(vm.getType()).thenReturn(Type.User);
        when(testOrchastrator._networkModel.areServicesSupportedInNetwork(network.getId(), Service.Dhcp)).thenReturn(false);

        when(network.getGuruName()).thenReturn(guruName);
        when(testOrchastrator._networksDao.findById(nic.getNetworkId())).thenReturn(network);

View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            storage.setStorageProviderName(provider.getName());
            StoragePoolVO newStorage = storagePoolDao.persist(storage);
            newStorageId = newStorage.getId();

            DiskProfile profile = new DiskProfile(volume, diskOffering, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
                List<StoragePool> pools = allocator.allocateToPool(profile, vmProfile, plan, new ExcludeList(), 1);
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

    @Test
    public void testClusterAllocator() {
        try {
            createDb();
            DiskProfile profile = new DiskProfile(volume, diskOffering, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
                List<StoragePool> pools = allocator.allocateToPool(profile, vmProfile, plan, new ExcludeList(), 1);
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            tags.add("high");
            diskOff.setTagsArray(tags);
            diskOfferingDao.update(diskOff.getId(), diskOff);

            DiskProfile profile = new DiskProfile(volume, diskOff, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
                List<StoragePool> pools = allocator.allocateToPool(profile, vmProfile, plan, new ExcludeList(), 1);
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            tags.add("low");
            diskOff.setTagsArray(tags);
            diskOfferingDao.update(diskOff.getId(), diskOff);

            DiskProfile profile = new DiskProfile(volume, diskOff, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
                List<StoragePool> pools = allocator.allocateToPool(profile, vmProfile, plan, new ExcludeList(), 1);
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            pool.setClusterId(null);
            pool.setPodId(null);
            storagePoolDao.update(pool.getId(), pool);

            DiskProfile profile = new DiskProfile(volume, diskOffering, HypervisorType.KVM);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(vmProfile.getHypervisorType()).thenReturn(HypervisorType.KVM);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            Mockito.when(storageMgr.storagePoolHasEnoughIops(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            pool.setClusterId(null);
            pool.setPodId(null);
            storagePoolDao.update(pool.getId(), pool);

            DiskProfile profile = new DiskProfile(volume, diskOffering, HypervisorType.KVM);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Account account = Mockito.mock(Account.class);
            Mockito.when(account.getAccountId()).thenReturn(1L);
            Mockito.when(vmProfile.getHypervisorType()).thenReturn(HypervisorType.KVM);
            Mockito.when(vmProfile.getOwner()).thenReturn(account);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            Mockito.when(storageMgr.storagePoolHasEnoughIops(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            pool.setScope(ScopeType.ZONE);
            pool.setStatus(StoragePoolStatus.Maintenance);
            storagePoolDao.update(pool.getId(), pool);

            DiskProfile profile = new DiskProfile(volume, diskOffering, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
                List<StoragePool> pools = allocator.allocateToPool(profile, vmProfile, plan, new ExcludeList(), 1);
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            DiskOfferingVO diskOff = diskOfferingDao.findById(diskOfferingId);
            diskOff.setUseLocalStorage(true);
            diskOfferingDao.update(diskOfferingId, diskOff);

            DiskProfile profile = new DiskProfile(volume, diskOff, HypervisorType.XenServer);
            VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);
            Mockito.when(storageMgr.storagePoolHasEnoughSpace(Matchers.anyListOf(Volume.class), Matchers.any(StoragePool.class))).thenReturn(true);
            DeploymentPlan plan = new DataCenterDeployment(dcId, podId, clusterId, null, null, null);
            int foundAcct = 0;
            for (StoragePoolAllocator allocator : allocators) {
                List<StoragePool> pools = allocator.allocateToPool(profile, vmProfile, plan, new ExcludeList(), 1);
View Full Code Here

Examples of com.cloud.vm.VirtualMachineProfile

            if (cluster != null) {
                podId = cluster.getPodId();
            }
        }

        VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm);
        for (StoragePoolAllocator allocator : _storagePoolAllocators) {

            ExcludeList avoidList = new ExcludeList();
            for (StoragePool pool : avoid) {
                avoidList.addPool(pool.getId());
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.