Daniel Erez has uploaded a new change for review. Change subject: core,ui: [WIP] allow disk live migration when VM is Paused ......................................................................
core,ui: [WIP] allow disk live migration when VM is Paused Allow live migrating a disk when the VM is in Paused status. I.e. on each step of LSM process, verify that the VM is in Up or Paused status. Change-Id: I37926ba2ae87c334e6f2d17b65b91290fe2c3d39 Bug-Url: https://bugzilla.redhat.com/894035 Signed-off-by: Daniel Erez <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractSPMAsyncTaskHandler.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 8 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/02/11202/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractSPMAsyncTaskHandler.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractSPMAsyncTaskHandler.java index 4d4c5d9..ffb1f13 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractSPMAsyncTaskHandler.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractSPMAsyncTaskHandler.java @@ -75,6 +75,7 @@ @Override public void endWithFailure() { + getEnclosingCommand().getParameters().setTaskGroupSuccess(false); getReturnValue().setSucceeded(true); } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java index 7e347b3..cc6ecd2 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java @@ -113,7 +113,7 @@ } private boolean isVmRunning(VM vm) { - return vm.getStatus() == VMStatus.Up && + return (vm.getStatus() == VMStatus.Up || vm.getStatus() == VMStatus.Paused) && vm.getRunOnVds() != null && !vm.getRunOnVds().equals(Guid.Empty); } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java index aaba71f..afb6151 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateDiskCommand.java @@ -36,7 +36,8 @@ getParameters().setDiskAlias(getDiskAlias()); getParameters().setImageGroupID(getImageGroupId()); getParameters().setCommandType(getActionType()); - getParameters().setTaskGroupSuccess(VMStatus.Up == getVm().getStatus() && getParameters().getTaskGroupSuccess()); + getParameters().setTaskGroupSuccess(getParameters().getTaskGroupSuccess() && + (getVm().getStatus() == VMStatus.Up || getVm().getStatus() == VMStatus.Paused)); } /* Overridden CommandBase Methods */ diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index bf8c664..3d595e4 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -139,7 +139,7 @@ ACTION_TYPE_FAILED_VM_IS_NOT_RUNNING=Cannot ${action} ${type}. VM is not running. ACTION_TYPE_FAILED_VM_IS_NOT_UP=Cannot ${action} ${type}. VM is not up. ACTION_TYPE_FAILED_VM_IS_NOT_DOWN=Cannot ${action} ${type}. At least one of the VMs is not down. -ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP=Cannot ${action} ${type}. VM ${VmName} must be in status Down or Up. +ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP=Cannot ${action} ${type}. VM ${VmName} must be in status Down, Up or Paused. ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING=Cannot ${action} ${type}. VM is in saving/restoring state.\n\ -Please wait until the VM's status has changed. ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT=Cannot ${action} ${type}. The VM is performing an operation on a Snapshot. Please wait for the operation to finish, and try again. diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index 235cc68..dd1962c 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -350,7 +350,7 @@ @DefaultStringValue("Cannot ${action} ${type}. At least one of the VMs is not down.") String ACTION_TYPE_FAILED_VM_IS_NOT_DOWN(); - @DefaultStringValue("Cannot ${action} ${type}. VM ${VmName} must be in status Down or Up.") + @DefaultStringValue("Cannot ${action} ${type}. VM ${VmName} must be in status Down, Up or Paused.") String ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP(); @DefaultStringValue("Cannot ${action} ${type}. VM is in saving/restoring state.\n-Please wait until the VM's status has changed.") diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java index 69a51c7..beab031 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmDiskListModel.java @@ -1003,7 +1003,7 @@ } VM vm = getEntity(); - if (vm == null || vm.getStatus() != VMStatus.Up) { + if (vm == null || (vm.getStatus() != VMStatus.Up && vm.getStatus() != VMStatus.Paused)) { return false; } diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 5e4970d..61ca593 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -137,7 +137,7 @@ ACTION_TYPE_FAILED_VM_IS_NOT_RUNNING=Cannot ${action} ${type}. VM is not running. ACTION_TYPE_FAILED_VM_IS_NOT_UP=Cannot ${action} ${type}. VM is not up. ACTION_TYPE_FAILED_VM_IS_NOT_DOWN=Cannot ${action} ${type}. At least one of the VMs is not down. -ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP=Cannot ${action} ${type}. VM ${VmName} must be in status Down or Up. +ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP=Cannot ${action} ${type}. VM ${VmName} must be in status Down, Up or Paused. ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING=Cannot ${action} ${type}. VM is in saving/restoring state.\n\ -Please wait until the VM's status has changed. ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT=Cannot ${action} ${type}. The VM is performing an operation on a Snapshot. Please wait for the operation to finish, and try again. diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index d60ce36..696f7e0 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -136,7 +136,7 @@ ACTION_TYPE_FAILED_VM_IS_NOT_RUNNING=Cannot ${action} ${type}. VM is not running. ACTION_TYPE_FAILED_VM_IS_NOT_UP=Cannot ${action} ${type}. VM is not up. ACTION_TYPE_FAILED_VM_IS_NOT_DOWN=Cannot ${action} ${type}. At least one of the VMs is not down. -ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP=Cannot ${action} ${type}. VM ${VmName} must be in status Down or Up. +ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP=Cannot ${action} ${type}. VM ${VmName} must be in status Down, Up or Paused. ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING=Cannot ${action} ${type}. VM is in saving/restoring state.\n\ -Please wait until the VM's status has changed. ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT=Cannot ${action} ${type}. The VM is performing an operation on a Snapshot. Please wait for the operation to finish, and try again. -- To view, visit http://gerrit.ovirt.org/11202 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37926ba2ae87c334e6f2d17b65b91290fe2c3d39 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
