mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Increase reserve on ScaleIO disk formatting for fragmentation (#7955)
Signed-off-by: Marcus Sorensen <mls@apple.com> Co-authored-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
parent
b8c8e17318
commit
f049d4d189
@ -552,12 +552,12 @@ public class ScaleIOStorageAdaptor implements StorageAdaptor {
|
||||
|
||||
/**
|
||||
* Calculates usable size from raw size, assuming qcow2 requires 192k/1GB for metadata
|
||||
* We also remove 32MiB for potential encryption/safety factor.
|
||||
* We also remove 128MiB for encryption/fragmentation/safety factor.
|
||||
* @param raw size in bytes
|
||||
* @return usable size in bytesbytes
|
||||
*/
|
||||
public static long getUsableBytesFromRawBytes(Long raw) {
|
||||
long usable = raw - (32 << 20) - ((raw >> 30) * 200704);
|
||||
long usable = raw - (128 << 20) - ((raw >> 30) * 200704);
|
||||
if (usable < 0) {
|
||||
usable = 0L;
|
||||
}
|
||||
|
||||
@ -23,9 +23,9 @@ import org.junit.Test;
|
||||
public class ScaleIOStorageAdaptorTest {
|
||||
@Test
|
||||
public void getUsableBytesFromRawBytesTest() {
|
||||
Assert.assertEquals("Overhead calculated for 8Gi size", 8554774528L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(8L << 30));
|
||||
Assert.assertEquals("Overhead calculated for 4Ti size", 4294130925568L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(4000L << 30));
|
||||
Assert.assertEquals("Overhead calculated for 500Gi size", 536737005568L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(500L << 30));
|
||||
Assert.assertEquals("Overhead calculated for 8Gi size", 8454111232L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(8L << 30));
|
||||
Assert.assertEquals("Overhead calculated for 4Ti size", 4294030262272L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(4000L << 30));
|
||||
Assert.assertEquals("Overhead calculated for 500Gi size", 536636342272L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(500L << 30));
|
||||
Assert.assertEquals("Unsupported small size", 0, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(1L));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user