Change in vdsm[master]: nettests: remove most of connectivity checks
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: nettests: remove most of connectivity checks
......................................................................
Patch Set 1: Verified+1
--
To view, visit http://gerrit.ovirt.org/24167
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1895d266dfb2d7f8ca7dcff860e0d96b1fc07e14
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-HasComments: No
10 years, 3 months
Change in vdsm[ovirt-3.3]: spec: do not remove vdsm logs when pkg removed
by Douglas Schilling Landgraf
Hello Yaniv Bronhaim, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/24044
to review the following change.
Change subject: spec: do not remove vdsm logs when pkg removed
......................................................................
spec: do not remove vdsm logs when pkg removed
In the commits 4a07386 0b6035a we introduced the concept
of creating of metadata.log, mom.log, supervdsm.log and vdsm.log
logs during the rpm install and sets the proper
user/group. However, now when removing vdsm the logs are removed too
which is not the behaviour as before these commits. This patch will
add ghost macro in the spec to keep logs available when vdsm is removed.
Change-Id: Idc8e62d5a0a6166c9141fe9d6016a525a3331694
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/23876
Reviewed-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 15 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/24044/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 8d63591..f5142a9 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -567,12 +567,10 @@
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
-# Creating VDSM logs
+# Creating VDSM logs in this session to avoid rpmbuild
+# complain during the build
install -dDm 0755 %{buildroot}@VDSMLOGDIR@
-touch %{buildroot}@VDSMLOGDIR(a)/metadata.log
-touch %{buildroot}@VDSMLOGDIR(a)/mom.log
-touch %{buildroot}@VDSMLOGDIR(a)/supervdsm.log
-touch %{buildroot}@VDSMLOGDIR(a)/vdsm.log
+touch %{buildroot}@VDSMLOGDIR(a)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
# Install the respawn utility
install -Dm 0755 init/sysvinit/respawn \
@@ -652,6 +650,14 @@
%{_bindir}/vdsm-tool sebool-config || :
# set the vdsm "secret" password for libvirt
%{_bindir}/vdsm-tool set-saslpasswd
+
+# After vdsm install we should create the logs files.
+# In the install session we create it but since we use
+# the ghost macro (in files session) the files are not included
+touch @VDSMLOGDIR(a)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+chmod 0644 @VDSMLOGDIR(a)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+chown @VDSMUSER@:@VDSMGROUP@ @VDSMLOGDIR(a)/{metadata.log,mom.log,vdsm.log}
+chown root:root @VDSMLOGDIR(a)/supervdsm.log
# Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.conf.
# So Remove them if it is played with /etc/sysctl.conf.
@@ -844,10 +850,10 @@
%endif
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/metadata.log
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/mom.log
-%config %attr(0644, root, root) @VDSMLOGDIR(a)/supervdsm.log
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/vdsm.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/metadata.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/mom.log
+%ghost %config %attr(0644, root, root) @VDSMLOGDIR(a)/supervdsm.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/vdsm.log
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
%dir %{_libexecdir}/%{vdsm_name}
--
To view, visit http://gerrit.ovirt.org/24044
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc8e62d5a0a6166c9141fe9d6016a525a3331694
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: vdsm.spec: own metadata supervdsm mom logs
by Douglas Schilling Landgraf
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/24043
to review the following change.
Change subject: vdsm.spec: own metadata supervdsm mom logs
......................................................................
vdsm.spec: own metadata supervdsm mom logs
/var/log/vdsm/metadata.log /var/log/vdsm/supervdsm.log
/var/log/vdsm/mom.log should be owned by VDSM.
Additionaly, now are now creating with touch those files
(and vdsm.log) during the vdsm rpm install.
Change-Id: I2776b8518930393b281a1885268813f8d4d7c85b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1055153
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/23754
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 8 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/24043/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index cfcda05..8d63591 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -567,9 +567,11 @@
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
-# VDSM Log
+# Creating VDSM logs
install -dDm 0755 %{buildroot}@VDSMLOGDIR@
-# Avoid rpmbuild complain about vdsm.log doesn't exist during the build
+touch %{buildroot}@VDSMLOGDIR(a)/metadata.log
+touch %{buildroot}@VDSMLOGDIR(a)/mom.log
+touch %{buildroot}@VDSMLOGDIR(a)/supervdsm.log
touch %{buildroot}@VDSMLOGDIR(a)/vdsm.log
# Install the respawn utility
@@ -842,7 +844,10 @@
%endif
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
-%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/vdsm.log
+%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/metadata.log
+%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/mom.log
+%config %attr(0644, root, root) @VDSMLOGDIR(a)/supervdsm.log
+%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/vdsm.log
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
%dir %{_libexecdir}/%{vdsm_name}
--
To view, visit http://gerrit.ovirt.org/24043
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2776b8518930393b281a1885268813f8d4d7c85b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: vdsm.spec: vdsm should own vdsm.log
by Douglas Schilling Landgraf
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/24042
to review the following change.
Change subject: vdsm.spec: vdsm should own vdsm.log
......................................................................
vdsm.spec: vdsm should own vdsm.log
/var/log/vdsm/vdsm.log should be owned by VDSM.
Change-Id: Id12a78f3243138cd95a13cc7c8a8d3d499ceee4a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1055153
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/23696
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/24042/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 1435e0a..cfcda05 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -567,6 +567,11 @@
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
+# VDSM Log
+install -dDm 0755 %{buildroot}@VDSMLOGDIR@
+# Avoid rpmbuild complain about vdsm.log doesn't exist during the build
+touch %{buildroot}@VDSMLOGDIR(a)/vdsm.log
+
# Install the respawn utility
install -Dm 0755 init/sysvinit/respawn \
%{buildroot}%{_datadir}/%{vdsm_name}/respawn
@@ -837,6 +842,7 @@
%endif
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/vdsm.log
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
%dir %{_libexecdir}/%{vdsm_name}
--
To view, visit http://gerrit.ovirt.org/24042
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id12a78f3243138cd95a13cc7c8a8d3d499ceee4a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
10 years, 4 months
Change in vdsm[master]: vm iface statistics: never report negative rates
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: vm iface statistics: never report negative rates
......................................................................
vm iface statistics: never report negative rates
When Linux tx/rx couters overflow their 32 bit limit, they wrap back to
zero. This causes our reported rxRate/txRate to become negative for one
nample. 51073875161d9b932b7
Change-Id: I40daeb12172a7f54f135b3018405ef228983fa93
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/23598/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 7c2d496..c40a78d 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -609,10 +609,12 @@
ifStats['txDropped'] = str(eInfo[nic.name][7])
ifRxBytes = (100.0 *
- (eInfo[nic.name][0] - sInfo[nic.name][0]) /
+ (eInfo[nic.name][0] - sInfo[nic.name][0]) %
+ 2 ** 32 /
sampleInterval / ifSpeed / self.MBPS_TO_BPS)
ifTxBytes = (100.0 *
- (eInfo[nic.name][4] - sInfo[nic.name][4]) /
+ (eInfo[nic.name][4] - sInfo[nic.name][4]) %
+ 2 ** 32 /
sampleInterval / ifSpeed / self.MBPS_TO_BPS)
ifStats['rxRate'] = '%.1f' % ifRxBytes
--
To view, visit http://gerrit.ovirt.org/23598
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I40daeb12172a7f54f135b3018405ef228983fa93
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: domainMonitor: tag pool monitored domains
by Federico Simoncelli
Hello Ayal Baron,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/21357
to review the following change.
Change subject: domainMonitor: tag pool monitored domains
......................................................................
domainMonitor: tag pool monitored domains
As part of the monitoring implementation:
7b1cc6a Adding [start|stop]MonitoringDomain()
updateMonitoringThreads has been modified to assume that the list of
the monitored domains is the same as the list of the attached domains:
+ poolDoms = self.getDomains()
...
- for sdUUID in monitoredDomains:
+ for sdUUID in poolDoms:
if sdUUID not in activeDomains:
try:
self.domainMonitor.stopMonitoring(sdUUID)
This assumption is not valid when we are detaching a storage domain
(as it won't be listed by getDomains anymore). The resulting issue is
that the monitor domain thread is not stopped and the host id is left
acquired (ids file/device kept open by sanlock).
This patch reverts the updateMonitoringThreads changes and adds a tag
mechanism for the pool monitored domains.
Label: DOWNSTREAM ONLY
Change-Id: I71714b24b7c8bbb437cbb2e8e254690215df020a
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21165
Reviewed-by: Ayal Baron <abaron(a)redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/domainMonitor.py
M vdsm/storage/hsm.py
M vdsm/storage/sp.py
3 files changed, 17 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/21357/1
diff --git a/vdsm/storage/domainMonitor.py b/vdsm/storage/domainMonitor.py
index a998f80..4f4b823 100644
--- a/vdsm/storage/domainMonitor.py
+++ b/vdsm/storage/domainMonitor.py
@@ -84,12 +84,20 @@
def monitoredDomains(self):
return self._domains.keys()
- def startMonitoring(self, sdUUID, hostId):
- if sdUUID in self._domains:
+ @property
+ def poolMonitoredDomains(self):
+ return [k for k, v in self._domains.iteritems() if v.poolDomain]
+
+ def startMonitoring(self, sdUUID, hostId, poolDomain=True):
+ domainThread = self._domains.get(sdUUID)
+
+ if domainThread is not None:
+ domainThread.poolDomain |= poolDomain
return
domainThread = DomainMonitorThread(weakref.proxy(self),
sdUUID, hostId, self._interval)
+ domainThread.poolDomain = poolDomain
domainThread.start()
# The domain should be added only after it succesfully started
self._domains[sdUUID] = domainThread
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index bb89d94..7481064 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3699,7 +3699,7 @@
def startMonitoringDomain(self, sdUUID, hostID, options=None):
with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
rm.LockType.exclusive):
- self.domainMonitor.startMonitoring(sdUUID, int(hostID))
+ self.domainMonitor.startMonitoring(sdUUID, int(hostID), False)
@deprecated
@public
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index cae84b3..cf12d35 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -142,7 +142,7 @@
return self.spmRole, self.getSpmLver(), self.getSpmId()
def __del__(self):
- if len(self.domainMonitor.monitoredDomains) > 0:
+ if len(self.domainMonitor.poolMonitoredDomains) > 0:
threading.Thread(target=self.stopMonitoringDomains).start()
@unsecured
@@ -1541,15 +1541,13 @@
@unsecured
@misc.samplingmethod
def updateMonitoringThreads(self):
- # getDomains() returns a dict of {sdUUID:status}
- # {sdUUID1: status1, sdUUID2: status2, ...}
+ # domain list it's list of sdUUID:status
+ # sdUUID1:status1,sdUUID2:status2,...
self.invalidateMetadata()
- poolDoms = self.getDomains()
- activeDomains = tuple(sdUUID for sdUUID in poolDoms
- if poolDoms[sdUUID] == sd.DOM_ACTIVE_STATUS)
- monitoredDomains = self.domainMonitor.monitoredDomains
+ activeDomains = self.getDomains(activeOnly=True)
+ monitoredDomains = self.domainMonitor.poolMonitoredDomains
- for sdUUID in poolDoms:
+ for sdUUID in monitoredDomains:
if sdUUID not in activeDomains:
try:
self.domainMonitor.stopMonitoring(sdUUID)
--
To view, visit http://gerrit.ovirt.org/21357
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71714b24b7c8bbb437cbb2e8e254690215df020a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: hsm: fix isoprefix KeyError for inactive domains
by Federico Simoncelli
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20300
to review the following change.
Change subject: hsm: fix isoprefix KeyError for inactive domains
......................................................................
hsm: fix isoprefix KeyError for inactive domains
In a recent change f9cf58b (Make getRepoStats() a hsm method) a
new regression was introduced that causes a KeyError on isoprefix
for inactive domains.
In this patch:
* fix the isoprefix KeyError for inactive domains
* fix indentation for a related block of code
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1020543
Change-Id: Ice78a4d652d495aff8672524fcd80b7306013928
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20250
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/20300/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index a432fe9..b38b0b0 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2555,8 +2555,8 @@
domInfo = self._getDomsStats(pool.domainMonitor, doms)
for sdUUID in doms.iterkeys():
if domInfo[sdUUID]['isoprefix']:
- poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
- break
+ poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
+ break
else:
poolInfo['isoprefix'] = '' # No ISO domain found
@@ -3583,7 +3583,8 @@
for sdUUID, sdStatus in doms.iteritems():
# Return statistics for active domains only
- domInfo[sdUUID] = {'status': sdStatus, 'alerts': []}
+ domInfo[sdUUID] = {'status': sdStatus, 'alerts': [],
+ 'isoprefix': ''}
if sdStatus != sd.DOM_ACTIVE_STATUS or sdUUID not in repoStats:
continue
@@ -3615,9 +3616,8 @@
repoStats[sdUUID]['mdasize'],
repoStats[sdUUID]['mdafree'])
- isoprefix = repoStats[sdUUID]['isoprefix']
- domInfo[sdUUID]['isoprefix'] = \
- isoprefix if isoprefix is not None else ''
+ if repoStats[sdUUID]['isoprefix'] is not None:
+ domInfo[sdUUID]['isoprefix'] = repoStats[sdUUID]['isoprefix']
return domInfo
--
To view, visit http://gerrit.ovirt.org/20300
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice78a4d652d495aff8672524fcd80b7306013928
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: Adding [start|stop]MonitoringDomain().
by Federico Simoncelli
Hello Sandro Bonazzola, Dan Kenigsberg, Eduardo,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20194
to review the following change.
Change subject: Adding [start|stop]MonitoringDomain().
......................................................................
Adding [start|stop]MonitoringDomain().
startMonitoringDomain() is added for monitoring a storage domain
without being connected to the pool and geting and ID for such
SD lockspace.
stopMonitoringDomain() stops the monitoring and releases the ID.
Monitoring results are gathered with repoStats().
Caveat Emptor:
SDs added to the monitor using startMonitoringDomain() should not
be part of the pool! i.e. the pool domain set and the added SDs set
should be disjoint.
Making repoStats pool independent.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1019273
Change-Id: I983d49b0a42cc06428ec75b7795d23abaa6ab84c
Signed-off-by: Eduardo Warszawski <ewarszaw(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19762
Tested-by: Sandro Bonazzola <sbonazzo(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M client/vdsClient.py
M vdsm/API.py
M vdsm/BindingXMLRPC.py
M vdsm/storage/hsm.py
M vdsm/storage/sp.py
M vdsm_api/Bridge.py
M vdsm_api/vdsmapi-schema.json
7 files changed, 123 insertions(+), 32 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/20194/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 1087f32..e727b49 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1692,6 +1692,16 @@
print 'Domain %s %s' % (d, str(stats[d]))
return 0, ''
+ def startMonitoringDomain(self, args):
+ sdUUID, hostID = args
+ status = self.s.startMonitoringDomain(sdUUID, hostID)
+ return status['status']['code'], status['status']['message']
+
+ def stopMonitoringDomain(self, args):
+ sdUUID, = args
+ status = self.s.stopMonitoringDomain(sdUUID)
+ return status['status']['code'], status['status']['message']
+
def snapshot(self, args):
vmUUID, sdUUID, imgUUID, baseVolUUID, volUUID = args
@@ -2466,8 +2476,16 @@
)),
'repoStats': (serv.repoStats,
('',
- 'Get the the health status of the active domains'
+ 'Get the health status of the monitored domains'
)),
+ 'startMonitoringDomain': (serv.startMonitoringDomain,
+ ('<sdUUID> <hostID>',
+ 'Start SD: sdUUID monitoring with hostID'
+ )),
+ 'stopMonitoringDomain': (serv.stopMonitoringDomain,
+ ('<sdUUID>',
+ 'Stop monitoring SD: sdUUID'
+ )),
'snapshot': (serv.snapshot,
('<vmId> <sdUUID> <imgUUID> <baseVolUUID> <volUUID>',
'Take a live snapshot'
diff --git a/vdsm/API.py b/vdsm/API.py
index 37bb908..fa9a3ab 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1396,6 +1396,12 @@
def getStorageRepoStats(self):
return self._irs.repoStats()
+ def startMonitoringDomain(self, sdUUID, hostID):
+ return self._irs.startMonitoringDomain(sdUUID, hostID)
+
+ def stopMonitoringDomain(self, sdUUID):
+ return self._irs.stopMonitoringDomain(sdUUID)
+
def getLVMVolumeGroups(self, storageType=None):
return self._irs.getVGList(storageType)
diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py
index 20aaee1..48ced76 100644
--- a/vdsm/BindingXMLRPC.py
+++ b/vdsm/BindingXMLRPC.py
@@ -787,6 +787,14 @@
api = API.Global()
return api.getStorageRepoStats()
+ def startMonitoringDomain(self, sdUUID, hostID, options=None):
+ api = API.Global()
+ return api.startMonitoringDomain(sdUUID, hostID)
+
+ def stopMonitoringDomain(self, sdUUID, options=None):
+ api = API.Global()
+ return api.stopMonitoringDomain(sdUUID)
+
def vgsGetList(self, storageType=None, options=None):
api = API.Global()
return api.getLVMVolumeGroups(storageType)
@@ -937,6 +945,8 @@
(self.domainsGetList, 'getStorageDomainsList'),
(self.poolsGetConnectedList, 'getConnectedStoragePoolsList'),
(self.storageRepoGetStats, 'repoStats'),
+ (self.startMonitoringDomain, 'startMonitoringDomain'),
+ (self.stopMonitoringDomain, 'stopMonitoringDomain'),
(self.vgsGetList, 'getVGList'),
(self.devicesGetList, 'getDeviceList'),
(self.devicesGetVisibility, 'getDevicesVisibility'),
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index d73d0f7..0744ae8 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -40,6 +40,7 @@
from vdsm.config import config
import sp
+import domainMonitor
import sd
import blockSD
import nfsSD
@@ -93,6 +94,8 @@
STORAGE_CONNECTION_DIR = os.path.join(constants.P_VDSM_LIB, "connections/")
QEMU_READABLE_TIMEOUT = 30
+
+HSM_DOM_MON_LOCK = "HsmDomainMonitorLock"
def public(f=None, **kwargs):
@@ -398,6 +401,9 @@
name="storageRefresh")
storageRefreshThread.daemon = True
storageRefreshThread.start()
+
+ monitorInterval = config.getint('irs', 'sd_health_check_delay')
+ self.domainMonitor = domainMonitor.DomainMonitor(monitorInterval)
@public
def registerDomainStateChangeCallback(self, callbackFunc):
@@ -971,9 +977,8 @@
for dom in sorted(domList):
vars.task.getExclusiveLock(STORAGE, dom)
- return sp.StoragePool(
- spUUID, self.taskMng).create(poolName, masterDom, domList,
- masterVersion, leaseParams)
+ return sp.StoragePool(spUUID, self.domainMonitor, self.taskMng).create(
+ poolName, masterDom, domList, masterVersion, leaseParams)
@public
def connectStoragePool(self, spUUID, hostID, scsiKey,
@@ -1003,8 +1008,10 @@
"spUUID=%s, msdUUID=%s, masterVersion=%s, hostID=%s, "
"scsiKey=%s" % (spUUID, msdUUID, masterVersion,
hostID, scsiKey)))
- return self._connectStoragePool(spUUID, hostID, scsiKey, msdUUID,
- masterVersion, options)
+ with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
+ rm.LockType.exclusive):
+ return self._connectStoragePool(spUUID, hostID, scsiKey, msdUUID,
+ masterVersion, options)
def _connectStoragePool(self, spUUID, hostID, scsiKey, msdUUID,
masterVersion, options=None):
@@ -1048,7 +1055,7 @@
masterVersion=masterVersion)
return
- pool = sp.StoragePool(spUUID, self.taskMng)
+ pool = sp.StoragePool(spUUID, self.domainMonitor, self.taskMng)
if not hostID or not scsiKey or not msdUUID or not masterVersion:
hostID, scsiKey, msdUUID, masterVersion = pool.getPoolParams()
res = pool.connect(hostID, scsiKey, msdUUID, masterVersion)
@@ -1103,8 +1110,10 @@
def _disconnectPool(self, pool, hostID, scsiKey, remove):
self.validateNotSPM(pool.spUUID)
- res = pool.disconnect()
- del self.pools[pool.spUUID]
+ with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
+ rm.LockType.exclusive):
+ res = pool.disconnect()
+ del self.pools[pool.spUUID]
return res
@public
@@ -1854,7 +1863,7 @@
try:
pool = self.getPool(spUUID)
except se.StoragePoolUnknown:
- pool = sp.StoragePool(spUUID, self.taskMng)
+ pool = sp.StoragePool(spUUID, self.domainMonitor, self.taskMng)
else:
raise se.StoragePoolConnected(spUUID)
@@ -3482,14 +3491,12 @@
if self.pools[spUUID].hsmMailer:
self.pools[spUUID].hsmMailer.stop()
- # Stop repoStat threads
- for pool in self.pools.values():
- try:
- pool.stopMonitoringDomains()
- except Exception:
- self.log.warning("Failed to stop RepoStats thread",
- exc_info=True)
- continue
+ # Stop repoStat threads
+ try:
+ self.domainMonitor.close()
+ except Exception:
+ self.log.warning("Failed to stop RepoStats thread",
+ exc_info=True)
self.taskMng.prepareForShutdown()
except:
@@ -3662,10 +3669,23 @@
"""
result = {}
- for p in self.pools.values():
- repo_stats = self._getRepoStats(p.domainMonitor)
+ repo_stats = self._getRepoStats(self.domainMonitor)
- for d in repo_stats:
- result[d] = repo_stats[d]['result']
+ for d in repo_stats:
+ result[d] = repo_stats[d]['result']
return result
+
+ @deprecated
+ @public
+ def startMonitoringDomain(self, sdUUID, hostID, options=None):
+ with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
+ rm.LockType.exclusive):
+ self.domainMonitor.startMonitoring(sdUUID, int(hostID))
+
+ @deprecated
+ @public
+ def stopMonitoringDomain(self, sdUUID, options=None):
+ with rmanager.acquireResource(STORAGE, HSM_DOM_MON_LOCK,
+ rm.LockType.exclusive):
+ self.domainMonitor.stopMonitoring(sdUUID)
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index e0559bd..cae84b3 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -51,7 +51,6 @@
import resourceManager as rm
import volume
import mount
-from domainMonitor import DomainMonitor
POOL_MASTER_DOMAIN = 'mastersd'
@@ -112,9 +111,8 @@
storage_repository = config.get('irs', 'repository')
_poolsTmpDir = config.get('irs', 'pools_data_dir')
lvExtendPolicy = config.get('irs', 'vol_extend_policy')
- monitorInterval = config.getint('irs', 'sd_health_check_delay')
- def __init__(self, spUUID, taskManager):
+ def __init__(self, spUUID, domainMonitor, taskManager):
Securable.__init__(self)
self._formatConverter = DefaultFormatConverter()
@@ -131,7 +129,7 @@
self.spmMailer = None
self.masterDomain = None
self.spmRole = SPM_FREE
- self.domainMonitor = DomainMonitor(self.monitorInterval)
+ self.domainMonitor = domainMonitor
self._upgradeCallback = partial(StoragePool._upgradePoolDomain,
proxy(self))
@@ -702,7 +700,8 @@
@unsecured
def stopMonitoringDomains(self):
- self.domainMonitor.close()
+ for sdUUID in self.getDomains():
+ self.domainMonitor.stopMonitoring(sdUUID)
return True
@unsecured
@@ -1542,13 +1541,15 @@
@unsecured
@misc.samplingmethod
def updateMonitoringThreads(self):
- # domain list it's list of sdUUID:status
- # sdUUID1:status1,sdUUID2:status2,...
+ # getDomains() returns a dict of {sdUUID:status}
+ # {sdUUID1: status1, sdUUID2: status2, ...}
self.invalidateMetadata()
- activeDomains = self.getDomains(activeOnly=True)
+ poolDoms = self.getDomains()
+ activeDomains = tuple(sdUUID for sdUUID in poolDoms
+ if poolDoms[sdUUID] == sd.DOM_ACTIVE_STATUS)
monitoredDomains = self.domainMonitor.monitoredDomains
- for sdUUID in monitoredDomains:
+ for sdUUID in poolDoms:
if sdUUID not in activeDomains:
try:
self.domainMonitor.stopMonitoring(sdUUID)
diff --git a/vdsm_api/Bridge.py b/vdsm_api/Bridge.py
index 76fd908..b9fdaf8 100644
--- a/vdsm_api/Bridge.py
+++ b/vdsm_api/Bridge.py
@@ -291,6 +291,8 @@
'Host_getStats': {'ret': 'info'},
'Host_getStorageDomains': {'ret': 'domlist'},
'Host_getStorageRepoStats': {'ret': Host_getStorageRepoStats_Ret},
+ 'Host_startMonitoringDomain': {},
+ 'Host_stopMonitoringDomain': {},
'Host_getVMList': {'call': Host_getVMList_Call, 'ret': Host_getVMList_Ret},
'Image_delete': {'ret': 'uuid'},
'Image_deleteVolumes': {'ret': 'uuid'},
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 898ab5c..e9f23f0 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1716,7 +1716,7 @@
##
# @Host.getStorageRepoStats:
#
-# Get statistics and liveness of currently attached Storage Domains.
+# Get statistics and liveness of currently monitored Storage Domains.
#
# Returns:
# Statistics for all storage domains
@@ -1727,6 +1727,40 @@
'returns': 'StorageDomainVitalsMap'}
##
+# @Host.startMonitoringDomain:
+#
+# Start SD monitoring with hostID
+#
+# @SdUUID: The Storage Domain UUID
+#
+# @HostID: A host ID number in the Storage Domain Lockspace
+#
+# Returns:
+# None
+#
+# Since: 4.12.2
+##
+{'command': {'class': 'Host', 'name': 'startMonitoringDomain'},
+ 'data': {'SdUUID': 'UUID', 'HostID': 'int' }
+ 'returns': ''}
+
+##
+# @Host.stopMonitoringDomain:
+#
+# Stop SD monitoring with hostID
+#
+# @SdUUID: The Storage Domain UUID
+#
+# Returns:
+# None
+#
+# Since: 4.12.2
+##
+{'command': {'class': 'Host', 'name': 'stopMonitoringDomain'},
+ 'data': {'SdUUID': 'UUID' }
+ 'returns': ''}
+
+##
# @VmStatus:
#
# An enumeration of possible virtual machine statuses.
--
To view, visit http://gerrit.ovirt.org/20194
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I983d49b0a42cc06428ec75b7795d23abaa6ab84c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: stats: return domain lockspace status
by Federico Simoncelli
Hello Ayal Baron, Sandro Bonazzola, Sergey Gotliv,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20193
to review the following change.
Change subject: stats: return domain lockspace status
......................................................................
stats: return domain lockspace status
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1019273
Change-Id: I7069781f9945b4e4637b769a22562de30a6d681d
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20099
Reviewed-by: Ayal Baron <abaron(a)redhat.com>
Reviewed-by: Sergey Gotliv <sgotliv(a)redhat.com>
Tested-by: Sandro Bonazzola <sbonazzo(a)redhat.com>
---
M vdsm/sampling.py
M vdsm/storage/hsm.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 15 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/20193/1
diff --git a/vdsm/sampling.py b/vdsm/sampling.py
index dd446c4..0a0ab9c 100644
--- a/vdsm/sampling.py
+++ b/vdsm/sampling.py
@@ -518,11 +518,14 @@
self._imagesStatus._refreshStorageDomains()
now = time.time()
for sd, d in self._imagesStatus.storageDomains.iteritems():
- stats['storageDomains'][sd] = {'code': d['code'],
- 'delay': d['delay'],
- 'lastCheck': d['lastCheck'],
- 'valid': d['valid'],
- 'version': d['version']}
+ stats['storageDomains'][sd] = {
+ 'code': d['code'],
+ 'delay': d['delay'],
+ 'lastCheck': d['lastCheck'],
+ 'valid': d['valid'],
+ 'version': d['version'],
+ 'acquired': d['acquired'],
+ }
stats['elapsedTime'] = int(now - self.startTime)
if len(self._samples) < 2:
return stats
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 01edb44..d73d0f7 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3629,6 +3629,8 @@
'delay': str(domStatus.readDelay),
'valid': (domStatus.error is None),
'version': domStatus.version,
+ # domStatus.hasHostId can also be None
+ 'acquired': domStatus.hasHostId is True,
},
'disktotal': disktotal,
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 60b4bd5..898ab5c 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -1449,12 +1449,16 @@
#
# @version: Indicates the Storage Domain version
#
+# @acquired: Indicates if the lockspace on the Storage Domain has been
+# acquired and therefore if it's possible to run (sanlock)
+# protected VMs
+#
# Since: 4.10.0
# XXX: Add an enum for return codes and their meanings
##
{'type': 'StorageDomainVitals',
'data': {'code': 'int', 'delay': 'float', 'lastCheck': 'float',
- 'valid': 'bool', 'version': 'int'}}
+ 'valid': 'bool', 'version': 'int', 'acquired': 'bool'}}
##
# @PathStats:
--
To view, visit http://gerrit.ovirt.org/20193
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7069781f9945b4e4637b769a22562de30a6d681d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo(a)redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv(a)redhat.com>
10 years, 4 months
Change in vdsm[ovirt-3.3]: Make getRepoStats() a hsm method.
by Federico Simoncelli
Hello Dan Kenigsberg, Eduardo,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20192
to review the following change.
Change subject: Make getRepoStats() a hsm method.
......................................................................
Make getRepoStats() a hsm method.
Making repoStats pool independent.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1019273
Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/14673
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/sp.py
2 files changed, 108 insertions(+), 98 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/20192/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index ace6634..01edb44 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2540,7 +2540,18 @@
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.domainMonitor, doms)
+ for sdUUID in doms.iterkeys():
+ if domInfo[sdUUID]['isoprefix']:
+ poolInfo['isoprefix'] = domInfo[sdUUID]['isoprefix']
+ break
+ else:
+ poolInfo['isoprefix'] = '' # No ISO domain found
+
+ return dict(info=poolInfo, dominfo=domInfo)
@public
def createStorageDomain(self, storageType, sdUUID, domainName,
@@ -3547,6 +3558,97 @@
pool._upgradePool(targetDomVersion)
return {"upgradeStatus": "started"}
+ def _getDomsStats(self, domainMonitor, doms):
+ domInfo = {}
+ repoStats = self._getRepoStats(domainMonitor)
+
+ for sdUUID, sdStatus in doms.iteritems():
+ # 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'])
+
+ isoprefix = repoStats[sdUUID]['isoprefix']
+ domInfo[sdUUID]['isoprefix'] = \
+ isoprefix if isoprefix is not None else ''
+
+ 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):
"""
@@ -3559,7 +3661,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 7dab69d..e0559bd 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
@@ -1434,66 +1433,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)
@@ -1512,50 +1461,9 @@
'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/20192
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0273611a23f29b5c6be0354a4c6b2d6526a9b574
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw(a)redhat.com>
10 years, 4 months