Skip to content

Commit 6e94d34

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
bugfix/CSTACKEX-155: Fix cancel maintain for vm provisioning update comments
1 parent 7b56255 commit 6e94d34

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,21 +453,19 @@ public boolean cancelMaintain(DataStore store) {
453453

454454
// Save capacity before the generic cancelMaintain path overwrites it.
455455
// The generic flow sends ModifyStoragePoolCommand to agents. For managed iSCSI pools,
456-
// IscsiAdmStoragePool returns capacityBytes=0 (it doesn't track real ONTAP capacity),
457-
// which causes updateStoragePoolHostVOAndBytes to overwrite the real capacity set during
458-
// pool initialization. With capacity=0, the deployment planner's checkPoolforSpace
459-
// divides by zero and rejects the pool ("No destination found").
456+
// IscsiAdmStoragePool returns capacityBytes=0 , With capacity=0,
457+
// the deployment planner's checkPoolforSpace rejects the pool ("No destination found").
460458
StoragePoolVO poolVO = storagePoolDao.findById(store.getId());
461459
long savedCapacityBytes = poolVO.getCapacityBytes();
462460
long savedUsedBytes = poolVO.getUsedBytes();
463461

464462
if (_dataStoreHelper.cancelMaintain(store)) {
465463
boolean result = _storagePoolAutomation.cancelMaintain(store);
466464

467-
// Restore capacity if the generic path zeroed it out
465+
// Restore capacity
468466
poolVO = storagePoolDao.findById(store.getId());
469467
if (poolVO.getCapacityBytes() == 0 && savedCapacityBytes > 0) {
470-
logger.info("Restoring storage pool {} capacity to {} bytes (agent returned 0 during cancelMaintain)",
468+
logger.info("Restoring storage pool {} capacity to {} bytes",
471469
poolVO.getName(), savedCapacityBytes);
472470
poolVO.setCapacityBytes(savedCapacityBytes);
473471
poolVO.setUsedBytes(savedUsedBytes);

0 commit comments

Comments
 (0)