Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ enum QualityOfServiceState { MIGRATION, NO_MIGRATION }

void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);

boolean requiresAccessForMigration(DataObject dataObject);

/**
* intended for managed storage (cloud.storage_pool.managed = true)
* if not managed, return volume.getSize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public VolumeInfo getVolume() {

void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);

boolean requiresAccessForMigration(DataObject dataObject, DataStore dataStore);

/**
* Creates the volume based on the given criteria
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1228,8 +1228,8 @@ public void release(long vmId, long hostId) {
DataStore dataStore = dataStoreMgr.getDataStore(volumeForVm.getPoolId(), DataStoreRole.Primary);
PrimaryDataStore primaryDataStore = (PrimaryDataStore)dataStore;

// This might impact other managed storages, grant access for PowerFlex storage pool only
if (primaryDataStore.isManaged() && primaryDataStore.getPoolType() == Storage.StoragePoolType.PowerFlex) {
// This might impact other managed storages, enable requires access for migration in relevant datastore driver (currently enabled for PowerFlex storage pool only)
if (primaryDataStore.isManaged() && volService.requiresAccessForMigration(volumeInfo, dataStore)) {
volService.revokeAccess(volumeInfo, host, dataStore);
}
}
Expand Down Expand Up @@ -1507,8 +1507,8 @@ public void prepareForMigration(VirtualMachineProfile vm, DeployDestination dest
disk.setDetails(getDetails(volumeInfo, dataStore));

PrimaryDataStore primaryDataStore = (PrimaryDataStore)dataStore;
// This might impact other managed storages, grant access for PowerFlex storage pool only
if (primaryDataStore.isManaged() && primaryDataStore.getPoolType() == Storage.StoragePoolType.PowerFlex) {
// This might impact other managed storages, enable requires access for migration in relevant datastore driver (currently enabled for PowerFlex storage pool only)
if (primaryDataStore.isManaged() && volService.requiresAccessForMigration(volumeInfo, dataStore)) {
volService.grantAccess(volFactory.getVolume(vol.getId()), dest.getHost(), dataStore);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,19 @@ public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore)
}
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject, DataStore dataStore) {
DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null;
if (dataStoreDriver == null) {
return false;
}

if (dataStoreDriver instanceof PrimaryDataStoreDriver) {
return ((PrimaryDataStoreDriver)dataStoreDriver).requiresAccessForMigration(dataObject);
}
return false;
}

@Override
public AsyncCallFuture<VolumeApiResult> createVolumeAsync(VolumeInfo volume, DataStore dataStore) {
AsyncCallFuture<VolumeApiResult> future = new AsyncCallFuture<VolumeApiResult>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore)
}
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

/**
* Returns the size of template on this primary storage. If we already have a
* template on this storage, we return 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore
public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

@Override
public long getUsedBytes(StoragePool storagePool) {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore)
{
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

@Override
public long getUsedBytes(StoragePool storagePool)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore)
//To change body of implemented methods use File | Settings | File Templates.
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

@Override
public long getUsedBytes(StoragePool storagePool) {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public ChapInfo getChapInfo(DataObject dataObject) {
@Override
public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

@Override
public long getUsedBytes(StoragePool storagePool) {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ public String getConnectedSdc(long poolId, long hostId) {
return null;
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return true;
}

@Override
public long getUsedBytes(StoragePool storagePool) {
long usedSpaceBytes = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ private Iops getIops(Long minIops, Long maxIops, long storagePoolId) {
return new Iops(minIops, maxIops, getDefaultBurstIops(storagePoolId, maxIops));
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

@Override
public long getUsedBytes(StoragePool storagePool) {
return getUsedBytes(storagePool, Long.MIN_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ public boolean grantAccess(DataObject data, Host host, DataStore dataStore) {
public void revokeAccess(DataObject data, Host host, DataStore dataStore) {
}

@Override
public boolean requiresAccessForMigration(DataObject dataObject) {
return false;
}

private void updateStoragePool(final long poolId, final long deltaUsedBytes) {
StoragePoolVO storagePool = primaryStoreDao.findById(poolId);
final long capacity = storagePool.getCapacityBytes();
Expand Down