Change in ovirt-engine[master]: engine: Track the time a VM was last stopped

ofrenkel at redhat.com ofrenkel at redhat.com
Tue Jan 7 13:20:29 UTC 2014


Omer Frenkel has submitted this change and it was merged.

Change subject: engine: Track the time a VM was last stopped
......................................................................


engine: Track the time a VM was last stopped

Today, ovirt provides information on how long a VM has been up.  Users
have requested the ability to see how long a VM has been down.  This
could be useful for determining which VMs need to be powered on for
maintenance (eg. package updates).  As a first step, just track this
information and make it available via the REST API.  In the future, it
could be displayed in the UI in the 'Uptime' column or similar.

This patch makes the following specific changes:
- Add new column last_stop_time to the vm_dynamic table and update views
- When a new VM is created, initialize stop time to the current time
- Catch VM state changes in ResourceManager and update last_stop_time
- Add "stop_time" to the REST API and always show it in the VM resource

Signed-off-by: Adam Litke <alitke at redhat.com>
Change-Id: I0f94a56e0c82246a932fc1800a2c9ef8c5205e13
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1042854
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDynamic.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDAODbFacadeImpl.java
M backend/manager/modules/dal/src/test/resources/fixtures.xml
M backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/ResourceManager.java
M packaging/dbscripts/create_views.sql
A packaging/dbscripts/upgrade/03_04_0380_add_last_stop_time_to_vm_dynamic.sql
M packaging/dbscripts/vms_sp.sql
13 files changed, 46 insertions(+), 4 deletions(-)

Approvals:
  Omer Frenkel: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f94a56e0c82246a932fc1800a2c9ef8c5205e13
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpastern at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list