Fixed error on data volumes lager than 2.14TB when creating ins… (#3924)

This commit is contained in:
dahn 2020-03-05 11:52:55 +01:00 committed by GitHub
parent b4fdf22397
commit 4be70014bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -808,7 +808,7 @@ public class VmwareStorageProcessor implements StorageProcessor {
synchronized (this) {
s_logger.info("Delete file if exists in datastore to clear the way for creating the volume. file: " + volumeDatastorePath);
VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, vmdkName, dcMo, searchExcludedFolders);
vmMo.createDisk(volumeDatastorePath, (int)(volume.getSize() / (1024L * 1024L)), morDatastore, -1);
vmMo.createDisk(volumeDatastorePath, (long)(volume.getSize() / (1024L * 1024L)), morDatastore, -1);
vmMo.detachDisk(volumeDatastorePath, false);
}
} finally {

View File

@ -1099,12 +1099,12 @@ public class VirtualMachineMO extends BaseMO {
}
// vmdkDatastorePath: [datastore name] vmdkFilePath
public void createDisk(String vmdkDatastorePath, int sizeInMb, ManagedObjectReference morDs, int controllerKey) throws Exception {
public void createDisk(String vmdkDatastorePath, long sizeInMb, ManagedObjectReference morDs, int controllerKey) throws Exception {
createDisk(vmdkDatastorePath, VirtualDiskType.THIN, VirtualDiskMode.PERSISTENT, null, sizeInMb, morDs, controllerKey);
}
// vmdkDatastorePath: [datastore name] vmdkFilePath
public void createDisk(String vmdkDatastorePath, VirtualDiskType diskType, VirtualDiskMode diskMode, String rdmDeviceName, int sizeInMb,
public void createDisk(String vmdkDatastorePath, VirtualDiskType diskType, VirtualDiskMode diskMode, String rdmDeviceName, long sizeInMb,
ManagedObjectReference morDs, int controllerKey) throws Exception {
if (s_logger.isTraceEnabled())