Bug 1636427 - Order of brick placement on the host is not preserved as defined in the playbook
Summary: Order of brick placement on the host is not preserved as defined in the playbook
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: rhhi
Version: rhhiv-1.5
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: RHHI-V 1.5
Assignee: Sahina Bose
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On: 1636425
Blocks: 1520836
TreeView+ depends on / blocked
 
Reported: 2018-10-05 11:10 UTC by SATHEESARAN
Modified: 2019-05-20 04:54 UTC (History)
5 users (show)

Fixed In Version: gluster-ansible-roles-1.0.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1636425
Environment:
Last Closed: 2019-05-20 04:54:53 UTC
Embargoed:


Attachments (Terms of Use)

Description SATHEESARAN 2018-10-05 11:10:06 UTC
Description of problem:
-----------------------
Order of brick placement on the hosts is not preserved as defined in the playbook

Version-Release number of selected component (if applicable):
--------------------------------------------------------------
gluster-ansible-role-1.0

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

Steps to Reproduce:
--------------------
1. Create a playbook to create volume with bricks on listed host

Actual results:
---------------
Bricks are created with the host names sorted

Expected results:
-----------------
Bricks should be created in the same order as defined the playbook

Comment 1 Sachidananda Urs 2018-10-05 14:31:32 UTC
sas, with my setup it works as expected:

Volume Name: data
Type: Replicate
Volume ID: fd48f9e2-617c-463e-b68e-298c2704da18
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x (2 + 1) = 3
Transport-type: tcp
Bricks:
Brick1: 10.70.43.26:/gluster_bricks/data/data
Brick2: 10.70.43.169:/gluster_bricks/data/data
Brick3: 10.70.43.104:/gluster_bricks/data/data (arbiter)
Options Reconfigured:
performance.strict-o-direct: on
transport.address-family: inet
performance.readdir-ahead: on
nfs.disable: on

=======================================

Would like to try on your setup, if this has anything to do with FQDNs. It shouldn't, we can try anyway.

Comment 2 Sachidananda Urs 2018-10-05 14:33:14 UTC
This is my conf file:

hc-nodes:
  hosts:
    # Host1 - Provide the FQDN/IP of backend network
    10.70.43.169:
      # Set up GlusterFS hyperconverged interface
      gluster_features_hci_cluster: "{{ groups['hc-nodes'] }}"
      gluster_features_hci_volumes:
         - { volname: 'engine', brick: '/gluster_bricks/engine/engine', arbiter: 1 }
         - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1 }
         - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore', arbiter: 1 }

    #Host2
    10.70.43.26:

      gluster_features_hci_cluster: "{{ groups['hc-nodes'] }}"
      gluster_features_hci_volumes:
         - { volname: 'engine', brick: '/gluster_bricks/engine/engine', arbiter: 1 }
         - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1 }
         - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore', arbiter: 1 }

    #Host3
    10.70.43.104:
      # Set up GlusterFS hyperconverged interface
      gluster_features_hci_cluster: "{{ groups['hc-nodes'] }}"
      gluster_features_hci_volumes:
         - { volname: 'engine', brick: '/gluster_bricks/engine/engine', arbiter: 1 }
         - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1 }
         - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore', arbiter: 1 }



=============

And my CLI:

ansible-playbook -i gluster_inventory.yml hc_deployment.yml --tags hcivolcreate

Comment 3 Sachidananda Urs 2018-10-05 15:11:53 UTC
sas, more update on this: This is due to a bug in Ansible.

https://github.com/ansible/ansible/issues/34861

Culprit is this line:

>       gluster_features_hci_cluster: "{{ groups['hc-nodes'] }}"

The groups here is not keeping the ordering right, it sorts in descending order. Solution till Ansible fixes the issue is to define the cluster as a list and use that variable.

Once you test this out, can we close this bug and open another to update the playbooks/ to include this in the playbooks we provide as reference.

Since this is more of a playbook and inventory file bug than a bug in role.

For example:

