Bug 1292125 - RHGS-Container:Hook scripts missing from the rhgs-3.1.2 docker image
Summary: RHGS-Container:Hook scripts missing from the rhgs-3.1.2 docker image
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: rhgs-server-container
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: RHGS 3.1.2
Assignee: Mohamed Ashiq
QA Contact: Prasanth
URL:
Whiteboard:
Depends On:
Blocks: 1260783
TreeView+ depends on / blocked
 
Reported: 2015-12-16 14:34 UTC by surabhi
Modified: 2016-07-07 12:55 UTC (History)
9 users (show)

Fixed In Version: rhgs-server-docker-3.1.2-7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-07 12:55:39 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.