public VolumeFormat getDiskVolumeFormat(VolumeType volumeType, StorageType storageType) { if (storageType.isFileDomain()) { return VolumeFormat.RAW; } else if (storageType.isBlockDomain()) { switch (volumeType) { case Sparse: return VolumeFormat.COW; case Preallocated: return VolumeFormat.RAW; default: return VolumeFormat.Unassigned; } } else if (storageType.isManagedBlockStorage()) { return volumeType == VolumeType.Preallocated ? VolumeFormat.RAW : VolumeFormat.Unassigned; } else { return VolumeFormat.Unassigned; } }
@Override protected void updateVolumeType(StorageType storageType) { // In case the user didn't select any specific allocation policy, it will be change according to the storage // domain type if (storageType.isManagedBlockStorage()) { getVolumeType().setSelectedItem(VolumeType.Preallocated); getVolumeType().setIsChangeable(false); } else if (!isUserSelectedVolumeType) { getVolumeType().setSelectedItem(storageType.isBlockDomain() ? VolumeType.Preallocated : VolumeType.Sparse); getVolumeType().setIsChangeable(true); } }
break; case MANAGED_BLOCK_STORAGE: domainByDiskType = d -> d.getStorageType().isManagedBlockStorage(); break; default:
private boolean isEditAvailable(StorageDomain storageDomain) { if (storageDomain == null || (storageDomain.getStorageType().isCinderDomain() && !storageDomain.getStorageType() .isManagedBlockStorage())) { return false; } boolean isEditAvailable; boolean isActive = storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Active || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Mixed; boolean isInMaintenance = storageDomain.getStatus() == StorageDomainStatus.Maintenance || storageDomain.getStatus() == StorageDomainStatus.PreparingForMaintenance; boolean isUnattached = storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Unattached || storageDomain.getStatus() == StorageDomainStatus.Detaching; boolean isInternalDomain = storageDomain.getStorageDomainType().isInternalDomain(); boolean isBlockStorage = storageDomain.getStorageType().isBlockDomain(); isEditAvailable = isActive || isBlockStorage || ((isInMaintenance || isUnattached) && isInternalDomain); return isEditAvailable; }
if (storageDomain != null && storageDomain.getStorageType().isManagedBlockStorage()) { model.getFormat().setIsChangeable(false);
boolean isGeneralAvailable = storage.getStorageType() != StorageType.GLANCE; boolean isCinderStorage = storage.getStorageType().isCinderDomain(); boolean isManagedBlockStorage = storage.getStorageType().isManagedBlockStorage(); boolean isGlusterStorage = storage.getStorageType() == StorageType.GLUSTERFS;