Nir Soffer has posted comments on this change. Change subject: StorageDomainManifest: move extend and extendVolume ......................................................................
Patch Set 11: (3 comments) https://gerrit.ovirt.org/#/c/42266/11/tests/storagefakelib.py File tests/storagefakelib.py: Line 27: Line 28: class FakeLVM(object): Line 29: _PV_SIZE = 10 << 30 # We pretend all PVs contribute 10G of space Line 30: _PV_PE_SIZE = 128 << 20 # Guessed via inspection of real environment Line 31: _PV_PE_START = _PV_PE_SIZE Where did you take this value from? Line 32: Line 33: def __init__(self, root): Line 34: self.root = root Line 35: os.mkdir(os.path.join(self.root, 'dev')) Line 75: for dev in devices: Line 76: self._create_pv(dev, vgName, self._PV_SIZE) Line 77: md['pv_count'] += len(devices) Line 78: md['pv_name'] = tuple(md['pv_name'] + tuple(devices)) Line 79: new_space = self._PV_SIZE * len(devices) We need to consider unusable 384MiB per pv. Line 80: md['size'] += new_space Line 81: md['free'] += new_space Line 82: new_extents = new_space / md['extent_size'] Line 83: md['extent_count'] += new_extents Line 80: md['size'] += new_space Line 81: md['free'] += new_space Line 82: new_extents = new_space / md['extent_size'] Line 83: md['extent_count'] += new_extents Line 84: md['free_count'] += new_extents PV size include 2 metadata areas (128MiB each), and a small header (1MiB). Since everything is aligned to extent size, it consumes 3 * 128MiB. Here is an example of real vg for reference, to make sure we simulate correct values: # vgs -o name,pv_name 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 VG PV 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 /dev/mapper/1IET_00070001 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 /dev/mapper/1IET_00070002 # vgdisplay 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 --- Volume group --- VG Name 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 System ID Format lvm2 Metadata Areas 4 Metadata Sequence No 1156 VG Access read/write VG Status resizable MAX LV 0 Cur LV 8 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 99.25 GiB PE Size 128.00 MiB Total PE 794 Alloc PE / Size 33 / 4.12 GiB Free PE / Size 761 / 95.12 GiB VG UUID uyNOSB-lMgp-66Ao-Y9hC-wRaJ-nO61-yUsiik # pvdisplay /dev/mapper/1IET_00070001 --- Physical volume --- PV Name /dev/mapper/1IET_00070001 VG Name 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 PV Size 50.00 GiB / not usable 384.00 MiB Allocatable yes PE Size 128.00 MiB Total PE 397 Free PE 364 Allocated PE 33 PV UUID AraoRz-VBeF-OLGP-3Cbe-enRK-o07t-EvUJxR # pvdisplay /dev/mapper/1IET_00070002 --- Physical volume --- PV Name /dev/mapper/1IET_00070002 VG Name 2e133cd6-bfea-4655-ae6c-dc51a38bb7b9 PV Size 50.00 GiB / not usable 384.00 MiB Allocatable yes PE Size 128.00 MiB Total PE 397 Free PE 397 Allocated PE 0 PV UUID tQJe09-QFsi-2Jkh-T5kZ-VeUW-JTDt-6ssgzs Line 85: Line 86: def createLV(self, vgName, lvName, size, activate=True, contiguous=False, Line 87: initialTag=None): Line 88: lv_attr = dict(voltype='-', -- To view, visit https://gerrit.ovirt.org/42266 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ad1769d7e4db6fc0883b37a67d071c278b96c8b Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
