You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/01/09 03:11:24 UTC
git commit: updated refs/heads/master to ac8bc74
Updated Branches:
refs/heads/master 3223028fd -> ac8bc7426
CLOUDSTACK-5840:Remove old API method.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ac8bc742
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ac8bc742
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ac8bc742
Branch: refs/heads/master
Commit: ac8bc74269830dff16d3e908c17be5f0292f09a9
Parents: 3223028
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jan 8 18:11:12 2014 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Jan 8 18:11:12 2014 -0800
----------------------------------------------------------------------
api/src/com/cloud/storage/StorageService.java | 24 ++++++++++----------
.../com/cloud/storage/StorageManagerImpl.java | 22 ------------------
2 files changed, 12 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac8bc742/api/src/com/cloud/storage/StorageService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/StorageService.java b/api/src/com/cloud/storage/StorageService.java
index 11f03aa..7fc1e16 100644
--- a/api/src/com/cloud/storage/StorageService.java
+++ b/api/src/com/cloud/storage/StorageService.java
@@ -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;
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ac8bc742/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 4fda2dd..9afd47a 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -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 {