Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: setup: add Gluster Support
......................................................................

packaging: setup: add Gluster Support

Add Gluster Support to Hosted Engine.
See feature page:
http://www.ovirt.org/Features/Self_Hosted_Engine_Gluster_Support
for documentation.

Change-Id: I87f37cda3c9f957b548f7634ba143cf3f8a59ebe
Bug-Url: https://bugzilla.redhat.com/1173669
Signed-off-by: Sandro Bonazzola <[email protected]>
---
M src/ovirt_hosted_engine_setup/constants.py
M src/plugins/ovirt-hosted-engine-setup/storage/nfs.py
M src/plugins/ovirt-hosted-engine-setup/storage/storage.py
3 files changed, 71 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/64/36264/1

diff --git a/src/ovirt_hosted_engine_setup/constants.py 
b/src/ovirt_hosted_engine_setup/constants.py
index 39dd203..0c453af 100644
--- a/src/ovirt_hosted_engine_setup/constants.py
+++ b/src/ovirt_hosted_engine_setup/constants.py
@@ -65,6 +65,7 @@
 @util.codegen
 class FileSystemTypes(object):
     NFS = 'nfs'
+    GLUSTERFS = 'glusterfs'
 
 
 @util.export
diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/nfs.py 
b/src/plugins/ovirt-hosted-engine-setup/storage/nfs.py
index 3e03b05..2af6f4a 100644
--- a/src/plugins/ovirt-hosted-engine-setup/storage/nfs.py
+++ b/src/plugins/ovirt-hosted-engine-setup/storage/nfs.py
@@ -19,7 +19,7 @@
 
 
 """
-Local storage domain plugin.
+NFS / GlusterFS storage plugin.
 """
 
 import os
@@ -61,6 +61,8 @@
         elif domain_type == ohostedcons.DomainTypes.NFS4:
             fstype = ohostedcons.FileSystemTypes.NFS
             opts.append('vers=4')
+        elif domain_type == ohostedcons.DomainTypes.GLUSTERFS:
+            fstype = ohostedcons.FileSystemTypes.GLUSTERFS
 
         if fstype == ohostedcons.FileSystemTypes.NFS:
             opts.append('retry=1')
@@ -148,6 +150,28 @@
             )
 
     def _validateDomain(self, connection, domain_type, check_space):
+        if self.environment[
+            ohostedcons.StorageEnv.DOMAIN_TYPE
+        ] == ohostedcons.DomainTypes.GLUSTERFS:
+            # FIXME: mount.glusterfs exit with code 0 also on failure
+            # without any stderr content.
+            # https://bugzilla.redhat.com/show_bug.cgi?id=1128165
+            # https://bugzilla.redhat.com/show_bug.cgi?id=1173513
+            # https://bugzilla.redhat.com/show_bug.cgi?id=1173515
+            # FIXME: mount.glusterfs fails
+            # with
+            # I [options.c:1163:xlator_option_init_double]
+            # 0-fuse: option attribute-timeout convertion failed value 1.0
+            # E [xlator.c:425:xlator_init] 0-fuse: Initialization of volume
+            # 'fuse' failed, review your volfile again
+            # https://bugzilla.redhat.com/show_bug.cgi?id=1175641
+            self.logger.warning(
+                _(
+                    'Due to several bugs in mount.glusterfs the validation '
+                    'of GlusterFS share cannot be reliable: skipping'
+                )
+            )
+            return
         path = tempfile.mkdtemp()
         try:
             self._mount(path, connection, domain_type)
@@ -187,11 +211,9 @@
         before=(
             ohostedcons.Stages.CONFIG_STORAGE_LATE,
         ),
-        condition=(
-            lambda self: self.environment[
-                ohostedcons.StorageEnv.DOMAIN_TYPE
-            ] in (
-                # ohostedcons.DomainTypes.GLUSTERFS,
+        condition=lambda self: (
+            self.environment[ohostedcons.StorageEnv.DOMAIN_TYPE] in (
+                ohostedcons.DomainTypes.GLUSTERFS,
                 ohostedcons.DomainTypes.NFS3,
                 ohostedcons.DomainTypes.NFS4,
             )
@@ -278,16 +300,14 @@
         before=(
             ohostedcons.Stages.DIALOG_TITLES_E_STORAGE,
         ),
-        condition=(
-            lambda self: (
-                not self.environment[
-                    ohostedcons.CoreEnv.IS_ADDITIONAL_HOST
-                ] and
-                self.environment[ohostedcons.StorageEnv.DOMAIN_TYPE] in (
-                    # ohostedcons.DomainTypes.GLUSTERFS,
-                    ohostedcons.DomainTypes.NFS3,
-                    ohostedcons.DomainTypes.NFS4,
-                )
+        condition=lambda self: (
+            not self.environment[
+                ohostedcons.CoreEnv.IS_ADDITIONAL_HOST
+            ] and
+            self.environment[ohostedcons.StorageEnv.DOMAIN_TYPE] in (
+                ohostedcons.DomainTypes.GLUSTERFS,
+                ohostedcons.DomainTypes.NFS3,
+                ohostedcons.DomainTypes.NFS4,
             )
         ),
     )
diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py 
b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
index a083e0a..342b2ed 100644
--- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
+++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
@@ -425,18 +425,21 @@
             ohostedcons.VDSMConstants.NFS_DOMAIN,
             ohostedcons.VDSMConstants.GLUSTERFS_DOMAIN,
         ):
-            conList = [
-                {
-                    'connection': self.environment[
-                        ohostedcons.StorageEnv.STORAGE_DOMAIN_CONNECTION
-                    ],
-                    'user': 'kvm',
-                    'id': self.environment[
-                        ohostedcons.StorageEnv.CONNECTION_UUID
-                    ],
-                    'protocol_version': self.protocol_version,
-                }
-            ]
+            conDict = {
+                'connection': self.environment[
+                    ohostedcons.StorageEnv.STORAGE_DOMAIN_CONNECTION
+                ],
+                'user': 'kvm',
+                'id': self.environment[
+                    ohostedcons.StorageEnv.CONNECTION_UUID
+                ],
+            }
+            if self.storageType == ohostedcons.VDSMConstants.NFS_DOMAIN:
+                conDict['protocol_version'] = self.protocol_version
+            if self.storageType == ohostedcons.VDSMConstants.GLUSTERFS_DOMAIN:
+                conDict['tpgt'] = '1'
+                conDict['vfs_type'] = 'glusterfs'
+            conList = [conDict]
         elif self.storageType in (
             ohostedcons.VDSMConstants.ISCSI_DOMAIN,
         ):
@@ -533,6 +536,24 @@
         masterDom = sdUUID
         domList = sdUUID  # str: domain,domain,...
         mVer = 1
+        self.logger.debug((
+            'createStoragePool(args=['
+            'poolType={poolType},'
+            'spUUID={spUUID},'
+            'poolName={poolName},'
+            'masterDom={masterDom},'
+            'domList={domList},'
+            'mVer={mVer}'
+            '])'
+        ).format(
+            poolType=poolType,
+            spUUID=spUUID,
+            poolName=poolName,
+            masterDom=masterDom,
+            domList=domList,
+            mVer=mVer,
+        ))
+
         status, message = self.serv.createStoragePool(args=[
             poolType,
             spUUID,
@@ -845,8 +866,7 @@
                 prompt=True,
                 caseSensitive=True,
                 validValues=(
-                    # Enable when glusterfs issues are solved:
-                    # ohostedcons.DomainTypes.GLUSTERFS,
+                    ohostedcons.DomainTypes.GLUSTERFS,
                     ohostedcons.DomainTypes.ISCSI,
                     ohostedcons.DomainTypes.NFS3,
                     ohostedcons.DomainTypes.NFS4,


-- 
To view, visit http://gerrit.ovirt.org/36264
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87f37cda3c9f957b548f7634ba143cf3f8a59ebe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to