Daniel Erez has posted comments on this change.
Change subject: core: move unplugged disks while VM is running
......................................................................
Patch Set 1:
(7 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveDisksCommand.java
Line 113: else if (vm.isRunningAndQualifyForDisksMigration()) {
Line 114: if (!isAllDisksPlugged(moveDiskParamsList)) {
Line 115: // Cannot live migrate and move disks concurrently
Line 116: addDisksDeactivatedMessage(moveDiskParamsList);
Line 117: continue;
Since I'm not blocking the all operation; instead, I'm blocking it only for the
'problematic' VM. Keep in mind that this command is designated to support
multiple disks - so, potentially, multiple VMs.
Line 118: }
Line 119:
Line 120: // Adding parameters for live migrate
Line 121:
liveMigrateVmDisksParametersList.add(createLiveMigrateVmDisksParameters(moveDiskParamsList,
vm.getId()));
Line 191: for (VdcActionParametersBase parameters : parametersList) {
Line 192: parameters.setSessionId(getParameters().getSessionId());
Line 193: }
Line 194:
Line 195: return new ArrayList<>(parametersList);
I'm casting it to ArrayList which is needed for RunMultipleActions signature.
Line 196: }
Line 197:
Line 198: /**
Line 199: * Return true if all specified disks are plugged; otherwise
false.
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommand.java
Line 361: protected VmValidator createVmValidator() {
Line 362: return new VmValidator(getVm());
Line 363: }
Line 364:
Line 365: private boolean isVmNotInPreview() {
Since I've removed it from MoveDisksCommand... - to simplify it's logic and as
the validation is more appropriate here.
Line 366: return
validate(createSnapshotsValidator().vmNotInPreview(getVmId()));
Line 367: }
Line 368:
Line 369: protected SnapshotsValidator createSnapshotsValidator() {
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/MoveDisksCommandTest.java
Line 132: initDiskImage(diskImageId);
Line 133: initVm(VMStatus.Down, Guid.newGuid(), diskImageId, false);
Line 134:
Line 135: command.updateParameters();
Line 136: assertTrue(command.getMoveDiskParametersList().size() == 1);
Done
Line 137: }
Line 138:
Line 139: @Test
Line 140: public void moveUnpluggedDiskVmUp() {
Line 143: initDiskImage(diskImageId);
Line 144: initVm(VMStatus.Up, Guid.newGuid(), diskImageId, false);
Line 145:
Line 146: command.updateParameters();
Line 147: assertTrue(command.getMoveDiskParametersList().size() == 1);
Done
Line 148: }
Line 149:
Line 150: @Test
Line 151: public void moveDiskAndLiveMigrateDisk() {
Line 181:
Line 182: command.updateParameters();
Line 183: assertTrue(command.getReturnValue()
Line 184: .getCanDoActionMessages()
Line 185:
.contains(VdcBllMessages.ACTION_TYPE_FAILED_DISKS_DEACTIVATED.toString()));
Done
Line 186: }
Line 187:
Line 188: /** Initialize Entities */
Line 189:
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java
Line 204:
Line 205: assertFalse(command.canDoAction());
Line 206: assertTrue(command.getReturnValue()
Line 207: .getCanDoActionMessages()
Line 208:
.contains(VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW.toString()));
Done
Line 209: }
Line 210:
Line 211: /** Initialize Entities */
Line 212:
--
To view, visit http://gerrit.ovirt.org/19105
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie0fbfd95c0086cfe0d792b3071a2d804ff32c18e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Cheryn Tan <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches