use of com.cloud.engine.subsystem.api.storage.DataStoreDriver in project cosmic by MissionCriticalCloud.
the class CapacityManagerImpl method getUsedBytes.
@Override
public long getUsedBytes(final StoragePoolVO pool) {
final DataStoreProvider storeProvider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
final DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
if (storeDriver instanceof PrimaryDataStoreDriver) {
final PrimaryDataStoreDriver primaryStoreDriver = (PrimaryDataStoreDriver) storeDriver;
return primaryStoreDriver.getUsedBytes(pool);
}
throw new CloudRuntimeException("Storage driver in CapacityManagerImpl.getUsedBytes(StoragePoolVO) is not a PrimaryDataStoreDriver.");
}
use of com.cloud.engine.subsystem.api.storage.DataStoreDriver in project cosmic by MissionCriticalCloud.
the class CapacityManagerImpl method getUsedIops.
@Override
public long getUsedIops(final StoragePoolVO pool) {
final DataStoreProvider storeProvider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
final DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
if (storeDriver instanceof PrimaryDataStoreDriver) {
final PrimaryDataStoreDriver primaryStoreDriver = (PrimaryDataStoreDriver) storeDriver;
return primaryStoreDriver.getUsedIops(pool);
}
throw new CloudRuntimeException("Storage driver in CapacityManagerImpl.getUsedIops(StoragePoolVO) is not a PrimaryDataStoreDriver.");
}
use of com.cloud.engine.subsystem.api.storage.DataStoreDriver in project cosmic by MissionCriticalCloud.
the class QueryManagerImpl method searchForStoragePools.
@Override
public ListResponse<StoragePoolResponse> searchForStoragePools(final ListStoragePoolsCmd cmd) {
final Pair<List<StoragePoolJoinVO>, Integer> result = searchForStoragePoolsInternal(cmd);
final ListResponse<StoragePoolResponse> response = new ListResponse<>();
final List<StoragePoolResponse> poolResponses = ViewResponseHelper.createStoragePoolResponse(result.first().toArray(new StoragePoolJoinVO[result.first().size()]));
for (final StoragePoolResponse poolResponse : poolResponses) {
final DataStore store = dataStoreManager.getPrimaryDataStore(poolResponse.getId());
if (store != null) {
final DataStoreDriver driver = store.getDriver();
if (driver != null && driver.getCapabilities() != null) {
poolResponse.setCaps(driver.getCapabilities());
}
}
}
response.setResponses(poolResponses, result.second());
return response;
}
use of com.cloud.engine.subsystem.api.storage.DataStoreDriver in project cosmic by MissionCriticalCloud.
the class QueryManagerImpl method searchForVolumes.
@Override
public ListResponse<VolumeResponse> searchForVolumes(final ListVolumesCmd cmd) {
final Pair<List<VolumeJoinVO>, Integer> result = searchForVolumesInternal(cmd);
final ListResponse<VolumeResponse> response = new ListResponse<>();
ResponseView respView = ResponseView.Restricted;
if (cmd instanceof ListVolumesCmdByAdmin) {
respView = ResponseView.Full;
}
final List<VolumeResponse> volumeResponses = ViewResponseHelper.createVolumeResponse(respView, result.first().toArray(new VolumeJoinVO[result.first().size()]));
for (final VolumeResponse vr : volumeResponses) {
final String poolId = vr.getStoragePoolId();
if (poolId == null) {
continue;
}
final DataStore store = dataStoreManager.getPrimaryDataStore(poolId);
if (store == null) {
continue;
}
final DataStoreDriver driver = store.getDriver();
if (driver == null) {
continue;
}
final Map<String, String> caps = driver.getCapabilities();
if (caps != null) {
final boolean quiescevm = Boolean.parseBoolean(caps.get(DataStoreCapabilities.VOLUME_SNAPSHOT_QUIESCEVM.toString()));
vr.setNeedQuiescevm(quiescevm);
}
}
response.setResponses(volumeResponses, result.second());
return response;
}
use of com.cloud.engine.subsystem.api.storage.DataStoreDriver in project cosmic by MissionCriticalCloud.
the class StorageManagerImpl method getVolumeSizeIncludingHypervisorSnapshotReserve.
private long getVolumeSizeIncludingHypervisorSnapshotReserve(final Volume volume, final StoragePool pool) {
final DataStoreProvider storeProvider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
final DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
if (storeDriver instanceof PrimaryDataStoreDriver) {
final PrimaryDataStoreDriver primaryStoreDriver = (PrimaryDataStoreDriver) storeDriver;
return primaryStoreDriver.getVolumeSizeIncludingHypervisorSnapshotReserve(volume, pool);
}
return volume.getSize();
}
Aggregations