Change in vdsm[master]: stats: return domain lockspace status

fsimonce at redhat.com fsimonce at redhat.com
Thu Oct 10 15:43:11 UTC 2013


Federico Simoncelli has uploaded a new change for review.

Change subject: stats: return domain lockspace status
......................................................................

stats: return domain lockspace status

Change-Id: I7069781f9945b4e4637b769a22562de30a6d681d
Signed-off-by: Federico Simoncelli <fsimonce at 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/99/20099/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 5f14468..5783728 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3643,6 +3643,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 be53ada..ab5c464 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/20099
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7069781f9945b4e4637b769a22562de30a6d681d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>


More information about the vdsm-patches mailing list