===========================
hc-nodes:
  vars:
    cluster_nodes:
       - host1
       - host2
       - host3
  hosts:
    #Host3
    10.70.43.191:
      # Set up GlusterFS hyperconverged interface
      gluster_features_hci_cluster: "{{ cluster_nodes }}"
      gluster_features_hci_volumes:
         - { volname: 'engine', brick: '/gluster_bricks/engine/engine', arbiter: 1 }
         - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1 }
         - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore', arbiter: 1 }

    # Host1 - Provide the FQDN/IP of backend network
    10.70.43.169:
      # Set up GlusterFS hyperconverged interface
      gluster_features_hci_cluster: "{{ cluster_nodes }}"
      gluster_features_hci_volumes:
         - { volname: 'engine', brick: '/gluster_bricks/engine/engine', arbiter: 1 }
         - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1 }
         - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore', arbiter: 1 }

    #Host2
    10.70.43.26:

      gluster_features_hci_cluster: "{{ cluster_nodes }}"
      gluster_features_hci_volumes:
         - { volname: 'engine', brick: '/gluster_bricks/engine/engine', arbiter: 1 }
         - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1 }
         - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore', arbiter: 1 }

Comment 4 Sachidananda Urs 2018-10-08 01:40:53 UTC
@sas this enhancement to playbook[1] by Gobinda should fix this ordering issue and the readability of the playbook as well.


[1] https://github.com/gluster/gluster-ansible/commit/77dd66e

Comment 5 SATHEESARAN 2018-10-12 11:56:18 UTC
(In reply to Sachidananda Urs from comment #3)
> sas, more update on this: This is due to a bug in Ansible.
> 
> https://github.com/ansible/ansible/issues/34861
> 
> Culprit is this line:
> 
> >       gluster_features_hci_cluster: "{{ groups['hc-nodes'] }}"
> 
> The groups here is not keeping the ordering right, it sorts in descending
> order. Solution till Ansible fixes the issue is to define the cluster as a
> list and use that variable.
> 
> Once you test this out, can we close this bug and open another to update the
> playbooks/ to include this in the playbooks we provide as reference.
> 
> Since this is more of a playbook and inventory file bug than a bug in role.
> 
> For example:
> 
> ===========================
> hc-nodes:
>   vars:
>     cluster_nodes:
>        - host1
>        - host2
>        - host3
>   hosts:
>     #Host3
>     10.70.43.191:
>       # Set up GlusterFS hyperconverged interface
>       gluster_features_hci_cluster: "{{ cluster_nodes }}"
>       gluster_features_hci_volumes:
>          - { volname: 'engine', brick: '/gluster_bricks/engine/engine',
> arbiter: 1 }
>          - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1
> }
>          - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore',
> arbiter: 1 }
> 
>     # Host1 - Provide the FQDN/IP of backend network
>     10.70.43.169:
>       # Set up GlusterFS hyperconverged interface
>       gluster_features_hci_cluster: "{{ cluster_nodes }}"
>       gluster_features_hci_volumes:
>          - { volname: 'engine', brick: '/gluster_bricks/engine/engine',
> arbiter: 1 }
>          - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1
> }
>          - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore',
> arbiter: 1 }
> 
>     #Host2
>     10.70.43.26:
> 
>       gluster_features_hci_cluster: "{{ cluster_nodes }}"
>       gluster_features_hci_volumes:
>          - { volname: 'engine', brick: '/gluster_bricks/engine/engine',
> arbiter: 1 }
>          - { volname: 'data', brick: '/gluster_bricks/data/data', arbiter: 1
> }
>          - { volname: 'vmstore', brick: '/gluster_bricks/vmstore/vmstore',
> arbiter: 1 }

Thanks for the information , that helps

Comment 9 SATHEESARAN 2018-10-12 13:49:30 UTC
The patch is already merged upstream, moving the bug to MODIFIED

Comment 10 SATHEESARAN 2018-10-17 01:41:15 UTC
The dependent gluster-ansible bug is already ON_QA, moving this bug too to that state.

Comment 11 SATHEESARAN 2018-10-17 01:41:29 UTC
Tested with ovirt-ansible-roles-1.0.3

The volumes are created on the hosts as per the playbook definitions


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