Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk;
import com.cloud.hypervisor.kvm.storage.KVMStoragePool;
import com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager;
import com.cloud.hypervisor.kvm.storage.LibvirtStorageAdaptor;
import com.cloud.hypervisor.kvm.storage.MultipathNVMeOFPool;
import com.cloud.hypervisor.kvm.storage.MultipathSCSIPool;
import com.cloud.resource.CommandWrapper;
Expand Down Expand Up @@ -187,7 +188,9 @@ notify the guest in one step (no passphrase needed, qemu already has the secret
/* fetch new size as seen from libvirt, don't want to assume anything */
pool = storagePoolMgr.getStoragePool(spool.getType(), spool.getUuid());
pool.refresh();
final long finalSize = pool.getPhysicalDisk(volumeId).getVirtualSize();
// an encrypted RBD image keeps its LUKS2 header in front of the data, which is not part of the size of the volume
final long finalSize = rbdEncrypted ? LibvirtStorageAdaptor.getEncryptedRbdVolumeSize(pool, volumeId)
: pool.getPhysicalDisk(volumeId).getVirtualSize();
logger.debug("after resize, size reports as: " + toHumanReadableSize(finalSize) + ", requested: " + toHumanReadableSize(newSize));
return new ResizeVolumeAnswer(command, true, "success", finalSize);
} catch (final CloudRuntimeException e) {
Expand Down
Loading
Loading