Shahar Havivi has uploaded a new change for review. Change subject: engine: Report downtime for each live migration ......................................................................
engine: Report downtime for each live migration Added downtime to the end migration event log Change-Id: I07fe88ad4aa6778c7180cf1041770af1ec21098b Bug-url: https://bugzilla.redhat.com/970711 Signed-off-by: Shahar Havivi <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/MigrateVmParameters.java M backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties 3 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/99/16399/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java index 5ec81c7..acd4797 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java @@ -1,5 +1,6 @@ package org.ovirt.engine.core.bll; +import java.util.Date; import java.util.List; import org.ovirt.engine.core.bll.job.ExecutionHandler; @@ -133,6 +134,8 @@ getVm().getTunnelMigration() != null ? getVm().getTunnelMigration() : getVdsGroup().isTunnelMigration(); } + + getParameters().setStartTime(new Date()); // Starting migration at src VDS boolean connectToLunDiskSuccess = connectLunDisks(_vdsDestinationId); @@ -323,4 +326,9 @@ return super.getCurrentVdsId(); } } + + public String getDowntime() { + // return time in seconds + return String.valueOf((new Date().getTime() - getParameters().getStartTime().getTime()) / 1000 % 60); + } } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/MigrateVmParameters.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/MigrateVmParameters.java index aa2ffb1..e825721 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/MigrateVmParameters.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/MigrateVmParameters.java @@ -1,5 +1,7 @@ package org.ovirt.engine.core.common.action; +import java.util.Date; + import org.ovirt.engine.core.compat.Guid; /** @@ -9,6 +11,7 @@ public class MigrateVmParameters extends VmOperationParameterBase { private static final long serialVersionUID = -7523728706659584319L; protected boolean forceMigrationForNonMigratableVM; + protected Date startTime; public MigrateVmParameters() { } @@ -35,4 +38,12 @@ this.forceMigrationForNonMigratableVM = forceMigrationForNonMigratableVM; } + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + } diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties index 982a8ef..83af4e6 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties @@ -199,7 +199,7 @@ USER_SUSPEND_VM_OK=VM ${VmName} on Host ${VdsName} is suspended. VM_FAILURE=VM ${VmName} cannot be found on Host ${VdsName}. VM_MIGRATION_ABORT=Migration failed: ${MigrationError} (VM: ${VmName}, Source: ${VdsName}, Destination: ${VdsDestination}). -VM_MIGRATION_DONE=Migration completed (VM: ${VmName}, Source: ${VdsName}, Destination: ${VdsDestination}). +VM_MIGRATION_DONE=Migration completed (VM: ${VmName}, Source: ${VdsName}, Destination: ${VdsDestination}, Downtime ${Downtime} sec). VM_MIGRATION_FAILED=Migration failed${DueToMigrationError} (VM: ${VmName}, Source: ${VdsName}, Destination: ${VdsDestination}). VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE=Migration failed${DueToMigrationError} while Host is in 'preparing for maintenance' state.\n Consider manual intervention\: stopping/migrating Vms as Host's state will not\n turn to maintenance while VMs are still running on it.(VM: ${VmName}, Source: ${VdsName}, Destination: ${VdsDestination}). VM_SET_TO_UNKNOWN_STATUS=VM ${VmName} was set to the Unknown status. -- To view, visit http://gerrit.ovirt.org/16399 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07fe88ad4aa6778c7180cf1041770af1ec21098b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
