mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
storage: change storage pool to Up state when cancel storage migration (#11773)
* storage: change storage pool to Up state when cancel storage migration * Update 11773: connect host to shared pool after cancelling storage migration * Update 11773: update db only * Update 11773: skip capacity update for storpool
This commit is contained in:
parent
b143ddc405
commit
89d2b17461
@ -294,6 +294,8 @@ public interface StorageManager extends StorageService {
|
|||||||
|
|
||||||
Answer sendToPool(StoragePool pool, long[] hostIdsToTryFirst, Command cmd) throws StorageUnavailableException;
|
Answer sendToPool(StoragePool pool, long[] hostIdsToTryFirst, Command cmd) throws StorageUnavailableException;
|
||||||
|
|
||||||
|
void updateStoragePoolHostVOAndBytes(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer);
|
||||||
|
|
||||||
CapacityVO getSecondaryStorageUsedStats(Long hostId, Long zoneId);
|
CapacityVO getSecondaryStorageUsedStats(Long hostId, Long zoneId);
|
||||||
|
|
||||||
CapacityVO getStoragePoolUsedStats(Long poolId, Long clusterId, Long podId, Long zoneId);
|
CapacityVO getStoragePoolUsedStats(Long poolId, Long clusterId, Long podId, Long zoneId);
|
||||||
|
|||||||
@ -448,8 +448,8 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl extends BasePrimaryDataStor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean cancelMaintain(DataStore store) {
|
public boolean cancelMaintain(DataStore store) {
|
||||||
storagePoolAutmation.cancelMaintain(store);
|
|
||||||
dataStoreHelper.cancelMaintain(store);
|
dataStoreHelper.cancelMaintain(store);
|
||||||
|
storagePoolAutmation.cancelMaintain(store);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2688,7 +2688,8 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateStoragePoolHostVOAndBytes(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer) {
|
@Override
|
||||||
|
public void updateStoragePoolHostVOAndBytes(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer) {
|
||||||
StoragePoolHostVO poolHost = _storagePoolHostDao.findByPoolHost(pool.getId(), hostId);
|
StoragePoolHostVO poolHost = _storagePoolHostDao.findByPoolHost(pool.getId(), hostId);
|
||||||
if (poolHost == null) {
|
if (poolHost == null) {
|
||||||
poolHost = new StoragePoolHostVO(pool.getId(), hostId, mspAnswer.getPoolInfo().getLocalPath().replaceAll("//", "/"));
|
poolHost = new StoragePoolHostVO(pool.getId(), hostId, mspAnswer.getPoolInfo().getLocalPath().replaceAll("//", "/"));
|
||||||
@ -2698,8 +2699,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
StoragePoolVO poolVO = _storagePoolDao.findById(pool.getId());
|
StoragePoolVO poolVO = _storagePoolDao.findById(pool.getId());
|
||||||
poolVO.setUsedBytes(mspAnswer.getPoolInfo().getCapacityBytes() - mspAnswer.getPoolInfo().getAvailableBytes());
|
if (!Storage.StoragePoolType.StorPool.equals(poolVO.getPoolType())) {
|
||||||
poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());
|
poolVO.setUsedBytes(mspAnswer.getPoolInfo().getCapacityBytes() - mspAnswer.getPoolInfo().getAvailableBytes());
|
||||||
|
poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());
|
||||||
|
}
|
||||||
|
|
||||||
_storagePoolDao.update(pool.getId(), poolVO);
|
_storagePoolDao.update(pool.getId(), poolVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -346,6 +346,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
|
|||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("ModifyStoragePool add succeeded");
|
logger.debug("ModifyStoragePool add succeeded");
|
||||||
}
|
}
|
||||||
|
storageManager.updateStoragePoolHostVOAndBytes(pool, host.getId(), (ModifyStoragePoolAnswer) answer);
|
||||||
if (pool.getPoolType() == Storage.StoragePoolType.DatastoreCluster) {
|
if (pool.getPoolType() == Storage.StoragePoolType.DatastoreCluster) {
|
||||||
logger.debug("Started synchronising datastore cluster storage pool {} with vCenter", pool);
|
logger.debug("Started synchronising datastore cluster storage pool {} with vCenter", pool);
|
||||||
storageManager.syncDatastoreClusterStoragePool(pool.getId(), ((ModifyStoragePoolAnswer) answer).getDatastoreClusterChildren(), host.getId());
|
storageManager.syncDatastoreClusterStoragePool(pool.getId(), ((ModifyStoragePoolAnswer) answer).getDatastoreClusterChildren(), host.getId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user