Bug 1368474

Summary: Creation of gluster bricks should also set the proper selinux labels on them
Product: [oVirt] ovirt-engine Reporter: SATHEESARAN <sasundar>
Component: Frontend.WebAdminAssignee: Ramesh N <rnachimu>
Status: CLOSED CURRENTRELEASE QA Contact: SATHEESARAN <sasundar>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.2.7CC: bugs, rnachimu, sabose
Target Milestone: ovirt-4.0.6Flags: sabose: ovirt-4.0.z?
sasundar: planning_ack?
rule-engine: devel_ack+
sasundar: testing_ack+
Target Release: 4.0.6   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 07:26:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Gluster RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description SATHEESARAN 2016-08-19 13:48:13 UTC
Description of problem:
-----------------------
Currently brick creation on RHGS/Gluster node works good and bricks are getting created properly, but the selinux labels are not set on them properly

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
RHV 4.0.2-7

How reproducible:
-----------------
Always

Steps to Reproduce:
-------------------
1. Add a RHGS/Gluster node to the cluster type 'Gluster'
2. Create bricks for that node from UI with the additional disks available

Actual results:
---------------
Bricks are getting created but selinux labels not set on them

Expected results:
-----------------
Bricks should be set with selinux label

Additional info:
----------------
[root@ ~]# ls -lZd /rhgs/brick1
drwxr-xr-x. root root system_u:object_r:unlabeled_t:s0 /rhgs/brick1

Currently the selinux labels are set on the brick manually,
[root@ ~]# semanage fcontext -a -t glusterd_brick_t /rhgs/brick1

[root@ ~]# restorecon -Rv /rhgs/brick1
restorecon reset /rhgs/brick1 context system_u:object_r:unlabeled_t:s0->system_u:object_r:glusterd_brick_t:s0

[root@ ~]# ls -lZd /rhgs/brick1
drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /rhgs/brick1

Comment 1 SATHEESARAN 2016-12-20 11:00:48 UTC
Tested with RHV-4.0.6 ( version 4.0.6.3-0.1.el7ev ) and I am not seeing the bricks with selinux context.

Ramesh, is the fix available with this build ( RHV-4.0.6-8 ) ?

Comment 2 Ramesh N 2016-12-20 11:41:41 UTC
(In reply to SATHEESARAN from comment #1)
> Tested with RHV-4.0.6 ( version 4.0.6.3-0.1.el7ev ) and I am not seeing the
> bricks with selinux context.
> 
> Ramesh, is the fix available with this build ( RHV-4.0.6-8 ) ?

Can you check the vdsm version?. It is fixed in vdsm-4.18.20

Comment 3 SATHEESARAN 2016-12-20 17:34:27 UTC
(In reply to Ramesh N from comment #2)
> (In reply to SATHEESARAN from comment #1)
> > Tested with RHV-4.0.6 ( version 4.0.6.3-0.1.el7ev ) and I am not seeing the
> > bricks with selinux context.
> > 
> > Ramesh, is the fix available with this build ( RHV-4.0.6-8 ) ?
> 
> Can you check the vdsm version?. It is fixed in vdsm-4.18.20

Ramesh,

Thanks for that information, I was testing it with vdsm-4.17.33-1 as available in RHGS 3.2.0

I can check the same with the latest vdsm

Comment 4 SATHEESARAN 2016-12-26 09:59:59 UTC
Tested with vdsm-4.18.21-1.el7.centos.x86_64.

Creation of bricks from UI sets the proper selinux label on the bricks

[root@ ~]# ls -lZd /rhgs/brick1
drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /rhgs/brick1