Nir Soffer has posted comments on this change.
Change subject: StorageDomain.getInfo - report lvm metadata device for block sd ......................................................................
Patch Set 5:
(8 comments)
https://gerrit.ovirt.org/#/c/64433/5/lib/api/vdsm-api.yml File lib/api/vdsm-api.yml:
Line 5659: type: string Line 5660: Line 5661: - defaultvalue: null Line 5662: description: The GUID of the device containing the domain lvm metadata (optional) Line 5663: name: lvmmetadatadevice Update names Line 5664: type: string Line 5665: type: object Line 5666: Line 5667: StorageDomainStatus: &StorageDomainStatus
https://gerrit.ovirt.org/#/c/64433/5/lib/vdsm/storage/exception.py File lib/vdsm/storage/exception.py:
Line 1558: Line 1559: Line 1560: class CannotGetVGMetadataPV(StorageException): Line 1561: def __init__(self, vgname): Line 1562: self.value = "vgname=%s" % (vgname) Expected one pv with pv metadata, vgname=%s, pvs=%s Line 1563: code = 616 Line 1564: message = "Cannot get Volume Group metadata PV" Line 1565: Line 1566:
https://gerrit.ovirt.org/#/c/64433/5/vdsm/storage/blockSD.py File vdsm/storage/blockSD.py:
Line 1109 Line 1110 Line 1111 Line 1112 Line 1113 Take this
Line 1116: <<<<<<< HEAD Line 1117: info['metadatadevice'] = self._manifest.getMetadataLVDevice() Line 1118: ======= Line 1119: info['metadatadevice'] = self._manifest.getMetadataLVFirstDevice() Line 1120: info['lvmmetadatadevice'] = self._manifest.getVgMetadataDevice() And this, but - use vgmetadatadevice - use separate words metadata_device, vg_metadata_device Line 1121: >>>>>>> 7da51c9... StorageDomain.getInfo - report lvm metadata device for block sd Line 1122: return info Line 1123: Line 1124: def getStats(self):
https://gerrit.ovirt.org/#/c/64433/5/vdsm/storage/lvm.py File vdsm/storage/lvm.py:
Line 585 Line 586 Line 587 Line 588 Line 589 Let put the new method here, more specific.
Line 502: def _invalidatevgs(self, vgNames): Line 503: vgNames = _normalizeargs(vgNames) Line 504: with self._lock: Line 505: for vgName in vgNames: Line 506: self._vgs[vgName] = aStub(vgName, True) Not related. Line 507: Line 508: def _invalidateAllVgs(self): Line 509: with self._lock: Line 510: self._stalevg = True
Line 555: reloaded = self._reloadpvs(stalepvs) Line 556: pvs.update(reloaded) Line 557: return pvs.values() Line 558: Line 559: def getVgPvs(self, vgName): Add docsting explaining this new function compared with getPv. Line 560: stalepvs = [] Line 561: vgpvs = [] Line 562: vg = self.getVg(vgName) Line 563: for pvName in vg.pv_name:
Line 1337: def getVgMetadataPv(vgName): Line 1338: pvs = _lvminfo.getVgPvs(vgName) Line 1339: mdpvs = [pv for pv in pvs if not isinstance(pv, Stub) and _isMetadataPv(pv)] Line 1340: if len(mdpvs) != 1: Line 1341: se.CannotGetVGMetadataPV(vgName) "Expected one metadata pv in vg: %s, found: %s" % (vg.name, pvs)
Can we use an error name about the issue an not about the operation?
e,g UnexpectedVolumeGroupMetadata? Line 1342: return mdpvs[0] Line 1343: Line 1344: def _isMetadataPv(pv): Line 1345: """