Martin Sivák has posted comments on this change.

Change subject: core,engine,webadmin: Automatic power management of hosts
......................................................................


Patch Set 6:

(16 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
Line 119:         boolean initSucceeded = true;
Line 120: 
Line 121:         /* Host is UP, re-set the policy controlled power management 
flag */
Line 122:         getVds().setPowerManagementControlledByPolicy(true);
Line 123:         
DbFacade.getInstance().getVdsDynamicDao().update(getVds().getDynamicData());
I will use the new stored procedure. If somebody disables the power management 
while the host is in maintenance, we might (and do) want to reset the flag when 
it comes up.
Line 124: 
Line 125:         if (vdsGroup.supportsTrustedService()) {
Line 126:             initSucceeded = initTrustedService();
Line 127:         }


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
Line 1305:     }
Line 1306: 
Line 1307:     public void setDisablePowerManagementPolicy(boolean 
disablePowerManagementPolicy) {
Line 1308:         
mVdsStatic.setDisablePowerManagementPolicy(disablePowerManagementPolicy);
Line 1309:     }
I was glad I got at least those names :) If you have any idea about better 
naming, I am all ears.


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java
Line 129:     private java.util.HashSet<Version> _supportedENGINESVersionsSet;
Line 130: 
Line 131:     /**
Line 132:      * This flag is set to true if the host PM can be controlled
Line 133:      * by policy. If an user triggered action puts the host
Done
Line 134:      * to maintenance or shuts it down, this flag is cleared.
Line 135:      *
Line 136:      * The flag should be re-set only by transitioning the host
Line 137:      * back to Up state.


Line 177:         transparentHugePagesState = 
VdsTransparentHugePagesState.Never;
Line 178:         vm_count = 0;
Line 179:         vms_cores_count = 0;
Line 180:         guest_overhead = 0;
Line 181:         powerManagementControlledByPolicy = false;
The others are also zero by default aren't they. I am not a big fan of implicit 
initialization.
Line 182:     }
Line 183: 
Line 184:     public Integer getcpu_cores() {
Line 185:         return this.cpu_cores;


Line 702:                 && ObjectUtils.objectsEqual(hwUUID, other.hwUUID)
Line 703:                 && ObjectUtils.objectsEqual(hwFamily, other.hwFamily)
Line 704:                 && ObjectUtils.objectsEqual(HBAs, other.HBAs)
Line 705:                 && 
ObjectUtils.objectsEqual(supportedEmulatedMachines, 
other.supportedEmulatedMachines))
Line 706:                 && 
ObjectUtils.objectsEqual(powerManagementControlledByPolicy, 
other.powerManagementControlledByPolicy);
Done
Line 707:     }
Line 708: 


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatic.java
Line 616:                 && ObjectUtils.objectsEqual(vdsGroupId, 
other.vdsGroupId)
Line 617:                 && ObjectUtils.objectsEqual(vdsStrength, 
other.vdsStrength)
Line 618:                 && vdsType == other.vdsType
Line 619:                 && ObjectUtils.objectsEqual(sshKeyFingerprint, 
other.sshKeyFingerprint))
Line 620:                 && 
ObjectUtils.objectsEqual(disablePowerManagementPolicy, 
other.disablePowerManagementPolicy);
Done
Line 621:     }


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterGuideModel.java
Line 489:         
host.setPmSecondaryOptionsMap(model.getPmSecondaryOptionsMap());
Line 490:         // Save other PM parameters.
Line 491:         host.setpm_enabled((Boolean) model.getIsPm().getEntity());
Line 492:         host.setPmSecondaryConcurrent((Boolean) 
model.getPmSecondaryConcurrent().getEntity());
Line 493:         host.setDisablePowerManagementPolicy((Boolean) 
model.getDisableAutomaticPowerManagement().getEntity());
Done
Line 494: 
Line 495:         AddVdsActionParameters vdsActionParams = new 
AddVdsActionParameters();
Line 496:         vdsActionParams.setvds(host);
Line 497:         vdsActionParams.setVdsId(host.getId());


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterGuideModel.java
Line 1629: 
Line 1630:         // Save other PM parameters.
Line 1631:         host.setpm_enabled((Boolean) model.getIsPm().getEntity());
Line 1632:         host.setPmSecondaryConcurrent((Boolean) 
model.getPmSecondaryConcurrent().getEntity());
Line 1633:         host.setDisablePowerManagementPolicy((Boolean) 
model.getDisableAutomaticPowerManagement().getEntity());
Done
Line 1634: 
Line 1635:         AddVdsActionParameters addVdsParams = new 
AddVdsActionParameters();
Line 1636:         addVdsParams.setVdsId(host.getId());
Line 1637:         addVdsParams.setvds(host);


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java
Line 892: 
Line 893:         // Save other PM parameters.
Line 894:         host.setpm_enabled((Boolean) model.getIsPm().getEntity());
Line 895:         host.setPmSecondaryConcurrent((Boolean) 
model.getPmSecondaryConcurrent().getEntity());
Line 896:         host.setDisablePowerManagementPolicy((Boolean) 
model.getDisableAutomaticPowerManagement().getEntity());
Done
Line 897: 
Line 898:         cancelConfirm();
Line 899:         model.startProgress(null);
Line 900: 


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
Line 933: 
Line 934:         // Initialize other PM fields.
Line 935:         setPmSecondaryConcurrent(new EntityModel());
Line 936:         getPmSecondaryConcurrent().setEntity(false);
Line 937:         setDisableAutomaticPowerManagement(new EntityModel());
Done
Line 938:         getDisableAutomaticPowerManagement().setEntity(false);
Line 939: 
Line 940:         setPmVariants(new ListModel());
Line 941:         List<String> pmVariants = new ArrayList<String>();


....................................................
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
Line 287: 
Line 288:     @UiField
Line 289:     @Path(value = "disableAutomaticPowerManagement.entity")
Line 290:     @WithElementId("disableAutomaticPowerManagementEditor")
Line 291:     EntityModelCheckBoxEditor disableAutomaticPowerManagementEditor;
see the answer in the xml file.
Line 292: 
Line 293:     @UiField
Line 294:     UiCommandButton testButton;
Line 295: 


....................................................
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.ui.xml
Line 319:                                         </div>
Line 320:                                         <g:Label 
ui:field="testMessage" addStyleNames="{style.testMessage}"/>
Line 321:                                     </g:HTMLPanel>
Line 322:                                 </g:FlowPanel>
Line 323:                                 <e:EntityModelCheckBoxEditor 
ui:field="disableAutomaticPowerManagementEditor"/>
I noticed, but there are many other checkboxes and I am not really sure how to 
import something that has a conflicting name.

I could do:
org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor 
disableAutomaticPowerManagementEditor;

but that is not nice.
Line 324:                             </g:FlowPanel>
Line 325:                         </t:content>
Line 326:                     </t:DialogTab>
Line 327:                 </t:tab>


....................................................
File packaging/dbscripts/upgrade/03_04_0340_add_vds_pm_flags.sql
Line 1: select fn_db_add_column('vds_static', 'disable_auto_pm', 'smallint 
default 0');
Done
Line 2: select fn_db_add_column('vds_dynamic', 'controlled_by_pm_policy', 
'smallint default 0');
Line 3: -- Enable automatic PM on all hosts in Up state


Line 1: select fn_db_add_column('vds_static', 'disable_auto_pm', 'smallint 
default 0');
Line 2: select fn_db_add_column('vds_dynamic', 'controlled_by_pm_policy', 
'smallint default 0');
Done
Line 3: -- Enable automatic PM on all hosts in Up state


Line 1: select fn_db_add_column('vds_static', 'disable_auto_pm', 'smallint 
default 0');
Line 2: select fn_db_add_column('vds_dynamic', 'controlled_by_pm_policy', 
'smallint default 0');
Line 3: -- Enable automatic PM on all hosts in Up state
Line 4: UPDATE vds_dynamic set controlled_by_pm_policy=1 WHERE status=3;
Done


....................................................
File packaging/dbscripts/vds_sp.sql
Line 187:  v_hw_uuid VARCHAR(255),
Line 188:  v_hw_family VARCHAR(255),
Line 189:  v_hbas VARCHAR(255),
Line 190:  v_supported_emulated_machines VARCHAR(255),
Line 191:  v_controlled_by_pm_policy INTEGER)
Done
Line 192: RETURNS VOID
Line 193:    AS $procedure$
Line 194: BEGIN
Line 195: 


-- 
To view, visit http://gerrit.ovirt.org/22376
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icdea8bdef15556be1591ffb7554f79238f865ec8
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msi...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Martin Sivák <msi...@redhat.com>
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

Reply via email to