@DB @Override public boolean deleteDataStore(DataStore store) { List<StoragePoolHostVO> hostPoolRecords = _storagePoolHostDao.listByPoolId(store.getId()); StoragePool pool = (StoragePool)store; boolean deleteFlag = false;
@Override public Scope getScope() { StoragePoolVO vo = dataStoreDao.findById(pdsv.getId()); if (vo.getScope() == ScopeType.CLUSTER) { return new ClusterScope(vo.getClusterId(), vo.getPodId(), vo.getDataCenterId()); } else if (vo.getScope() == ScopeType.ZONE) { return new ZoneScope(vo.getDataCenterId()); } else if (vo.getScope() == ScopeType.HOST) { List<StoragePoolHostVO> poolHosts = poolHostDao.listByPoolId(vo.getId()); if (poolHosts.size() > 0) { return new HostScope(poolHosts.get(0).getHostId(), vo.getClusterId(), vo.getDataCenterId()); } s_logger.debug("can't find a local storage in pool host table: " + vo.getId()); } return null; }
@SuppressWarnings("finally") @Override public boolean deleteDataStore(DataStore store) { List<StoragePoolHostVO> hostPoolRecords = _storagePoolHostDao.listByPoolId(store.getId()); StoragePool pool = (StoragePool) store;
List<StoragePoolHostVO> stoargePoolHostVO = _storagePoolHostDao.listByPoolId(storagePool.getId());
public boolean deletePrimaryDataStore(DataStore store) { List<StoragePoolHostVO> hostPoolRecords = this.storagePoolHostDao.listByPoolId(store.getId()); StoragePoolVO poolVO = this.dataStoreDao.findById(store.getId()); TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); for (StoragePoolHostVO host : hostPoolRecords) { storagePoolHostDao.deleteStoragePoolHostDetails(host.getHostId(), host.getPoolId()); } poolVO.setUuid(null); this.dataStoreDao.update(poolVO.getId(), poolVO); dataStoreDao.remove(poolVO.getId()); dataStoreDao.deletePoolTags(poolVO.getId()); deletePoolStats(poolVO.getId()); // Delete op_host_capacity entries this._capacityDao.removeBy(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED, null, null, null, poolVO.getId()); txn.commit(); s_logger.debug("Storage pool id=" + poolVO.getId() + " is removed successfully"); return true; }
@Override public boolean deleteDataStore(DataStore dataStore) { List<StoragePoolHostVO> hostPoolRecords = storagePoolHostDao.listByPoolId(dataStore.getId());