Maor Lipchuk has posted comments on this change. Change subject: core: introducing OvfAutoUpdate ......................................................................
Patch Set 19: (10 inline comments) .................................................... File backend/manager/dbscripts/upgrade/03_02_1550_add_vm_generation_columns.sql Line 17: -- the pre existing vms, the default should be 0. Line 18: SELECT fn_db_change_column_type ('vm_ovf_generations', 'ovf_generation', 'BIGINT DEFAULT 1','BIGINT DEFAULT 0'); Line 19: Line 20: CREATE INDEX IDX_vm_ovf_generations_vm_guid ON vm_ovf_generations(vm_guid); Line 21: CREATE INDEX IDX_vm_ovf_generations_storage_pool_id ON vm_ovf_generations(storage_pool_id); Please remember to change the number of the script to 03_02_0050 before merging it. .................................................... File backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql Line 310: select fn_db_add_config_value('OvirtIsoPrefix','ovirt-node','general'); Line 311: select fn_db_add_config_value('oVirtISOsRepositoryPath','/usr/share/ovirt-node-iso','general'); Line 312: select fn_db_add_config_value('oVirtUpgradeScriptName','/usr/share/vdsm-reg/vdsm-upgrade','general'); Line 313: select fn_db_add_config_value('oVirtUploadPath','/data/updates/ovirt-node-image.iso','general'); Line 314: select fn_db_add_config_value('OvfUpdateIntervalInMinutes','60','general'); In the wiki it says 5 minutes, probably please update the wiki accordingly Line 315: select fn_db_add_config_value('OvfItemsCountPerUpdate','100','general'); Line 316: select fn_db_add_config_value('PayloadSize','8192','general'); Line 317: select fn_db_add_config_value('PosixStorageEnabled','false','3.0'); Line 318: select fn_db_add_config_value('PosixStorageEnabled','true','3.1'); Line 311: select fn_db_add_config_value('oVirtISOsRepositoryPath','/usr/share/ovirt-node-iso','general'); Line 312: select fn_db_add_config_value('oVirtUpgradeScriptName','/usr/share/vdsm-reg/vdsm-upgrade','general'); Line 313: select fn_db_add_config_value('oVirtUploadPath','/data/updates/ovirt-node-image.iso','general'); Line 314: select fn_db_add_config_value('OvfUpdateIntervalInMinutes','60','general'); Line 315: select fn_db_add_config_value('OvfItemsCountPerUpdate','100','general'); This configuration is not metioned in the wiki please add it. Line 316: select fn_db_add_config_value('PayloadSize','8192','general'); Line 317: select fn_db_add_config_value('PosixStorageEnabled','false','3.0'); Line 318: select fn_db_add_config_value('PosixStorageEnabled','true','3.1'); Line 319: select fn_db_add_config_value('PosixStorageEnabled','true','3.2'); .................................................... File backend/manager/dbscripts/vm_templates_sp.sql Line 126: v_is_smartcard_enabled, Line 127: v_is_delete_protected); Line 128: INSERT INTO vm_ovf_generations(vm_guid, storage_pool_id) Line 129: VALUES (v_vmt_guid, (SELECT storage_pool_id Line 130: FROM vds_groups vg TWS Line 131: WHERE vg.vds_group_id = v_vds_group_id)); Line 132: END; $procedure$ Line 133: LANGUAGE plpgsql; Line 134: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java Line 109: proccessedOvfGenerationsInfo = null; Line 110: } Line 111: Line 112: /** Line 113: * update ovfs for updated/newly vms since last run for the given storage pool Please add empty line before the param annotation. Line 114: * @param poolId Line 115: */ Line 116: protected void updateOvfForVmsOfStoragePool(Guid poolId) { Line 117: List<Guid> vmsIdsForUpdate = getVmAndTemplatesGenerationsDao().getVmsIdsForOvfUpdate(poolId); Line 129: } Line 130: Line 131: /** Line 132: * removes from the storage ovf files of vm/templates that were removed from the db Line 133: * since the last OvfDataUpdater run. same here, and all the class Line 134: * @param poolId Line 135: */ Line 136: private void removeOvfForTemplatesAndVmsOfStoragePool(Guid poolId) { Line 137: List<Guid> idsForRemoval = getVmAndTemplatesGenerationsDao().getIdsForOvfDeletion(poolId); Line 149: * @param poolId Line 150: * @param vmsAndTemplateMetadata Line 151: */ Line 152: protected void performOvfUpdate(Guid poolId , Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata) { Line 153: executeUpdateVmInSpmCommand(poolId, vmsAndTemplateMetadata, Guid.Empty); Please add a log here whether the update succeeded or not. Line 154: int i=0; Line 155: while (i<proccessedIdsInfo.size()) { Line 156: int sizeToUpdate = Math.min(MAX_ITEMS_PER_SQL_STATEMENT, proccessedIdsInfo.size() -i); Line 157: List<Guid> guidsForUpdate = proccessedIdsInfo.subList(i, i + sizeToUpdate); Line 360: protected VmNetworkInterfaceDAO getVmNetworkInterfaceDao() { Line 361: return DbFacade.getInstance().getVmNetworkInterfaceDao(); Line 362: } Line 363: Line 364: protected VmAndTemplatesGenerationsDAO getVmAndTemplatesGenerationsDao() { Why generations and not generation? /s/getVmAndTemplatesGenerationsDao/getVmAndTemplatesGenerationDAO Line 365: return DbFacade.getInstance().getVmAndTemplatesGenerationsDAO(); Line 366: } Line 367: Line 368: protected VmStaticDAO getVmStaticDao() { .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAO.java Line 70: */ Line 71: public Long getDbGeneration(Guid id); Line 72: Line 73: /** Line 74: * Increment the db version for all vms/templates in a specific storage pool. Add empty line here Line 75: * @param storagePoolId Line 76: */ Line 77: public void incrementDbGenerationForAllInStoragePool(Guid storagePoolId); Line 78: .................................................... File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StoragePoolDAOTest.java Line 148: @Test Line 149: public void testGetAllByStatus() { Line 150: List<storage_pool> result = dao.getAllByStatus(StoragePoolStatus.Up); Line 151: assertNotNull("list of returned pool shouldn't be null", result); Line 152: assertEquals("wrong number of storage pool returned", 5, result.size()); separate this test into two tests or add the storage pool type which was being fetched in the message. Line 153: Line 154: result = dao.getAllByStatus(StoragePoolStatus.Maintanance); Line 155: assertNotNull("list of returned pool shouldn't be null", result); Line 156: assertEquals("wrong number of storage pool returned", 0, result.size()); -- To view, visit http://gerrit.ovirt.org/9328 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b5132300fb1f1fd94f771cab15efe5246dbeca8 Gerrit-PatchSet: 19 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: liron aravot <liron.ara...@gmail.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches