From 4928a83cc93010c55f167c5a94790e6e0b078842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Enrique=20Guti=C3=A9rrez=20Maz=C3=B3n?= Date: Wed, 14 Feb 2024 13:35:42 +0100 Subject: [PATCH] vdsm: get gluster volume info from any gluster peer The function _get_gluster_volinfo query the glusterfs volume info the the storage server, this is translated to the gluster client adding the parameter --remote-host which limits the query to one server, so we are converting the storage server as a single point of failure, if it is not available, it can led to cluster outtage. The proposed changed let the cluster cli to use any available gluster peer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Enrique Gutiérrez Mazón --- lib/vdsm/storage/storageServer.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/vdsm/storage/storageServer.py b/lib/vdsm/storage/storageServer.py index 3585ba8bef..6b78e6cab2 100644 --- a/lib/vdsm/storage/storageServer.py +++ b/lib/vdsm/storage/storageServer.py @@ -382,14 +382,23 @@ def _get_backup_servers_option(self): return "backup-volfile-servers=" + ":".join(servers) def _get_gluster_volinfo(self): + superVdsmProxy = supervdsm.getProxy() try: - superVdsmProxy = supervdsm.getProxy() volinfo = superVdsmProxy.glusterVolumeInfo(self._volname, self._volfileserver) return volinfo[self._volname] - except ge.GlusterCmdExecFailedException as e: + except ge.GlusterException as e: log.warning("Failed to get volume info: %s", e) - return {} + try: + if "backup-volfile-servers" in self._options: + log.warning( + "Trying to get volume info through backup servers: %s", self._options) + volinfo = superVdsmProxy.glusterVolumeInfo(self._volname) + return volinfo[self._volname] + except ge.GlusterException as e2: + log.warning( + "Failed to get volume info from backup servers: %s", e2) + return {} class NFSConnection(Connection):