Arik Hadas has uploaded a new change for review. Change subject: core: migration logs ......................................................................
core: migration logs Change-Id: I074836f713cc708c9b680bb2d6b3e99af17f66c3 Signed-off-by: Arik Hadas <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java M backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties 5 files changed, 15 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/28/28928/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 f219207..ce6eb2c 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 @@ -257,7 +257,7 @@ : AuditLogType.VM_MIGRATION_START; } - private AuditLogType getAuditLogForMigrationFailure() { + protected AuditLogType getAuditLogForMigrationFailure() { if (getVds().getStatus() == VDSStatus.PreparingForMaintenance) { return AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE; } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java index 6da6845..d252943 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; +import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.MigrateVmToServerParameters; import org.ovirt.engine.core.common.businessentities.VDS; @@ -44,6 +45,15 @@ return true; } + @Override + protected AuditLogType getAuditLogForMigrationFailure() { + if (getDestinationVds() == null) { + return AuditLogType.VM_MIGRATION_FAILED_NO_VDS_TO_RUN_ON; + } + + return AuditLogType.VM_MIGRATION_TO_SERVER_FAILED; + } + /** * In case we failed to migrate to that specific server, the VM should no longer be pending, * and we report failure, without an attempt to rerun diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java index 7373f8d..8e1628b 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java @@ -453,6 +453,7 @@ VM_MIGRATION_ABORT(64, AuditLogSeverity.WARNING), VM_MIGRATION_FAILED(65, AuditLogSeverity.ERROR), VM_MIGRATION_FAILED_NO_VDS_TO_RUN_ON(166, AuditLogSeverity.WARNING), + VM_MIGRATION_TO_SERVER_FAILED(169, AuditLogSeverity.ERROR), VM_FAILURE(66, AuditLogSeverity.ERROR), VM_MIGRATION_START_SYSTEM_INITIATED(67), VM_MIGRATION_FAILED_FROM_TO(120, AuditLogSeverity.ERROR), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java index 1469aca..f6b7155 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java @@ -49,6 +49,7 @@ AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.VM_FAILURE); AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.VM_MIGRATION_START); AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.VM_MIGRATION_FAILED); + AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.VM_MIGRATION_TO_SERVER_FAILED); AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.VM_NOT_RESPONDING); AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.VM_STATUS_RESTORED); AddEventNotificationEntry(EventNotificationEntity.Vm, AuditLogType.HA_VM_RESTART_FAILED); 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 772d799..b12cba9 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties @@ -242,7 +242,8 @@ VM_FAILURE=VM ${VmName} cannot be found on Host ${VdsName}. VM_MIGRATION_ABORT=Migration failed: ${MigrationError} (VM: ${VmName}, Source: ${VdsName}, Destination: ${DestinationVdsName}). VM_MIGRATION_DONE=Migration completed (VM: ${VmName}, Source: ${VdsName}, Destination: ${DestinationVdsName}, Duration: ${Duration} sec). -VM_MIGRATION_FAILED=Migration failed${DueToMigrationError} (VM: ${VmName}, Source: ${VdsName}, Destination: ${DestinationVdsName}). +VM_MIGRATION_FAILED=Migration failed (VM: ${VmName}, Source: ${VdsName}). +VM_MIGRATION_TO_SERVER_FAILED=Migration failed${DueToMigrationError} (VM: ${VmName}, Source: ${VdsName}, Destination: ${DestinationVdsName}). VM_MIGRATION_FAILED_NO_VDS_TO_RUN_ON=Migration failed, No available host found (VM: ${VmName}, Source: ${VdsName}). 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: ${DestinationVdsName}). VM_SET_TO_UNKNOWN_STATUS=VM ${VmName} was set to the Unknown status. -- To view, visit http://gerrit.ovirt.org/28928 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I074836f713cc708c9b680bb2d6b3e99af17f66c3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
