Liron Aravot has uploaded a new change for review. Change subject: core: persist LUN with correct volume_group_id ......................................................................
core: persist LUN with correct volume_group_id When saving a LUN object to the db, we specify what is the needed volume group. In case of an exist lun - it's volume group id would be updated to the new given value. In case that the given LUN isn't in the DB, it'll be saved - This patch ensures that the saved LUN would be saved with the given volume_group_id. NOTES: This motivation for this change is that in cases in which we get the LUN info from vdsm and the LUN is part of a existing VG, saving it with unknown VG to the system will prevent removal of the LUN when it won't be used anymore by the system and might cause confusion and inconsistency. Change-Id: Ia4404b0d17b107208e5ec00c688db305ba0e65fe Signed-off-by: Liron Aravot <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/30/10630/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java index 782aebe..584fd3d 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java @@ -237,6 +237,7 @@ public static void proceedLUNInDb(final LUNs lun, StorageType storageType, String volumeGroupId) { if (getLunDao().get(lun.getLUN_id()) == null) { + lun.setvolume_group_id(volumeGroupId); getLunDao().save(lun); } else if (!volumeGroupId.isEmpty()){ getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), volumeGroupId); -- To view, visit http://gerrit.ovirt.org/10630 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4404b0d17b107208e5ec00c688db305ba0e65fe Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Aravot <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
