Eduardo has uploaded a new change for review.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Make getRepoStats() a hsm method.
Making repoStats pool independent.
Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Signed-off-by: Eduardo ewarszaw@redhat.com --- M vdsm/storage/hsm.py M vdsm/storage/sp.py 2 files changed, 101 insertions(+), 99 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/14673/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 9a44795..d3e1beb 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -2473,7 +2473,15 @@ vars.task.setDefaultException( se.StoragePoolActionError("spUUID=%s" % spUUID)) vars.task.getSharedLock(STORAGE, spUUID) - return self.getPool(spUUID).getInfo() + pool = self.getPool(spUUID) + poolInfo = pool.getInfo() + doms = pool.getDomains() + domInfo = self._getDomsStats(pool.monitorDomains, doms) + for sdUUID in doms.iterkeys(): + if domInfo[sdUUID]['isoprefix']: + poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix'] + + return dict(info=poolInfo, dominfo=domInfo)
@public def createStorageDomain(self, storageType, sdUUID, domainName, @@ -3466,6 +3474,92 @@ pool._upgradePool(targetDomVersion) return {"upgradeStatus": "started"}
+ def _getDomsStats(self, domainMonitor, doms): + domInfo = {} + repoStats = self._getRepoStats(domainMonitor) + + for sdUUID, sdStatus in doms: + # Return statistics for active domains only + domInfo[sdUUID] = {'status': sdStatus, 'alerts': []} + + if sdStatus != sd.DOM_ACTIVE_STATUS or sdUUID not in repoStats: + continue + + domInfo[sdUUID]['version'] = repoStats[sdUUID]['result']['version'] + + # For unreachable domains repoStats will return disktotal and + # diskfree as None. + if (repoStats[sdUUID]['disktotal'] is not None + and repoStats[sdUUID]['diskfree'] is not None): + domInfo[sdUUID]['disktotal'] = repoStats[sdUUID]['disktotal'] + domInfo[sdUUID]['diskfree'] = repoStats[sdUUID]['diskfree'] + + if not repoStats[sdUUID]['mdavalid']: + domInfo[sdUUID]['alerts'].append({ + 'code': se.SmallVgMetadata.code, + 'message': se.SmallVgMetadata.message, + }) + self.log.warning("VG %s's metadata size too small %s", + sdUUID, repoStats[sdUUID]['mdasize']) + + if not repoStats[sdUUID]['mdathreshold']: + domInfo[sdUUID]['alerts'].append({ + 'code': se.VgMetadataCriticallyFull.code, + 'message': se.VgMetadataCriticallyFull.message, + }) + self.log.warning("VG %s's metadata size exceeded critical " + "size: mdasize=%s mdafree=%s", sdUUID, + repoStats[sdUUID]['mdasize'], + repoStats[sdUUID]['mdafree']) + return domInfo + + def _getRepoStats(self, domainMonitor): + repoStats = {} + statsGenTime = time.time() + + for sdUUID in domainMonitor.monitoredDomains: + domStatus = domainMonitor.getStatus(sdUUID) + + if domStatus.error is None: + code = 0 + elif isinstance(domStatus.error, se.StorageException): + code = domStatus.error.code + else: + code = se.StorageException.code + + disktotal, diskfree = domStatus.diskUtilization + vgmdtotal, vgmdfree = domStatus.vgMdUtilization + lastcheck = '%.1f' % (statsGenTime - domStatus.lastCheck) + + repoStats[sdUUID] = { + 'finish': domStatus.lastCheck, + + 'result': { + 'code': code, + 'lastCheck': lastcheck, + 'delay': str(domStatus.readDelay), + 'valid': (domStatus.error is None), + 'version': domStatus.version, + }, + + 'disktotal': disktotal, + 'diskfree': diskfree, + + 'mdavalid': domStatus.vgMdHasEnoughFreeSpace, + 'mdathreshold': domStatus.vgMdFreeBelowThreashold, + 'mdasize': vgmdtotal, + 'mdafree': vgmdfree, + + 'masterValidate': { + 'mount': domStatus.masterMounted, + 'valid': domStatus.masterValid + }, + + 'isoprefix': domStatus.isoPrefix, + } + + return repoStats + @public def repoStats(self, options=None): """ @@ -3478,7 +3572,7 @@ result = {}
for p in self.pools.values(): - repo_stats = p.getRepoStats() + repo_stats = self._getRepoStats(p.domainMonitor)
for d in repo_stats: result[d] = repo_stats[d]['result'] diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index 19d1b0a..12b50e2 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -19,7 +19,6 @@ #
import os -import time from glob import iglob, glob import logging import threading @@ -1413,66 +1412,16 @@ return self.getMetaParam(PMDK_SPM_ID)
@unsecured - def getRepoStats(self): - #FIXME : this should actually be built in HSM - repoStats = {} - statsGenTime = time.time() - - for sdUUID in self.domainMonitor.monitoredDomains: - domStatus = self.domainMonitor.getStatus(sdUUID) - - if domStatus.error is None: - code = 0 - elif isinstance(domStatus.error, se.StorageException): - code = domStatus.error.code - else: - code = se.StorageException.code - - disktotal, diskfree = domStatus.diskUtilization - vgmdtotal, vgmdfree = domStatus.vgMdUtilization - lastcheck = '%.1f' % (statsGenTime - domStatus.lastCheck) - - repoStats[sdUUID] = { - 'finish': domStatus.lastCheck, - - 'result': { - 'code': code, - 'lastCheck': lastcheck, - 'delay': str(domStatus.readDelay), - 'valid': (domStatus.error is None), - 'version': domStatus.version, - }, - - 'disktotal': disktotal, - 'diskfree': diskfree, - - 'mdavalid': domStatus.vgMdHasEnoughFreeSpace, - 'mdathreshold': domStatus.vgMdFreeBelowThreashold, - 'mdasize': vgmdtotal, - 'mdafree': vgmdfree, - - 'masterValidate': { - 'mount': domStatus.masterMounted, - 'valid': domStatus.masterValid - }, - - 'isoprefix': domStatus.isoPrefix, - } - - return repoStats - - @unsecured def getInfo(self): """ Get storage pool info. """ - msdUUID = self.masterDomain.sdUUID - try: msdInfo = self.masterDomain.getInfo() except Exception: self.log.error("Couldn't read from master domain", exc_info=True) - raise se.StoragePoolMasterNotFound(self.spUUID, msdUUID) + raise se.StoragePoolMasterNotFound(self.spUUID, + self.masterDomain.sdUUID)
try: pmd = self._getPoolMD(self.masterDomain) @@ -1484,57 +1433,16 @@ 'type': msdInfo['type'], 'name': pmd[PMDK_POOL_DESCRIPTION], 'domains': domainListEncoder(pmd[PMDK_DOMAINS].iteritems()), - 'master_uuid': msdUUID, + 'master_uuid': self.masterDomain.sdUUID, 'master_ver': pmd[PMDK_MASTER_VER], 'lver': pmd[PMDK_LVER], 'spm_id': pmd[PMDK_SPM_ID], 'pool_status': 'uninitialized', 'version': str(msdInfo['version']), 'isoprefix': '', + 'pool_status': 'connected', } - - domInfo = {} - repoStats = self.getRepoStats() - - for sdUUID, sdStatus in pmd[PMDK_DOMAINS].iteritems(): - # Return statistics for active domains only - domInfo[sdUUID] = {'status': sdStatus, 'alerts': []} - - if sdStatus != sd.DOM_ACTIVE_STATUS or sdUUID not in repoStats: - continue - - if repoStats[sdUUID]['isoprefix']: - poolInfo['isoprefix'] = repoStats[sdUUID]['isoprefix'] - - domInfo[sdUUID]['version'] = repoStats[sdUUID]['result']['version'] - - # For unreachable domains repoStats will return disktotal and - # diskfree as None. - if (repoStats[sdUUID]['disktotal'] is not None - and repoStats[sdUUID]['diskfree'] is not None): - domInfo[sdUUID]['disktotal'] = repoStats[sdUUID]['disktotal'] - domInfo[sdUUID]['diskfree'] = repoStats[sdUUID]['diskfree'] - - if not repoStats[sdUUID]['mdavalid']: - domInfo[sdUUID]['alerts'].append({ - 'code': se.SmallVgMetadata.code, - 'message': se.SmallVgMetadata.message, - }) - self.log.warning("VG %s's metadata size too small %s", - sdUUID, repoStats[sdUUID]['mdasize']) - - if not repoStats[sdUUID]['mdathreshold']: - domInfo[sdUUID]['alerts'].append({ - 'code': se.VgMetadataCriticallyFull.code, - 'message': se.VgMetadataCriticallyFull.message, - }) - self.log.warning("VG %s's metadata size exceeded critical " - "size: mdasize=%s mdafree=%s", sdUUID, - repoStats[sdUUID]['mdasize'], - repoStats[sdUUID]['mdafree']) - - poolInfo["pool_status"] = "connected" - return dict(info=poolInfo, dominfo=domInfo) + return poolInfo
@unsecured def getIsoDomain(self):
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2231/ (1/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2295/ (2/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1392/ (3/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2231/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1392/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2295/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2245/ (2/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1406/ (1/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2309/ (3/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2245/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1406/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2309/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1445/ (1/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2348/ (2/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2284/ (3/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2284/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1445/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2348/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2376/ (1/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1472/ (2/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2311/ (3/3)
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4: Fails
Build Failed
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/2311/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/1472/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/2376/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/14673 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Daniel Paikov paikov@gmail.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Yeela Kaplan ykaplan@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ayal Baron has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4: (1 inline comment)
.................................................... File vdsm/storage/hsm.py Line 2474: se.StoragePoolActionError("spUUID=%s" % spUUID)) Line 2475: vars.task.getSharedLock(STORAGE, spUUID) Line 2476: pool = self.getPool(spUUID) Line 2477: poolInfo = pool.getInfo() Line 2478: doms = pool.getDomains() this call is redundant, take the list from poolInfo Line 2479: domInfo = self._getDomsStats(pool.domainMonitor, doms) Line 2480: for sdUUID in doms.iterkeys(): Line 2481: if 'isoprefix' in domInfo[sdUUID] and domInfo[sdUUID]['isoprefix']: Line 2482: poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
Eduardo has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4: (1 inline comment)
.................................................... File vdsm/storage/hsm.py Line 2474: se.StoragePoolActionError("spUUID=%s" % spUUID)) Line 2475: vars.task.getSharedLock(STORAGE, spUUID) Line 2476: pool = self.getPool(spUUID) Line 2477: poolInfo = pool.getInfo() Line 2478: doms = pool.getDomains() Sadly, poolInfo.domains field contains the dictionary as a string (by sp.domainListEncoder). In order to get the dictionary and for the sake of simplicity and uniformity, we call StoragePool.getDomains() which unfortunately may issue a new MD read.
"May the Cache be with you" Line 2479: domInfo = self._getDomsStats(pool.domainMonitor, doms) Line 2480: for sdUUID in doms.iterkeys(): Line 2481: if 'isoprefix' in domInfo[sdUUID] and domInfo[sdUUID]['isoprefix']: Line 2482: poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
Ayal Baron has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4: (1 inline comment)
.................................................... File vdsm/storage/hsm.py Line 2474: se.StoragePoolActionError("spUUID=%s" % spUUID)) Line 2475: vars.task.getSharedLock(STORAGE, spUUID) Line 2476: pool = self.getPool(spUUID) Line 2477: poolInfo = pool.getInfo() Line 2478: doms = pool.getDomains() so call it with domainListDecoder... ? Line 2479: domInfo = self._getDomsStats(pool.domainMonitor, doms) Line 2480: for sdUUID in doms.iterkeys(): Line 2481: if 'isoprefix' in domInfo[sdUUID] and domInfo[sdUUID]['isoprefix']: Line 2482: poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
Eduardo has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 4: (1 inline comment)
.................................................... File vdsm/storage/hsm.py Line 2474: se.StoragePoolActionError("spUUID=%s" % spUUID)) Line 2475: vars.task.getSharedLock(STORAGE, spUUID) Line 2476: pool = self.getPool(spUUID) Line 2477: poolInfo = pool.getInfo() Line 2478: doms = pool.getDomains() Due to the capitalize() call in domainsListDecoder() the functions are not totally symmetric.
I prefer the chance of reading twice the MD.
Not convinced here, a lot of effort was put in minimize the number of MD accesses in this flow. Only two (+1) remain instead of a potential read for each key before. Line 2479: domInfo = self._getDomsStats(pool.domainMonitor, doms) Line 2480: for sdUUID in doms.iterkeys(): Line 2481: if 'isoprefix' in domInfo[sdUUID] and domInfo[sdUUID]['isoprefix']: Line 2482: poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 5:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4271/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3374/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4190/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 6: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4386/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3489/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4305/ : SUCCESS
Ayal Baron has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 6: Code-Review+2
It was hard, but after running with meld to compare the changes between sp and hsm this is indeed only moving repoStats into hsm (as it should have been to begin with
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 7: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4550/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3653/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4472/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 7:
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4550/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4472/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3662/ : FAILURE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 7:
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3663/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4556/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4478/ : SUCCESS
Ayal Baron has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 7: Code-Review+2
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 7: -Verified
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4556/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4478/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3687/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 8:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3846/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4731/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4655/ : SUCCESS
Eduardo has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 8: Verified+1
Verified with Change-Id: I983d49b0a42cc06428ec75b7795d23abaa6ab84c
Federico Simoncelli has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 8: Verified-1 Code-Review-1
(1 comment)
'isoprefix' is not returned and you can't run VMs with cdroms.
.................................................... File vdsm/storage/hsm.py Line 2544: poolInfo = pool.getInfo() Line 2545: doms = pool.getDomains() Line 2546: domInfo = self._getDomsStats(pool.domainMonitor, doms) Line 2547: for sdUUID in doms.iterkeys(): Line 2548: if 'isoprefix' in domInfo[sdUUID] and domInfo[sdUUID]['isoprefix']: 'isoprefix' is not returned by _getDomsStats, it's returned by _getRepoStats. The end result is that 'isoprefix' is not reported and you can't run VMs with cdroms. Line 2549: poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix'] Line 2550: Line 2551: return dict(info=poolInfo, dominfo=domInfo) Line 2552:
Eduardo has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 9: Verified-1
Adding the working patch.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 9:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4953/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4067/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4877/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 10: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4966/ : ABORTED
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4080/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4890/ : SUCCESS
Eduardo has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 10: Verified+1
Verified by Liron that running a VM with CD is working.
Dan Kenigsberg has posted comments on this change.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Patch Set 10: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Make getRepoStats() a hsm method. ......................................................................
Make getRepoStats() a hsm method.
Making repoStats pool independent.
Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574 Signed-off-by: Eduardo ewarszaw@redhat.com Reviewed-on: http://gerrit.ovirt.org/14673 Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/storage/hsm.py M vdsm/storage/sp.py 2 files changed, 108 insertions(+), 98 deletions(-)
Approvals: Eduardo: Verified Dan Kenigsberg: Looks good to me, approved
vdsm-patches@lists.fedorahosted.org