Ala Hino has posted comments on this change.

Change subject: core: Prevent VM migration when SCSI reservation is used
......................................................................


Patch Set 8:

(3 comments)

https://gerrit.ovirt.org/#/c/37664/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java:

Line 642: 
Line 643:         VmValidator vmValidator = createVmValidator(vmFromParams);
Line 644:         // check that is vm uses scsi reservatin, then migration 
support should be null
Line 645:         if (vmUsesScsiReservation(vmValidator) && 
vmFromParams.getMigrationSupport() != null) {
Line 646:             return 
failCanDoAction(VdcBllMessages.MIGRATION_SUPPORT_NOT_VALID_WHEN_VM_USES_SCSI_RESERVATION);
> This change blocks setting the migration support if scsi reservation is use
When scsi reservation is set, migration policy cannot be updated:

1st case: set uses scsi reservation ==> migration policy is (implicitly) 
pinned-to-host and cannot be changed

2nd case: set migration policy and then set uses scsi reservation ==> (again) 
migration policy is (implicitly) pinned-to-host and cannot be changed

Actually, in both cases, migration policy is disabled.
Line 647:         }
Line 648: 
Line 649:         if 
(!validatePinningAndMigration(getReturnValue().getCanDoActionMessages(),
Line 650:                 getParameters().getVm().getStaticData(), 
getParameters().getVm().getCpuPinning())) {


https://gerrit.ovirt.org/#/c/37664/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VmValidator.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VmValidator.java:

Line 229:      * @return If scsi lun with scsi reservation is plugged to VM
Line 230:      */
Line 231:     public boolean isVmPluggedDiskUsingScsiReservation() {
Line 232:         // for unit tests
Line 233:         if (getDbFacade().getVmDeviceDao() == null) {
> I still don't understand why it's needed.
Removed and fixed UT
Line 234:             return false;
Line 235:         }
Line 236: 
Line 237:         VM vm = vms.iterator().next();


Line 233:         if (getDbFacade().getVmDeviceDao() == null) {
Line 234:             return false;
Line 235:         }
Line 236: 
Line 237:         VM vm = vms.iterator().next();
> In general the messages here contains a replacement variable, so you should
Done
Line 238:         List<VmDevice> devices = 
getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), 
VmDeviceGeneralType.DISK);
Line 239:         for (VmDevice device : devices) {
Line 240:             if (device.getIsPlugged() && 
device.isUsingScsiReservation()) {
Line 241:                 return true;


-- 
To view, visit https://gerrit.ovirt.org/37664
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia38c03dae04c9dbb30c882941391b1909f5af416
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ah...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Ala Hino <ah...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Candace Sheremeta <csher...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Freddy Rolland <froll...@redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadg...@redhat.com>
Gerrit-Reviewer: Idan Shaby <ish...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to