liron aravot has posted comments on this change.
Change subject: core:WIP: introducing OvfAutoUpdate
......................................................................
Patch Set 3: (5 inline comments)
....................................................
File backend/manager/dbscripts/create_views.sql
Line 325:
Line 326:
Line 327: CREATE OR REPLACE VIEW vm_templates_view
Line 328: AS
Line 329:
That's not correct, view doesn't store any data - its just a query that runs
whenever you use the view in query, You meant to materialized view which is
not the case.
the fact that the columns are added to this view infact reduce the query count,
instead of querying vm_static table and then perform another query on vms for
example.
Line 330: SELECT
Line 331: vm_templates.vm_guid as vmt_guid,
Line 332: vm_templates.vm_name as name,
Line 333: vm_templates.mem_size_mb as mem_size_mb,
....................................................
File backend/manager/dbscripts/upgrade/03_01_1490_add_vm_generation_columns.sql
Line 1: select fn_db_add_column('vm_static', 'ovf_generation', 'BIGINT');
Line 2: select fn_db_add_column('vm_static', 'db_generation', 'BIGINT default
1');
update/creation date resided on vm_static table.
regarding the change/views - i replied in previous file/comment.
Line 3: UPDATE vm_static set ovf_generation = 1;
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
Line 56: getVmsForUpdate(DbFacade.getInstance()
Line 57: .getVmDao()
Line 58:
.getAllVmsForOvfUpdateForStoragePool(pool.getId()));
Line 59: VmCommand.updateVmInSpm(pool.getId(),
vmsForUpdate);
Line 60: if (!vmsForUpdate.isEmpty()) {
I agree and have already wrote about this issue in the wiki page that we may
want to split into chunks to avoid overflowing or sending gigantic xml.
we need to inspect the optimal chunk size, as the current implementation (not
related to this patch) of ReconstructMastercommand runs updateVmInSpm for all
vms in pool at once.
Line 61: for (VM vm : vmsForUpdate) {
Line 62: DbFacade.getInstance()
Line 63: .getVmDao()
Line 64: .updateVmOvfGeneration(vm.getId(),
vm.getStaticData().getDb_generation());
Line 65: }
Line 66: }
Line 67: List<VmTemplate> templatesForUpdate =
getTemplatesForUpdate(DbFacade.getInstance()
Line 68: .getVmTemplateDao()
Line 69:
.getAllVmTemplatesForOvfUpdateForStoragePool(pool.getId()));
as mentioned in last comment, as soon as chunks split will be added this will
be avoided.
Line 70: if (!templatesForUpdate.isEmpty()) {
Line 71:
VmTemplateCommand.UpdateTemplateInSpm(pool.getId(), templatesForUpdate);
Line 72: for (VmTemplate template : templatesForUpdate)
{
Line 73: DbFacade.getInstance()
Line 89: * returns a list of vms that are valid for update from the given
vm list.
Line 90: * valid vm is a vm which is not locked and none of it's disks is
locked.
Line 91: * @param vms
Line 92: * @return
Line 93: */
as soon as chunks split will be added this will be avoided.
Line 94: private List<VM> getVmsForUpdate(List<VM> vms) {
Line 95: List<VM> toReturn = new ArrayList<VM>();
Line 96: for (VM vm : vms) {
Line 97: if (VMStatus.ImageLocked != vm.getstatus()) {
--
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: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: liron aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches