Federico Simoncelli has uploaded a new change for review. Change subject: volume: save the correct size during creation ......................................................................
volume: save the correct size during creation As the comment in the patch states: when the volume format is raw what the guest sees it the actual size of the file/device therefore if the requested size doesn't match the real size (eg: extends granularity in LVM) we need to update the size value so that the metadata reflects the correct state. Change-Id: I155b93e156fd80788b2f97bf69d8db5452ab64d3 Signed-off-by: Federico Simoncelli <[email protected]> --- M vdsm/storage/volume.py 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/8629/1 diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py index b9eb356..3e1506c 100644 --- a/vdsm/storage/volume.py +++ b/vdsm/storage/volume.py @@ -467,6 +467,19 @@ preallocate, volParent, srcImgUUID, srcVolUUID, imgPath, volPath) + # When the volume format is raw what the guest sees it the actual + # size of the file/device therefore if the requested size doesn't + # match the real size (eg: extends granularity in LVM) we need to + # update the size value so that the metadata reflects the correct + # state. + if volFormat == RAW_FORMAT: + realSize = cls.getVSize(dom, imgUUID, volUUID) + if realSize != size: + cls.log.info("The requested volume size doesn't match the " + "supported granularity on %s, updating the volume " + "size from %s to %s", sdUUID, realSize, size) + size = realSize + vars.task.pushRecovery( task.Recovery("Create volume metadata rollback", clsModule, clsName, "createVolumeMetadataRollback", -- To view, visit http://gerrit.ovirt.org/8629 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I155b93e156fd80788b2f97bf69d8db5452ab64d3 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
