Greg Padgett has uploaded a new change for review.
Change subject: WIP storage: Alert for using vdsm.conf nfs_mount_options
......................................................................
WIP storage: Alert for using vdsm.conf nfs_mount_options
This adds a framework and an alert for when nfs_mount_options is used.
The nfs_mount_options setting is deprecated, so if it is set, send an
alert to the engine when it calls getVdsCapabilities. A mechanism to
send the alert was placed here in particular because it the interval in
which the engine calls this API most closely matches the interval in
which the problem can be found and/or corrected.
Note that this was originally for bug 826921, but a new bug will be
created specifically for the alerting code in subsequent patches.
Change-Id: I8520238e0b41eb95d035128681dc3b71a953e644
Bug-Url:
https://bugzilla.redhat.com/826921
Signed-off-by: Greg Padgett <gpadgett(a)redhat.com>
---
M Makefile.am
M vdsm.spec.in
M vdsm/caps.py
M vdsm/storage/Makefile.am
M vdsm/storage/storage_exception.py
M vdsm_api/vdsmapi-schema.json
6 files changed, 42 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/8979/1
diff --git a/Makefile.am b/Makefile.am
index 2850256..3d7cb2c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,7 @@
vdsm/parted_utils.py \
vdsm/rest/BindingREST.py \
vdsm/rest/Controller.py \
+ vdsm/storage/alerts.py \
vdsm/storage/blockVolume.py \
vdsm/storage/devicemapper.py \
vdsm/storage/domainMonitor.py \
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 37f37a3..7e35e4b 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -643,6 +643,7 @@
%{_libexecdir}/%{vdsm_name}/ovirt_functions.sh
%{_libexecdir}/%{vdsm_name}/vdsm-gencerts.sh
%{_datadir}/%{vdsm_name}/storage/__init__.py*
+%{_datadir}/%{vdsm_name}/storage/alerts.py*
%{_datadir}/%{vdsm_name}/storage/blockSD.py*
%{_datadir}/%{vdsm_name}/storage/blockVolume.py*
%{_datadir}/%{vdsm_name}/storage/devicemapper.py*
diff --git a/vdsm/caps.py b/vdsm/caps.py
index cfe4caf..c33e23f 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -40,6 +40,7 @@
import hooks
from vdsm import utils
import storage.hba
+from storage.alerts import getStorageAlerts
# For debian systems we can use python-apt if available
try:
@@ -295,9 +296,16 @@
config.getint('vars', 'extra_mem_reserve'))
caps['guestOverhead'] = config.get('vars',
'guest_ram_overhead')
+ caps['alerts'] = _getAlerts()
+
return caps
+def _getAlerts():
+ # Only storage alerts are currently propagated
+ return getStorageAlerts()
+
+
def _getIfaceByIP(addr, fileName='/proc/net/route'):
remote = struct.unpack('I', socket.inet_aton(addr))[0]
for line in itertools.islice(file(fileName), 1, None):
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index cff09be..96cc368 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -23,6 +23,7 @@
vdsmstoragedir = $(vdsmdir)/storage
dist_vdsmstorage_PYTHON = \
__init__.py \
+ alerts.py \
blockSD.py \
blockVolume.py \
devicemapper.py \
diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py
index 54e64e6..9275ae7 100644
--- a/vdsm/storage/storage_exception.py
+++ b/vdsm/storage/storage_exception.py
@@ -174,6 +174,17 @@
message = "Directory cleanup failure"
+class MiscDeprecatedNFSOptions(StorageException):
+ def __init__(self, options):
+ self.value = "options=%s" % (options,)
+ code = 2009
+ message = "Using deprecated nfs_mount_options parameter from vdsm.conf."\
+ " This parameter will continue to be supported in versions
3.x,"\
+ " but may be removed in a future version of oVirt. Please"\
+ " upgrade domains to V3 or greater and set the parameters from"\
+ " the GUI to ensure compatibility with future versions."
+
+
#################################################
# Volumes Exceptions
#################################################
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 5f0b391..5c7cc92 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -839,6 +839,22 @@
'key': 'SoftwarePackage', 'value':
'SoftwarePackageInfo'}
##
+# @Alert:
+#
+# Alert information for this Host.
+#
+# @code: The alert code
+#
+# @message: A detailed alert string
+#
+# @value: #optional Detailed alert parameters
+#
+# Since: 4.10.1
+##
+{'type': 'Alert',
+ 'data': {'code': 'int', 'message': 'str',
'*value': 'str'}}
+
+##
# @VdsmCapabilities:
#
# Host information and capabilities.
@@ -900,6 +916,8 @@
# @netConfigDirty: Indicates if there are uncommitted changes to the
# network configuration
#
+# @alerts: A list of alerts for the host
+#
# Since: 4.10.0
#
# Notes: Since ovirt-engine cannot parse software versions in 'x.y.z' format,
@@ -919,7 +937,8 @@
'emulatedMachines': ['str'], 'ISCSIInitiatorName':
'str',
'HBAInventory': 'HbaInventory', 'vmTypes':
['VmType'],
'memSize': 'uint', 'reservedMem': 'uint',
- 'guestOverhead': 'uint', 'netConfigDirty':
'bool'}}
+ 'guestOverhead': 'uint', 'netConfigDirty':
'bool',
+ 'alerts': ['Alert']}}
##
# @Host.getCapabilities:
--
To view, visit
http://gerrit.ovirt.org/8979
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8520238e0b41eb95d035128681dc3b71a953e644
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadgett(a)redhat.com>