use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class AddDiskCommandTest method testIscsiLunCannotBeAddedIfSgioIsFilteredAndScsiReservationEnabled.
@Test
public void testIscsiLunCannotBeAddedIfSgioIsFilteredAndScsiReservationEnabled() {
LunDisk disk = createISCSILunDisk(ScsiGenericIO.FILTERED);
command.getParameters().setDiskInfo(disk);
command.getParameters().getDiskVmElement().setUsingScsiReservation(true);
mockVm();
mockInterfaceList();
assertFalse("Lun disk added successfully WHILE sgio is filtered and scsi reservation is enabled", command.checkIfLunDiskCanBeAdded(spyDiskValidator(disk)));
ValidateTestUtils.assertValidationMessages("checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response", command, EngineMessage.ACTION_TYPE_FAILED_SGIO_IS_FILTERED);
}
use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class NewDiskModel method flush.
@Override
public void flush() {
if (!validate()) {
return;
}
super.flush();
switch(getDiskStorageType().getEntity()) {
case LUN:
LunDisk lunDisk = (LunDisk) getDisk();
LUNs luns = getSanStorageModelBase().getAddedLuns().get(0).getEntity();
luns.setLunType(getStorageType().getSelectedItem());
lunDisk.setLun(luns);
break;
case CINDER:
CinderDisk cinderDisk = (CinderDisk) getDisk();
cinderDisk.setSizeInGigabytes(getSize().getEntity());
cinderDisk.setVolumeFormat(VolumeFormat.RAW);
cinderDisk.setCinderVolumeType(getCinderVolumeType().getSelectedItem());
break;
default:
DiskImage diskImage = (DiskImage) getDisk();
if (getSize() != null && getSize().getEntity() != null) {
diskImage.setSizeInGigabytes(getSize().getEntity());
}
diskImage.setVolumeType(getVolumeType().getSelectedItem());
diskImage.setVolumeFormat(AsyncDataProvider.getInstance().getDiskVolumeFormat(diskImage.getVolumeType(), getStorageDomain().getSelectedItem().getStorageType()));
break;
}
}
Aggregations