use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class DiskValidatorTest method setupForLun.
private void setupForLun() {
LunDisk lunDisk = createLunDisk();
lunValidator = spy(new DiskValidator(lunDisk));
}
use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class DiskValidatorTest method createLunDisk.
private LunDisk createLunDisk(ScsiGenericIO sgio) {
LunDisk lunDisk = createLunDisk();
lunDisk.setSgio(sgio);
return lunDisk;
}
use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class DiskVmElementDiscardSupportValidatorTest method data.
@Parameters
public static Object[][] data() {
ValidationResult passDiscardNotSupportedByDiskInterface = new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE, getDiskAliasVarReplacement());
ValidationResult passDiscardNotSupportedForDirectLunByUnderlyingStorage = new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_FOR_DIRECT_LUN_BY_UNDERLYING_STORAGE, getDiskAliasVarReplacement());
ValidationResult passDiscardNotSupportedForDiskImageByUnderlyingStorage = new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_FOR_DISK_IMAGE_BY_UNDERLYING_STORAGE, getDiskAliasVarReplacement(), getStorageDomainNameVarReplacement());
ValidationResult passDiscardNotSupportedByCinder = new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_STORAGE_TYPE, getDiskAliasVarReplacement(), String.format("$diskStorageType %s", DiskStorageType.CINDER));
// sdSupportsDiscard, diskWipeAfterDelete, expectedResult.
return new Object[][] { // isPassDiscard == false
{ new DiskImage(), false, null, null, null, null, null, ValidationResult.VALID }, // Unsupported interface
{ new DiskImage(), true, DiskInterface.VirtIO, null, null, null, null, passDiscardNotSupportedByDiskInterface }, { new DiskImage(), true, DiskInterface.SPAPR_VSCSI, null, null, null, null, passDiscardNotSupportedByDiskInterface }, // Direct lun without support from underlying storage (different interfaces)
{ new LunDisk(), true, DiskInterface.VirtIO_SCSI, 0L, null, null, null, passDiscardNotSupportedForDirectLunByUnderlyingStorage }, { new LunDisk(), true, DiskInterface.IDE, 0L, null, null, null, passDiscardNotSupportedForDirectLunByUnderlyingStorage }, // Direct lun with support from underlying storage (different interfaces)
{ new LunDisk(), true, DiskInterface.VirtIO_SCSI, 1024L, null, null, null, ValidationResult.VALID }, { new LunDisk(), true, DiskInterface.IDE, 1024L, null, null, null, ValidationResult.VALID }, /*
Image on file storage domain:
- with/without support from underlying storage
- different interfaces
- different file storage types
*/
{ new DiskImage(), true, DiskInterface.VirtIO_SCSI, null, StorageType.NFS, true, null, ValidationResult.VALID }, { new DiskImage(), true, DiskInterface.IDE, null, StorageType.POSIXFS, false, null, ValidationResult.VALID }, { new DiskImage(), true, DiskInterface.IDE, null, StorageType.POSIXFS, null, null, ValidationResult.VALID }, /*
Image on block storage domain without support from underlying storage:
- different interfaces
- different block storage types
*/
{ new DiskImage(), true, DiskInterface.VirtIO_SCSI, null, StorageType.ISCSI, false, null, passDiscardNotSupportedForDiskImageByUnderlyingStorage }, { new DiskImage(), true, DiskInterface.IDE, null, StorageType.FCP, false, null, passDiscardNotSupportedForDiskImageByUnderlyingStorage }, /*
Image on block storage domain with support from underlying storage:
- different interfaces
- different block storage types
*/
{ new DiskImage(), true, DiskInterface.VirtIO_SCSI, null, StorageType.ISCSI, true, null, ValidationResult.VALID }, { new DiskImage(), true, DiskInterface.IDE, null, StorageType.FCP, true, null, ValidationResult.VALID }, /*
Image on block storage domain with support from underlying storage and WAD enabled:
- different interfaces
- different block storage types
*/
{ new DiskImage(), true, DiskInterface.VirtIO_SCSI, null, StorageType.ISCSI, true, true, new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_UNDERLYING_STORAGE_WHEN_WAD_IS_ENABLED, getStorageDomainNameVarReplacement(), getDiskAliasVarReplacement()) }, { new DiskImage(), true, DiskInterface.IDE, null, StorageType.FCP, true, true, new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_UNDERLYING_STORAGE_WHEN_WAD_IS_ENABLED, getStorageDomainNameVarReplacement(), getDiskAliasVarReplacement()) }, /*
Image on non file or block storage domain:
- different interfaces
- different non file or block storage types
*/
{ new DiskImage(), true, DiskInterface.VirtIO_SCSI, null, StorageType.UNKNOWN, null, null, createPassDiscardNotSupportedByStorageTypeValResult(StorageType.UNKNOWN) }, { new DiskImage(), true, DiskInterface.IDE, null, StorageType.CINDER, null, null, createPassDiscardNotSupportedByStorageTypeValResult(StorageType.CINDER) }, // Unsupported disk storage type (different interfaces)
{ new CinderDisk(), true, DiskInterface.VirtIO_SCSI, null, null, null, null, passDiscardNotSupportedByCinder }, { new CinderDisk(), true, DiskInterface.IDE, null, null, null, null, passDiscardNotSupportedByCinder } };
}
use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class EditDiskModel method datacenter_SelectedItemChanged.
@Override
protected void datacenter_SelectedItemChanged() {
super.datacenter_SelectedItemChanged();
// this needs to be executed after the data center is loaded because the update quota needs both values
if (getDisk().getDiskStorageType() == DiskStorageType.IMAGE) {
Guid storageDomainId = ((DiskImage) getDisk()).getStorageIds().get(0);
AsyncDataProvider.getInstance().getStorageDomainById(new AsyncQuery<>(storageDomain -> getStorageDomain().setSelectedItem(storageDomain)), storageDomainId);
} else if (getDisk().getDiskStorageType() == DiskStorageType.LUN) {
LunDisk lunDisk = (LunDisk) getDisk();
getDiskStorageType().setEntity(DiskStorageType.LUN);
getSize().setEntity(lunDisk.getLun().getDeviceSize());
getSizeExtend().setIsAvailable(false);
}
}
use of org.ovirt.engine.core.common.businessentities.storage.LunDisk in project ovirt-engine by oVirt.
the class VmDiskAttachPopupWidget method initLunDisksTable.
private void initLunDisksTable() {
lunDiskTable.enableColumnResizing();
AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getDiskAlias();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "60px");
AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getDiskDescription();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "85px");
AbstractTextColumn<EntityModel> lunIdColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getLUNId();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(lunIdColumn, constants.lunIdSanStorage(), "60px");
AbstractTextColumn<EntityModel> idColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getId().toString();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(idColumn, constants.idVmDiskTable(), "60px");
AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>(SizeConverter.SizeUnit.GiB) {
@Override
protected Long getRawValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return (long) disk.getLun().getDeviceSize();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(sizeColumn, constants.devSizeSanStorage(), "70px");
AbstractTextColumn<EntityModel> pathColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return String.valueOf(disk.getLun().getPathCount());
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(pathColumn, constants.pathSanStorage(), "40px");
AbstractTextColumn<EntityModel> vendorIdColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getVendorId();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(vendorIdColumn, constants.vendorIdSanStorage(), "70px");
AbstractTextColumn<EntityModel> productIdColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getProductId();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(productIdColumn, constants.productIdSanStorage(), "70px");
AbstractTextColumn<EntityModel> serialColumn = new AbstractTextColumn<EntityModel>() {
@Override
public String getValue(EntityModel object) {
LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
return disk.getLun().getSerial();
}
};
// $NON-NLS-1$
lunDiskTable.addColumn(serialColumn, constants.serialSanStorage(), "70px");
// $NON-NLS-1$
lunDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
lunDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
"30px");
lunDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
"30px");
lunDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {
@Override
public ImageResource getValue(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
return disk.isShareable() ? resources.shareableDiskIcon() : null;
}
@Override
public SafeHtml getTooltip(EntityModel object) {
Disk disk = ((DiskModel) object.getEntity()).getDisk();
if (disk.isShareable()) {
return SafeHtmlUtils.fromSafeConstant(constants.shareable());
}
return null;
}
}, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
"30px");
// $NON-NLS-1$
lunDiskTable.setWidth("100%");
lunDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
Aggregations