mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5840:Remove old API method.
This commit is contained in:
parent
3223028fd6
commit
ac8bc74269
|
|
@ -95,20 +95,20 @@ public interface StorageService {
|
|||
public ImageStore discoverImageStore(String name, String url, String providerName, Long dcId, Map details) throws IllegalArgumentException, DiscoveryException,
|
||||
InvalidParameterValueException;
|
||||
|
||||
/**
|
||||
* Prepare NFS secondary storage for object store migration
|
||||
*
|
||||
* @param cmd
|
||||
* - the command specifying secondaryStorageId
|
||||
* @return the storage pool
|
||||
* @throws ResourceUnavailableException
|
||||
* TODO
|
||||
* @throws InsufficientCapacityException
|
||||
* TODO
|
||||
|
||||
/**
|
||||
* Migrate existing NFS to use object store.
|
||||
* @param name object store name.
|
||||
* @param url object store url.
|
||||
* @param providerName object store provider Name.
|
||||
* @param details object store other details
|
||||
* @return Object store created.
|
||||
* @throws IllegalArgumentException
|
||||
* @throws DiscoveryException
|
||||
* @throws InvalidParameterValueException
|
||||
*/
|
||||
public ImageStore migrateToObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException,
|
||||
InvalidParameterValueException;
|
||||
|
||||
public ImageStore prepareSecondaryStorageForObjectStoreMigration(Long storeId) throws ResourceUnavailableException,
|
||||
InsufficientCapacityException;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1225,28 +1225,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
return (PrimaryDataStoreInfo)dataStoreMgr.getDataStore(primaryStorage.getId(), DataStoreRole.Primary);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
public ImageStore prepareSecondaryStorageForObjectStoreMigration(Long storeId) throws ResourceUnavailableException, InsufficientCapacityException {
|
||||
// Verify that image store exists
|
||||
ImageStoreVO store = _imageStoreDao.findById(storeId);
|
||||
if (store == null) {
|
||||
throw new InvalidParameterValueException("Image store with id " + storeId + " doesn't exist");
|
||||
} else if (!store.getProviderName().equals(DataStoreProvider.NFS_IMAGE)) {
|
||||
throw new InvalidParameterValueException("We only support migrate NFS secondary storage to use object store!");
|
||||
}
|
||||
_accountMgr.checkAccessAndSpecifyAuthority(CallContext.current().getCallingAccount(), store.getDataCenterId());
|
||||
|
||||
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider(store.getProviderName());
|
||||
DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
|
||||
DataStore secStore = dataStoreMgr.getDataStore(storeId, DataStoreRole.Image);
|
||||
lifeCycle.migrateToObjectStore(secStore);
|
||||
// update store_role in template_store_ref and snapshot_store_ref to ImageCache
|
||||
_templateStoreDao.updateStoreRoleToCachce(storeId);
|
||||
_snapshotStoreDao.updateStoreRoleToCache(storeId);
|
||||
// converted to an image cache store
|
||||
return (ImageStore)_dataStoreMgr.getDataStore(storeId, DataStoreRole.ImageCache);
|
||||
}
|
||||
|
||||
protected class StorageGarbageCollector extends ManagedContextRunnable {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue