Liron Ar has posted comments on this change. Change subject: core: Support detach Storage Domain containing entities. ......................................................................
Patch Set 32: (5 comments) There are issues, but i guess that we can proceed and solve it in different bugs. http://gerrit.ovirt.org/#/c/24286/32/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DetachStorageDomainFromPoolCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DetachStorageDomainFromPoolCommand.java: Line 56: log.info(" Detach storage domain: after disconnect storage"); Line 57: TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { Line 58: @Override Line 59: public Object runInTransaction() { Line 60: detachStorageDomainWithEntities(getStorageDomain()); if we fail/crush after this transaction commits for some reason, the domain will be re-attached to the pool by the compensation with all of it's entities removed, please open a bug for that so it'll be addressed - as the chances of engine crush between this and the compensation context are minor, i assume we can solve it in the opened bug to not hold this feature. Line 61: StoragePoolIsoMap mapToRemove = getStorageDomain().getStoragePoolIsoMapData(); Line 62: getCompensationContext().snapshotEntity(mapToRemove); Line 63: DbFacade.getInstance() Line 64: .getStoragePoolIsoMapDao() http://gerrit.ovirt.org/#/c/24286/32/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAO.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAO.java: Line 300: */ Line 301: List<VM> getAllRunningByCluster(Guid clusterId); Line 302: Line 303: /** Line 304: * Retrieves all VM names which contains disks on other Storage Domain other then the storageDomain GUID. /s/VM names/VMs - can be done in further patch or when you rebase. Line 305: * Line 306: * @param storageDomainGuid Line 307: * the storage domain GUID Line 308: * @return List of VMs http://gerrit.ovirt.org/#/c/24286/32/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDAOTest.java File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDAOTest.java: Line 525: /** Line 526: * Ensures that there are no VMs with disks on different storage domains. Line 527: */ Line 528: @Test Line 529: public void testGetAllVMsWithDisksOnOtherStorageDomain() { we should have a postive test as well Line 530: List<VM> result = dao.getAllVMsWithDisksOnOtherStorageDomain(FixturesTool.STORAGE_DOAMIN_SCALE_SD5); Line 531: Line 532: assertNotNull(result); Line 533: assertTrue(result.isEmpty()); http://gerrit.ovirt.org/#/c/24286/32/packaging/dbscripts/disk_images_sp.sql File packaging/dbscripts/disk_images_sp.sql: Line 159: AS $procedure$ Line 160: BEGIN Line 161: RETURN QUERY SELECT images_storage_domain_view.* Line 162: FROM images_storage_domain_view Line 163: WHERE active AND images_storage_domain_view.storage_id = v_storage_domain_id; /s/images_storage_domain_view.storage_id/storage_id (its sufficent) Line 164: END; $procedure$ Line 165: LANGUAGE plpgsql; Line 166: Line 167: http://gerrit.ovirt.org/#/c/24286/32/packaging/dbscripts/vm_templates_sp.sql File packaging/dbscripts/vm_templates_sp.sql: Line 534: INNER JOIN images i ON i.image_group_id = vd.device_id Line 535: INNER JOIN (SELECT image_id Line 536: FROM image_storage_domain_map Line 537: WHERE image_storage_domain_map.storage_domain_id = v_storage_domain_id) isd_map Line 538: ON i.image_guid = isd_map.image_id WHERE entity_type = 'TEMPLATE') vms_with_disks_on_storage_domain ON templates.vmt_guid = vms_with_disks_on_storage_domain.vm_guid /s/vms _with_disks_on_storage_domain/templates_with.. commented about that in #29. Line 539: INNER JOIN vm_device vd ON vd.vm_id = templates.vmt_guid Line 540: INNER JOIN images i ON i.image_group_id = vd.device_id Line 541: INNER JOIN image_storage_domain_map on i.image_guid = image_storage_domain_map.image_id Line 542: WHERE image_storage_domain_map.storage_domain_id != v_storage_domain_id; -- To view, visit http://gerrit.ovirt.org/24286 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I971fe6acd4a2667a09487c5e1108cf7c759587f1 Gerrit-PatchSet: 32 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches