Skip to content

Commit 4be7001

Browse files
authored
Fixed error on data volumes lager than 2.14TB when creating ins… (#3924)
1 parent b4fdf22 commit 4be7001

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ public Answer cloneVolumeFromBaseTemplate(CopyCommand cmd) {
808808
synchronized (this) {
809809
s_logger.info("Delete file if exists in datastore to clear the way for creating the volume. file: " + volumeDatastorePath);
810810
VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, vmdkName, dcMo, searchExcludedFolders);
811-
vmMo.createDisk(volumeDatastorePath, (int)(volume.getSize() / (1024L * 1024L)), morDatastore, -1);
811+
vmMo.createDisk(volumeDatastorePath, (long)(volume.getSize() / (1024L * 1024L)), morDatastore, -1);
812812
vmMo.detachDisk(volumeDatastorePath, false);
813813
}
814814
} finally {

vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,13 +1099,13 @@ public Pair<String, Integer> getVncPort(String hostNetworkName) throws Exception
10991099
}
11001100

11011101
// vmdkDatastorePath: [datastore name] vmdkFilePath
1102-
public void createDisk(String vmdkDatastorePath, int sizeInMb, ManagedObjectReference morDs, int controllerKey) throws Exception {
1102+
public void createDisk(String vmdkDatastorePath, long sizeInMb, ManagedObjectReference morDs, int controllerKey) throws Exception {
11031103
createDisk(vmdkDatastorePath, VirtualDiskType.THIN, VirtualDiskMode.PERSISTENT, null, sizeInMb, morDs, controllerKey);
11041104
}
11051105

11061106
// vmdkDatastorePath: [datastore name] vmdkFilePath
1107-
public void createDisk(String vmdkDatastorePath, VirtualDiskType diskType, VirtualDiskMode diskMode, String rdmDeviceName, int sizeInMb,
1108-
ManagedObjectReference morDs, int controllerKey) throws Exception {
1107+
public void createDisk(String vmdkDatastorePath, VirtualDiskType diskType, VirtualDiskMode diskMode, String rdmDeviceName, long sizeInMb,
1108+
ManagedObjectReference morDs, int controllerKey) throws Exception {
11091109

11101110
if (s_logger.isTraceEnabled())
11111111
s_logger.trace("vCenter API trace - createDisk(). target MOR: " + _mor.getValue() + ", vmdkDatastorePath: " + vmdkDatastorePath + ", sizeInMb: " + sizeInMb +

0 commit comments

Comments
 (0)