Search in sources :

Example 61 with LunDisk

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);
}
Also used : LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) Test(org.junit.Test) BaseCommandTest(org.ovirt.engine.core.bll.BaseCommandTest)

Example 62 with LunDisk

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;
    }
}
Also used : CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

LunDisk (org.ovirt.engine.core.common.businessentities.storage.LunDisk)62 Test (org.junit.Test)29 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)21 CinderDisk (org.ovirt.engine.core.common.businessentities.storage.CinderDisk)18 BaseCommandTest (org.ovirt.engine.core.bll.BaseCommandTest)16 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)13 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)13 VM (org.ovirt.engine.core.common.businessentities.VM)10 ArrayList (java.util.ArrayList)9 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)7 Guid (org.ovirt.engine.core.compat.Guid)7 DiskVmElement (org.ovirt.engine.core.common.businessentities.storage.DiskVmElement)6 HashMap (java.util.HashMap)5 VDS (org.ovirt.engine.core.common.businessentities.VDS)5 StorageServerConnectionManagementVDSParameters (org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters)5 HashSet (java.util.HashSet)3 FullEntityOvfData (org.ovirt.engine.core.common.businessentities.storage.FullEntityOvfData)3 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)3 ImageResource (com.google.gwt.resources.client.ImageResource)2 List (java.util.List)2