Bug 1272329 - Storage node in maintenance operation mode cannot be undeployed
Storage node in maintenance operation mode cannot be undeployed
Status: NEW
Product: RHQ Project
Classification: Other
Component: Storage Node (Show other bugs)
4.12
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks: 1272328
  Show dependency treegraph
 
Reported: 2015-10-16 02:45 EDT by bkramer
Modified: 2015-10-16 02:45 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description bkramer 2015-10-16 02:45:20 EDT
Description of problem:
A storage node that was deployed initially by mistake, with cluster status 'NORMAL', availability 'UP' but operation mode 'MAINTENANCE' cannot be undeployed. 

Currently, the method that undeployes storage nodes is:

*******************************************************
308     public void undeployStorageNode(Subject subject, StorageNode storageNode) {
309         StorageNodeCriteria c = new StorageNodeCriteria();
310         c.addFilterId(storageNode.getId());
311         c.fetchResource(true);
312         List<StorageNode> storageNodes = storageNodeManager.findStorageNodesByCriteria(subject, c);
313         if (storageNodes.isEmpty()) {
314             throw new RuntimeException("Storage node not found, can not undeploy " + storageNode);
315         }
316         storageNode = storageNodes.get(0);
317 
318         switch (storageNode.getOperationMode()) {
319         case INSTALLED:
320             storageNodeManager.resetInNewTransaction();
321             storageNodeOperationsHandler.uninstall(subject, storageNode);
322             break;
323         case ANNOUNCE:
324         case BOOTSTRAP:
325             storageNodeManager.resetInNewTransaction();
326             storageNodeOperationsHandler.unannounceStorageNode(subject, storageNode);
327             break;
328         case ADD_MAINTENANCE:
329         case NORMAL:
330         case DECOMMISSION:
331             storageNodeManager.resetInNewTransaction();
332             storageNodeOperationsHandler.decommissionStorageNode(subject, storageNode);
333             break;
334         case REMOVE_MAINTENANCE:
335             storageNodeManager.resetInNewTransaction();
336             storageNodeOperationsHandler.performRemoveNodeMaintenance(subject, storageNode);
337             break;
338         case UNANNOUNCE:
339             storageNodeManager.resetInNewTransaction();
340             storageNodeOperationsHandler.unannounceStorageNode(subject, storageNode);
341             break;
342         case UNINSTALL:
343             storageNodeManager.resetInNewTransaction();
344             storageNodeOperationsHandler.uninstall(subject, storageNode);
345             break;
346         default:
347             // TODO what do we do with/about maintenance mode
348             throw new RuntimeException("Cannot undeploy " + storageNode);
349         }
350     }
*******************************************************

So, if storage node is in maintenance mode, we just through an Exception and users get stuck with the node they don't want. 

Version-Release number of selected component (if applicable):
JBoss ON 3.3.2

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
Attempt to undeply storage node fails with the "Cannot undeploy..." message.

Expected results:
Storage node is properly undeployed and no exception is thrown.


Additional info:

Note You need to log in before you can comment on or make changes to this bug.