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
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.
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
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 }
@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
(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
The patch is already merged upstream, moving the bug to MODIFIED
The dependent gluster-ansible bug is already ON_QA, moving this bug too to that state.
Tested with ovirt-ansible-roles-1.0.3 The volumes are created on the hosts as per the playbook definitions