Use the upper ceiling (in gb) for the volume size during restore

This commit is contained in:
Abhisar Sinha 2026-03-23 16:04:19 +05:30 committed by Abhishek Kumar
parent 50403f7548
commit 5907d6427a
1 changed files with 3 additions and 1 deletions

View File

@ -1024,7 +1024,9 @@ public class ServerAdapter extends ManagerBase {
if (provisionedSizeInGb <= 0) {
throw new InvalidParameterValueException("Provisioned size must be greater than zero");
}
provisionedSizeInGb = Math.max(1L, provisionedSizeInGb / (1024L * 1024L * 1024L));
// round-up provisionedSizeInGb to the next whole GB
long GB = 1024L * 1024L * 1024L;
provisionedSizeInGb = Math.max(1L, (provisionedSizeInGb + GB - 1) / GB);
Long initialSize = null;
if (StringUtils.isNotBlank(request.getInitialSize())) {
try {