Allon Mureinik has posted comments on this change. Change subject: engine: check active vds before activate storage domain ......................................................................
Patch Set 2: Code-Review-1 (2 comments) Good to see you here again, plysan. I'm not quite sure the check you added is the correct way to go about it - please see my comments inline. .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java Line 212: for (VDS vds : vdss) { Line 213: if (vds.getStatus() == VDSStatus.Up) { Line 214: return true; Line 215: } Line 216: } The problem according to the commit message is with activating a domain with no available SPM. According to that, what you should do is check the SPM's status, not all the hosts' statuses. In pseudo code: // Get the SPM ID: StoragePool sp = getStoragePoolDao().get(getParameters().getStoragePoolId()); Guid spmId = sp.getspm_vds_id(); // Get the SPM's data VDS spm = getVdsDao().get(spmId); if (spm == null) { // error, no SPM for storage pool - add the proper message return false; } if (spm.getStatus() != UP) { // error, SPM isn't up return false; } Line 217: addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NO_ACTIVE_HOST_IN_STORAGE_POOL); Line 218: return false; Line 219: } Line 220: .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java Line 471: ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL(ErrorType.BAD_PARAMETERS), Line 472: ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL(ErrorType.CONFLICT), Line 473: ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL_HOST(ErrorType.CONFLICT), Line 474: ACTION_TYPE_FAILED_MASTER_STORAGE_DOMAIN_NOT_ACTIVE(ErrorType.CONFLICT), Line 475: ACTION_TYPE_FAILED_NO_ACTIVE_HOST_IN_STORAGE_POOL(ErrorType.CONFLICT), If you add a new error code, you should also supply the error string for it, as per http://www.ovirt.org/Engine_Adding_Messages Line 476: STORAGE_DOMAIN_NOT_ATTACHED_TO_STORAGE_POOL(ErrorType.CONFLICT), Line 477: ERROR_CANNOT_DETACH_STORAGE_DOMAIN_WITH_IMAGES(ErrorType.CONFLICT), Line 478: ERROR_CANNOT_ATTACH_MORE_THAN_ONE_ISO_DOMAIN(ErrorType.CONFLICT), Line 479: ERROR_CANNOT_ATTACH_MORE_THAN_ONE_EXPORT_DOMAIN(ErrorType.CONFLICT), -- To view, visit http://gerrit.ovirt.org/17940 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3e45b53d15b757237af8c76457f213c00a73909 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: plysan <ply...@gmail.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Itamar Heim <ih...@redhat.com> Gerrit-Reviewer: LiJiansheng <lijiangshe...@gmail.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-Reviewer: plysan <ply...@gmail.com> Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches