Sahina Bose has uploaded a new change for review. Change subject: engine: Do not access storage domain for gluster only hosts ......................................................................
engine: Do not access storage domain for gluster only hosts Gluster hosts are moved to non-operation as they cannot access the storage domain. This check is not necessary for gluster hosts Change-Id: Ic6e9c02bf68146975987c6cb48cccf5c198a2e5b Bug-Url: https://bugzilla.redhat.com/1105513 Signed-off-by: Sahina Bose <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAO.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java M packaging/dbscripts/vds_sp.sql 4 files changed, 36 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/34/28434/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java index ea9d7d8..29cee00 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBase.java @@ -84,7 +84,7 @@ } public static List<VDS> getAllRunningVdssInPool(StoragePool pool) { - return DbFacade.getInstance().getVdsDao().getAllForStoragePoolAndStatus(pool.getId(), VDSStatus.Up); + return DbFacade.getInstance().getVdsDao().getAllForStoragePoolAndStatusSupportVirt(pool.getId(), VDSStatus.Up); } protected int getAmountOfVdssInPool() { @@ -92,7 +92,7 @@ } protected List<VDS> getAllRunningVdssInPool() { - return getVdsDAO().getAllForStoragePoolAndStatus(getStoragePool().getId(), VDSStatus.Up); + return getVdsDAO().getAllForStoragePoolAndStatusSupportVirt(getStoragePool().getId(), VDSStatus.Up); } protected void updateStoragePoolMasterDomainVersionInDiffTransaction() { diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAO.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAO.java index 0098504..f757fac 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAO.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAO.java @@ -164,6 +164,15 @@ * @return the list of VDS instances */ List<VDS> getAllForStoragePoolAndStatus(Guid storagePool, VDSStatus status); + + /** + * Retrieves all VDS instances instances by storage pool ID, that are in given status + * and support virtualization + * @param vdsGroupId + * @param status + * @return list of VDS instances + */ + List<VDS> getAllForStoragePoolAndStatusSupportVirt(Guid vdsGroupId, VDSStatus status); /** * Retrieves all VDS instances in the given Storage Pool, that are in status "UP" @@ -179,7 +188,7 @@ * @return list of VDS instances */ List<VDS> getAllForVdsGroupWithStatus(Guid vdsGroupId, VDSStatus status); - + /** * Retrieves all VDS instances that have a Network Interface that the given Network is attached to. * diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java index 69e60c4..d8896b8 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java @@ -178,6 +178,15 @@ .addValue("storage_pool_id", storagePool) .addValue("status", status.getValue())); } + + @Override + public List<VDS> getAllForStoragePoolAndStatusSupportVirt(Guid storagePool, VDSStatus status) { + return getCallsHandler().executeReadList("getVdsByStoragePoolIdSupportVirtWithStatus", + VdsRowMapper.instance, + getCustomMapSqlParameterSource() + .addValue("storage_pool_id", storagePool) + .addValue("status", status.getValue())); + } @Override public List<VDS> getListForSpmSelection(Guid storagePoolId) { diff --git a/packaging/dbscripts/vds_sp.sql b/packaging/dbscripts/vds_sp.sql index c201edb..7a51b38 100644 --- a/packaging/dbscripts/vds_sp.sql +++ b/packaging/dbscripts/vds_sp.sql @@ -886,13 +886,27 @@ BEGIN BEGIN RETURN QUERY SELECT vds.* - FROM vds + FROM vds, WHERE (status = v_status) AND (storage_pool_id = v_storage_pool_id); END; RETURN; END; $procedure$ LANGUAGE plpgsql; +-- Returns all VDS for a given pool and having given status +CREATE OR REPLACE FUNCTION getVdsByStoragePoolIdSupportVirtWithStatus(v_storage_pool_id UUID, v_status integer) RETURNS SETOF vds STABLE + AS $procedure$ +BEGIN + BEGIN + RETURN QUERY SELECT vds.* + FROM vds, vds_groups vds_group + WHERE (status = v_status) AND (storage_pool_id = v_storage_pool_id) + AND vds.vds_group_id = vdsgroup.vds_group_id AND vdsgroup.virt_service = true; + END; + RETURN; +END; $procedure$ +LANGUAGE plpgsql; + CREATE OR REPLACE FUNCTION getHostsForStorageOperation(v_storage_pool_id UUID, v_local_fs_only BOOLEAN) RETURNS SETOF vds STABLE AS $procedure$ BEGIN -- To view, visit http://gerrit.ovirt.org/28434 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic6e9c02bf68146975987c6cb48cccf5c198a2e5b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sahina Bose <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
