Bug 1292125

Summary: RHGS-Container:Hook scripts missing from the rhgs-3.1.2 docker image
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: surabhi <sbhaloth>
Component: rhgs-server-containerAssignee: Mohamed Ashiq <mliyazud>
Status: CLOSED CURRENTRELEASE QA Contact: Prasanth <pprakash>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: hchiramm, mliyazud, nlevinki, pprakash, rcyriac, sankarshan, ssampat, surs, vbellur
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhgs-server-docker-3.1.2-7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-07 12:55:39 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1260783    

Description surabhi 2015-12-16 14:34:13 UTC
Description of problem:
**************************************
On the docker image for RHGS3.1.2 , the hook scripts that comes from glusterfs-server package is missing.


Version-Release number of selected component (if applicable):
docker-registry.usersys.redhat.com/gluster/rhgs-3.1.2-1

How reproducible:
Always

Steps to Reproduce:
1.Take rhgs-3.1.2 docker image from registry mentioned above, create a container from the given image. 
2.
3.

Actual results:
The hook scripts are missing.

Expected results:
The hook script that comes from glusterfs-server should be present in docker image as it is required for multiple operations.

Additional info:

Comment 3 Humble Chirammal 2016-01-19 07:30:42 UTC
Here is the deal. We are thinking about 2 solutions. 

1) Document the steps to get  hook scripts inside the Atomic host from outside of atomic host.

2) We can create a 'backup' directory inside the container image and store the contents of '/var/lib/glusterd' and '/etc/glusterfs/' directories inside 'backup' directory. So that, at first spawn of the container, the user can copy the hook scripts from container 'backup' directory to bind mounted /var/lib/glusterd which makes the hook scripts available in the atomic host. This is one time process and the new containers have it in the atomic host for future use.  

@Ashiq, can you please go ahead with both solutions ?

Comment 4 Mohamed Ashiq 2016-01-27 12:32:16 UTC
(In reply to Humble Chirammal from comment #3)
> Here is the deal. We are thinking about 2 solutions. 
> 
> 1) Document the steps to get  hook scripts inside the Atomic host from
> outside of atomic host.
> 
> 2) We can create a 'backup' directory inside the container image and store
> the contents of '/var/lib/glusterd' and '/etc/glusterfs/' directories inside
> 'backup' directory. So that, at first spawn of the container, the user can
> copy the hook scripts from container 'backup' directory to bind mounted
> /var/lib/glusterd which makes the hook scripts available in the atomic host.
> This is one time process and the new containers have it in the atomic host
> for future use.  


We will be having the backup directories(copy) of /etc/glusterfs/ , /var/lib/glusterd, and /var/log/glusterfs in /etc/glusterfs_bck , /var/lib/glusterd_bck, and /var/log/glusterfs_bck respectively in next build. On the first spawn of a container bind mount would have overshadowed these directories by which we lose the hook scripts and glusterd.vol, which are essential for the gluster operations, so now the user can do 
# mv /etc/glusterfs_bck /etc/glusterfs
# mv /var/lib/glusterd_bck /var/lib/glusterd
# mv /var/log/glusterfs_bck /var/log/glusterfs
getting inside the container. This will keep all the scripts and the files right place without much overhead.

> 
> @Ashiq, can you please go ahead with both solutions ?

Comment 8 Mohamed Ashiq 2016-02-11 09:15:42 UTC
Backup of /etc/glusterfs, /var/lib/glusterd and /var/log/glusterfs is made in the container. When bind mount is happened these directories are over shadowed, so for the very first time starting a container on atomic host run this command after getting inside the container.

# sh /setup.sh

This setup script will move the backup to the required place and removes the backup.

Then restart glusterd
# systemctl restart glusterd

Comment 13 Prasanth 2016-02-17 13:06:13 UTC
Verified as fixed in rhgs-server-docker-3.1.2-7. Followed the steps mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1300637#c2 and could see that the hooks scripts are now made available inside the RHGS container.