Skip to content

Brick creation

Sachidananda Urs edited this page Jun 26, 2018 · 1 revision

GlusterFS bricks can be created using gluster-ansible using the role gluster.infra. Backend disks can be of types RAID6, RAID10, or JBOD. If no disktype is specified JBOD is assumed as default. For a detailed list of variables and documentation refer GlusterFS Infra role and more examples can be found here

An example playbook to create a brick

---
- name: Setting up backend
  remote_user: root
  hosts: hosts
  gather_facts: false

  vars:
    gluster_infra_vg_name: gluster_backend_vg
    gluster_infra_pvs: /dev/vdb
    gluster_infra_lv_thinpoolname: gluster_thinpool
    gluster_infra_lv_logicalvols:
       - { lvname: gluster_thinlv, lvsize: 500G }
    gluster_infra_mount_devices:
       - { path: /mnt/thinv,   lv: gluster_thinlv }

  roles:
      - gluster.infra

Additionally, bricks can be configured with VDO using the gluster.infra role. gluster_infra_vdo variable has to be set with name and device to use. For example:

---
- name: Setting up backend with VDO
  remote_user: root
  hosts: vdos
  gather_facts: false

  vars:
     # Create a vdo
     gluster_infra_vdo:
        - { name: 'foo', device: '/dev/vdb' }
        - { name: 'bar', device: '/dev/vdc' }

     gluster_infra_disktype: RAID10

     # RAID6 and RAID10 diskcount
     gluster_infra_diskcount: 10
     gluster_infra_stripe_unit_size: 128

     # The vitualsize option while creating thinpool
     gluster_infra_lv_logicalvols:
        - { lvname: 'thin_lv1', lvsize: '500G' }
        - { lvname: 'thin_lv2', lvsize: '500G' }

     # Mount the devices
     gluster_infra_mount_devices:
        - { path: '/mnt/thinv1',   lv: 'thin_lv1' }
        - { path: '/mnt/thinv2',   lv: 'thin_lv2' }

  roles:
    - gluster.infra