Change in vdsm[master]: Shrink the new volume When merging block cow volumes

ykaplan at redhat.com ykaplan at redhat.com
Wed Dec 12 09:25:04 UTC 2012


Yeela Kaplan has posted comments on this change.

Change subject: Shrink the new volume When merging block cow volumes
......................................................................


Patch Set 1: (5 inline comments)

....................................................
Commit Message
Line 3: AuthorDate: 2012-11-13 17:47:46 +0200
Line 4: Commit:     Yeela Kaplan <ykaplan at redhat.com>
Line 5: CommitDate: 2012-12-04 19:29:38 +0200
Line 6: 
Line 7: Shrink the new volume When merging block cow volumes
Done
Line 8: 
Line 9: Change-Id: I8ace4c48d278cb84ce871bc402643131265c3198


....................................................
File vdsm/storage/blockVolume.py
Line 293:                        newSize)
Line 294:         sizemb = (newSize + 2047) / 2048
Line 295:         lvm.reduceLV(self.sdUUID, self.volUUID, sizemb)
Line 296: 
Line 297:     def shrinkOnMerge(self, dstVol):
Done
Line 298:         volParams = self.getVolumeParams()
Line 299:         if volParams['volFormat'] == volume.COW_FORMAT:
Line 300:             lvm.activateLVs(self.sdUUID, self.volUUID)
Line 301:             offset = qemuImg.check(self.getVolumePath(), qemuImg.FORMAT.QCOW2)


Line 301:             offset = qemuImg.check(self.getVolumePath(), qemuImg.FORMAT.QCOW2)
Line 302:             lvm.deactivateLVs(self.sdUUID, self.volUUID)
Line 303:             volActualSize = offset
Line 304:             volBaseSize = int(config.get("irs", "volume_utilization_chunk_mb"))
Line 305:             volBaseSize = volBaseSize * 1024 * 1024
Done
Line 306:             volUtil = int(config.get("irs", "volume_utilization_percent"))
Line 307:             finalSize = (volActualSize + volBaseSize * volUtil * 0.01)
Line 308:             self.reduce((finalSize + 511) / 512)
Line 309:             self.log.debug('Shrink qcow volume: %s on merge to : %s bytes',


Line 303:             volActualSize = offset
Line 304:             volBaseSize = int(config.get("irs", "volume_utilization_chunk_mb"))
Line 305:             volBaseSize = volBaseSize * 1024 * 1024
Line 306:             volUtil = int(config.get("irs", "volume_utilization_percent"))
Line 307:             finalSize = (volActualSize + volBaseSize * volUtil * 0.01)
Done
Line 308:             self.reduce((finalSize + 511) / 512)
Line 309:             self.log.debug('Shrink qcow volume: %s on merge to : %s bytes',
Line 310:                                                     self.sdUUID, finalSize)
Line 311: 


....................................................
File vdsm/storage/lvm.py
Line 1089: 
Line 1090:         raise se.LogicalVolumeExtendError(vgName, lvName, "%sM" % (size, ))
Line 1091: 
Line 1092: 
Line 1093: def reduceLV(vgName, lvName, size):
Done
Line 1094:     """
Line 1095:     Size units: MB (1024 ** 2 = 2 ** 20)B.
Line 1096:     """
Line 1097:     # WARNING! From man vgs:


--
To view, visit http://gerrit.ovirt.org/9725
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8ace4c48d278cb84ce871bc402643131265c3198
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>


More information about the vdsm-patches mailing list