Eduardo has uploaded a new change for review.
Change subject: getStorageDomainInfo: SP keys when disconnected.
......................................................................
getStorageDomainInfo: SP keys when disconnected.
Before this patch, getStorageDomainInfo() returns the real pool
info part (master_ver, spm_id, lver) only if the host is connected
to the same pool which the domain is attached. This patch reads
directly the pool MD for any MSD.
This changes the previous behaviour.
TODO: pool related information should not be returned as part of
this API response.
Change-Id: I8b7323d4ccaaaec0f39d5590a06879faa7fc999e
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 10 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/19555/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 2b91640..6262822 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2736,8 +2736,11 @@
# These keys are not likely to change (also because of
# BC) so it's not that horrible. In any case please
# remove this when we can stop supporting this API.
- info.update({'lver': -1, 'spm_id': -1, 'master_ver': 0})
if info['role'] == sd.MASTER_DOMAIN:
+ pmd = sp.StoragePool._getPoolMD(dom)
+ info['lver'] = pmd[sp.PMDK_LVER]
+ info['master_ver'] = pmd[sp.PMDK_MASTER_VER]
+ info['spm_id'] = -1
try:
# Verify that the host is connected to the same pool which
# the SD is attached to.
@@ -2757,9 +2760,12 @@
"master is %s",
sdUUID, pool.masterDomain.sdUUID)
else:
- poolInfo = pool.getInfo()
- for key in ('lver', 'spm_id', 'master_ver'):
- info[key] = poolInfo[key]
+ # spm_id is relevant only when the host is connected
+ # to the pool and this SD is the actual master
+ info['spm_id'] = pmd[sp.PMDK_SPM_ID]
+
+ else: # sd.REGULAR_DOMAIN
+ info.update({'lver': -1, 'spm_id': -1, 'master_ver':
0})
return dict(info=info)
--
To view, visit
http://gerrit.ovirt.org/19555
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b7323d4ccaaaec0f39d5590a06879faa7fc999e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>