Bug 1724035 - Move the preflight check in to ansible pre-task for automated CLI deployment
Summary: Move the preflight check in to ansible pre-task for automated CLI deployment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: cockpit-ovirt
Classification: oVirt
Component: gluster-ansible
Version: 0.13.2
Hardware: x86_64
OS: Linux
urgent
medium
Target Milestone: ovirt-4.3.6
: 0.13.6
Assignee: Gobinda Das
QA Contact: bipin
URL:
Whiteboard:
Depends On:
Blocks: 1686357
TreeView+ depends on / blocked
 
Reported: 2019-06-26 06:09 UTC by SATHEESARAN
Modified: 2019-09-26 19:42 UTC (History)
7 users (show)

Fixed In Version: cockpit-ovirt-0.13.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1686357
Environment:
Last Closed: 2019-09-26 19:42:45 UTC
oVirt Team: Gluster
Embargoed:
sasundar: ovirt-4.3?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 101909 0 master MERGED Moved the preflight check in to ansible pre-task 2019-08-09 06:56:20 UTC
oVirt gerrit 102547 0 ovirt-4.3 MERGED Moved the preflight check in to ansible pre-task 2019-08-12 06:40:00 UTC

Description SATHEESARAN 2019-06-26 06:09:44 UTC
Description of problem:
-----------------------
Move preflight test in to ansible pre-task

Version-Release number of selected component (if applicable):
--------------------------------------------------------------
cockpit-ovirt-dashboard-0.12.4

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

Steps to Reproduce:
-------------------
1. Run RHHI-V deployment

Actual results:
---------------
Preflight tests are done during the deployment

Expected results:
-----------------
Preflight tests should be done well before deployment and proceed to actual deployment only when the actual preflight tests passes

--- Additional comment from Sachidananda Urs on 2019-05-15 03:59:51 UTC ---

https://github.com/gluster/gluster-ansible/pull/70
https://github.com/gluster/gluster-ansible-features/pull/27

Comment 1 SATHEESARAN 2019-06-26 06:12:14 UTC
Current Content of hc_wizard.yml

<snip>
[root@rhsqa-grafton11-nic2 ~]# cat /usr/share/cockpit/ovirt-dashboard/ansible/hc_wizard.yml 
---

# Gluster deployment start here
- name: Setup backend
  hosts: hc_nodes
  remote_user: root
  gather_facts: yes
  any_errors_fatal: true
  max_fail_percentage: 0

  roles:
     - gluster.infra
     - gluster.features
</snip>

Expected hc_wizard.yml
<snip>
[root@rhsqa-grafton10-nic2 ~]# cat /usr/share/cockpit/ovirt-dashboard/ansible/hc_wizard.yml 
---

# Gluster deployment start here
- name: Setup backend
  hosts: hc_nodes
  remote_user: root
  gather_facts: yes
  any_errors_fatal: true
  max_fail_percentage: 0
# Gluster deployment start here
- name: Setup backend and deploy HCI
  hosts: hc_nodes
  remote_user: root
  gather_facts: no
  any_errors_fatal: true

  # We are moving some of the prerequisite checks from gluster.features role so
  # that we fail early even before backend setup

  pre_tasks:
    # Check if the hosts have valid hostnames
    - name: Check if valid hostnames are provided
      command:
      args:
        argv:
          - getent
          - ahosts
          - "{{ item }}"
      register: result
      with_items: "{{ groups['all'] }}"
      when: gluster_features_fqdn_check | default(true)
      delegate_to: localhost
      run_once: true

    - name: Check if provided hostnames are valid
      assert:
        that:
          - "result.results[0]['rc'] == 0"
          - "result.results[0]['stdout_lines'] > 0"
        fail_msg: "The given hostname is not valid FQDN"
      when: gluster_features_fqdn_check | default(true)

    # Check if /var has enough disk. We check for 15G minimum.
    - name: Check if /var/log has enough disk space
      shell: df -m /var/log | awk '/[0-9]%/ {print $4}'
      register: disk_size
      when: gluster_features_force_varlogsizecheck | default(true)

    - name: "Check if the /var is greater than 15G"
      assert:
        that:
          - "disk_size.stdout|int > gluster_features_min_disk|default(15000)"
        fail_msg: "The size of /var should be greater than or equal to 15G"
      when: gluster_features_force_varlogsizecheck | default(true)

    # logical block size of 512 bytes. To disable the check set
    # gluster_features_512B_check to false. DELETE the below task once
    # OVirt limitation is fixed
    - name: Check if disks have logical block size of 512B
      command: blockdev --getss {{ item.pvname }}
      register: logical_blk_size
      when: gluster_infra_volume_groups is defined and
            item.pvname is not search("/dev/mapper") and
            gluster_features_512B_check|default(true)
      with_items: "{{ gluster_infra_volume_groups }}"

    - name: Check if logical block size is 152 bytes
      assert:
        that:
          - "item.stdout|int == 512"
        fail_msg: "The logical block size of disk is not 512 bytes"
      when: gluster_infra_volume_groups is defined and
            gluster_features_512B_check|default(true)
      loop: "{{ logical_blk_size.results }}"
      loop_control:
        label: "Logical Block Size"

    - name: Check logical block size of VDO devices
      command: blockdev --getss {{ item.device }}
      register: logical_blk_size
      when: gluster_infra_vdo is defined and
            gluster_features_512B_check|default(true)
      with_items: "{{ gluster_infra_vdo }}"

    - name: Check if logical block size is 512 bytes
      assert:
        that:
          - "item.stdout|int == 512"
        fail_msg: "The logical block size of disk is not 512 bytes"
      when: gluster_infra_vdo is defined and
            gluster_features_512B_check|default(true)
      loop: "{{ logical_blk_size.results }}"
      loop_control:
        label: "Logical Block Size"

  roles:
     - gluster.infra
     - gluster.features

</snip>

Comment 2 Sahina Bose 2019-07-19 06:34:35 UTC
Has this been addressed?

Comment 3 Gobinda Das 2019-07-19 07:33:32 UTC
Sahina,
 Yes, patch posted.

Comment 4 bipin 2019-08-27 07:43:38 UTC
Tested the bug with cockpit-ovirt-dashboard-0.13.6-1.el7ev.noarch.
The preflight check has been moved to ansible pre task, so moving the bug as verified.

Comment 5 Sandro Bonazzola 2019-09-26 19:42:45 UTC
This bugzilla is included in oVirt 4.3.6 release, published on September 26th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.6 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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