mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge release branch 4.18 to 4.19
* 4.18: Storage plugin support to check if volume on datastore requires access for migration (#8655) CKS: fix /opt/bin/deploy-cloudstack-secret in CKS control nodes (#8697)
This commit is contained in:
commit
f4987bf8ee
@ -44,6 +44,10 @@ public interface PrimaryDataStoreDriver extends DataStoreDriver {
|
||||
|
||||
void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);
|
||||
|
||||
default boolean requiresAccessForMigration(DataObject dataObject) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* intended for managed storage (cloud.storage_pool.managed = true)
|
||||
* if not managed, return volume.getSize()
|
||||
|
||||
@ -57,6 +57,8 @@ public interface VolumeService {
|
||||
|
||||
void revokeAccess(DataObject dataObject, Host host, DataStore dataStore);
|
||||
|
||||
boolean requiresAccessForMigration(DataObject dataObject, DataStore dataStore);
|
||||
|
||||
/**
|
||||
* Creates the volume based on the given criteria
|
||||
*
|
||||
|
||||
@ -1228,8 +1228,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -1507,8 +1507,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -264,6 +264,19 @@ public class VolumeServiceImpl implements VolumeService {
|
||||
}
|
||||
}
|
||||
|
||||
@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>();
|
||||
|
||||
@ -21,14 +21,14 @@ function usage() {
|
||||
Usage: ./deploy-cloudstack-secret [OPTIONS]...
|
||||
To deploy the keys needed for the cloudstack kubernetes provider.
|
||||
Arguments:
|
||||
-u, --url string ID of the cluster
|
||||
-u, --url string URL of the CloudStack API
|
||||
-k, --key string API Key
|
||||
-s, --secret string Secret Key
|
||||
-p, --project string Project ID
|
||||
Other arguments:
|
||||
-h, --help Display this help message and exit
|
||||
Examples:
|
||||
./deploy-cloudstack-secret -u http://localhost:8080 -k abcd -s efgh
|
||||
./deploy-cloudstack-secret -u http://10.10.10.10:8080/client/api -k abcd -s efgh
|
||||
USAGE
|
||||
exit 0
|
||||
}
|
||||
|
||||
@ -303,6 +303,11 @@ public class ScaleIOPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresAccessForMigration(DataObject dataObject) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUsedBytes(StoragePool storagePool) {
|
||||
long usedSpaceBytes = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user