Bug 1329903

Summary: bricks doesn't have selinux label, even when selinux is enabled in the conf file
Product: Red Hat Gluster Storage Reporter: SATHEESARAN <sasundar>
Component: gdeployAssignee: Nandaja Varma <nvarma>
Status: CLOSED ERRATA QA Contact: Bhaskarakiran <byarlaga>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: asrivast, mzywusko, nvarma, rcyriac, rhinduja, smohan, surs
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gdeploy-2.0-8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-23 05:30:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1258386, 1311817    

Description SATHEESARAN 2016-04-24 15:57:08 UTC
Description of problem:
-----------------------
Used the gdeploy conf file which had selinux section set to yes, but bricks are not labeled appropriately

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
gdeploy-2.0-6

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

Steps to Reproduce:
-------------------
1. Create a section selinux set to 'yes'
2. add lv section such a way bricks are mounted

Actual results:
---------------
selinux labels not available on the bricks

Expected results:
-----------------
selinux labels should be available on the bricks

Additional info:
----------------
1. Conf file used :
[root@ ~]# cat test.conf 
[hosts]
host1.example.com

[selinux]
yes

[disktype]
raid6

[diskcount]
4

[stripesize]
256

[pv]
action=create
devices=vdb

[vg]
action=create
vgname=RHS_vg1
pvname=vdb

[lv1]
action=create
lvname=engine_lv
lvtype=thick
size=10GB
mount=/rhs/brick1

[lv2]
action=create
vgname=RHS_vg1
poolname=lvthinpool
lvtype=thinpool
poolmetadatasize=10MB
chunksize=1024k
size=30GB

[lv3]
action=create
lvname=lv_vmaddldisks
poolname=lvthinpool
vgname=RHS_vg1
lvtype=thinlv
mount=/rhs/brick2
virtualsize=9GB

[lv4]
action=create
lvname=lv_vmrootdisks
poolname=lvthinpool
vgname=RHS_vg1
size=19GB
lvtype=thinlv
mount=/rhs/brick3
virtualsize=19GB


2. Selinux labels after brick creation looks like below :
[root@d ~]# ls -lZd /rhs/brick*
drwxr-xr-x. root root system_u:object_r:unlabeled_t:s0 /rhs/brick1
drwxr-xr-x. root root system_u:object_r:unlabeled_t:s0 /rhs/brick2
drwxr-xr-x. root root system_u:object_r:unlabeled_t:s0 /rhs/brick3

Comment 2 Bhaskarakiran 2016-05-03 06:11:01 UTC
With 2.0-8, labels are set. Marking as fixed.

[root@rhsqa1 ~]# ls -ldZ /rhgs/vmstore/
drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /rhgs/vmstore/
[root@rhsqa1 ~]# ls -ldZ /rhgs/data/
drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /rhgs/data/
[root@rhsqa1 ~]# ls -ldZ /rhgs/engine/
drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /rhgs/engine/

Comment 4 errata-xmlrpc 2016-06-23 05:30:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2016:1250