From c11dc337be774af429a1eff0f02d94e4867f28f0 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Fri, 28 Aug 2020 01:03:05 +0530 Subject: [PATCH] Set back the datastore cluster state to UP upon on failure in prepare maintenance --- .../src/main/java/com/cloud/storage/StorageManagerImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java index 7b00e3491c5..e08e8becc7a 100644 --- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java @@ -1583,12 +1583,14 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C for (DataStore dataStore: maintenanceSuccessfulStoragePools) { lifeCycle.cancelMaintain(dataStore); } - // Set back to Up state of remaining child storage pools + // Set back to Up state of remaining child storage pools and datastore cluster while (iteratorChildDatastore.hasNext()) { StoragePoolVO childDatastore = iteratorChildDatastore.next(); childDatastore.setStatus(StoragePoolStatus.Up); _storagePoolDao.update(childDatastore.getId(), childDatastore); } + datastoreCluster.setStatus(StoragePoolStatus.Up); + _storagePoolDao.update(datastoreCluster.getId(), datastoreCluster); throw new CloudRuntimeException(String.format("Failed to prepare maintenance mode for datastore cluster %d with error %s %s", primaryStorageId, e.getMessage(), e)); } maintenanceSuccessfulStoragePools.add(childStore);