mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
[CLOUDSTACK-10214] Unable to remove local primary storage (#2390)
This commit is contained in:
parent
0e8fbdb35f
commit
eba2e1d8a1
@ -90,23 +90,16 @@ public interface StorageService {
|
|||||||
|
|
||||||
boolean deleteSecondaryStagingStore(DeleteSecondaryStagingStoreCmd cmd);
|
boolean deleteSecondaryStagingStore(DeleteSecondaryStagingStoreCmd cmd);
|
||||||
|
|
||||||
ImageStore discoverImageStore(String name, String url, String providerName, Long zoneId, Map details) throws IllegalArgumentException, DiscoveryException,
|
ImageStore discoverImageStore(String name, String url, String providerName, Long zoneId, Map details) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
|
||||||
InvalidParameterValueException;
|
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
|
||||||
* Migrate existing NFS to use object store.
|
* Migrate existing NFS to use object store.
|
||||||
* @param name object store name.
|
* @param name object store name.
|
||||||
* @param url object store url.
|
* @param url object store URL.
|
||||||
* @param providerName object store provider Name.
|
* @param providerName object store provider Name.
|
||||||
* @param details object store other details
|
* @param details object store other details
|
||||||
* @return Object store created.
|
* @return Object store created.
|
||||||
* @throws IllegalArgumentException
|
|
||||||
* @throws DiscoveryException
|
|
||||||
* @throws InvalidParameterValueException
|
|
||||||
*/
|
*/
|
||||||
ImageStore migrateToObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException,
|
ImageStore migrateToObjectStore(String name, String url, String providerName, Map<String, String> details) throws DiscoveryException;
|
||||||
InvalidParameterValueException;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -344,7 +344,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok to share
|
// ok to share
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -891,11 +890,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
s_logger.warn("Unable to delete storage id: " + id + " due to it is not in Maintenance state");
|
s_logger.warn("Unable to delete storage id: " + id + " due to it is not in Maintenance state");
|
||||||
throw new InvalidParameterValueException("Unable to delete storage due to it is not in Maintenance state, id: " + id);
|
throw new InvalidParameterValueException("Unable to delete storage due to it is not in Maintenance state, id: " + id);
|
||||||
}
|
}
|
||||||
if (sPool.isLocal()) {
|
|
||||||
s_logger.warn("Unable to delete local storage id:" + id);
|
|
||||||
throw new InvalidParameterValueException("Unable to delete local storage id: " + id);
|
|
||||||
}
|
|
||||||
|
|
||||||
Pair<Long, Long> vlms = _volsDao.getCountAndTotalByPool(id);
|
Pair<Long, Long> vlms = _volsDao.getCountAndTotalByPool(id);
|
||||||
if (forced) {
|
if (forced) {
|
||||||
if (vlms.first() > 0) {
|
if (vlms.first() > 0) {
|
||||||
@ -1126,7 +1120,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
s_logger.debug("Failed to delete snapshot: " + ssSnapshotVO.getId() + " from storage");
|
s_logger.debug("Failed to delete snapshot: " + ssSnapshotVO.getId() + " from storage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanupSecondaryStorage(recurring);
|
cleanupSecondaryStorage(recurring);
|
||||||
|
|
||||||
List<VolumeVO> vols = _volsDao.listVolumesToBeDestroyed(new Date(System.currentTimeMillis() - ((long)StorageCleanupDelay.value() << 10)));
|
List<VolumeVO> vols = _volsDao.listVolumesToBeDestroyed(new Date(System.currentTimeMillis() - ((long)StorageCleanupDelay.value() << 10)));
|
||||||
@ -1931,19 +1924,16 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Answer sendToPool(long poolId, Command cmd) throws StorageUnavailableException {
|
public Answer sendToPool(long poolId, Command cmd) throws StorageUnavailableException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Answer[] sendToPool(long poolId, Commands cmd) throws StorageUnavailableException {
|
public Answer[] sendToPool(long poolId, Commands cmd) throws StorageUnavailableException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2044,7 +2034,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImageStore migrateToObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException {
|
public ImageStore migrateToObjectStore(String name, String url, String providerName, Map<String, String> details) throws DiscoveryException, InvalidParameterValueException {
|
||||||
// check if current cloud is ready to migrate, we only support cloud with only NFS secondary storages
|
// check if current cloud is ready to migrate, we only support cloud with only NFS secondary storages
|
||||||
List<ImageStoreVO> imgStores = _imageStoreDao.listImageStores();
|
List<ImageStoreVO> imgStores = _imageStoreDao.listImageStores();
|
||||||
List<ImageStoreVO> nfsStores = new ArrayList<ImageStoreVO>();
|
List<ImageStoreVO> nfsStores = new ArrayList<ImageStoreVO>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user