Bug 1811989 - [vdo] VDO systemd unit file shouldn't be edited for modifying VDO max_discard_size
Summary: [vdo] VDO systemd unit file shouldn't be edited for modifying VDO max_discard...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: gluster-ansible
Version: rhgs-3.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: RHGS 3.5.z Batch Update 2
Assignee: Gobinda Das
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On:
Blocks: 1811988
TreeView+ depends on / blocked
 
Reported: 2020-03-10 10:43 UTC by SATHEESARAN
Modified: 2020-06-16 05:57 UTC (History)
6 users (show)

Fixed In Version: gluster-ansible-infra-1.0.4-7.el8rhgs
Doc Type: No Doc Update
Doc Text:
Clone Of: 1811988
Environment:
rhhiv, rhel8
Last Closed: 2020-06-16 05:57:29 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github gluster gluster-ansible-infra pull 83 0 None closed Removed max_discard_sectors from VDO 2020-07-09 11:12:17 UTC
Github gluster gluster-ansible-infra pull 86 0 None closed Added maxDiscardSize in vdo volume 2020-07-09 11:12:16 UTC
Red Hat Product Errata RHEA-2020:2575 0 None None None 2020-06-16 05:57:52 UTC
oVirt gerrit 107579 0 None MERGED Added maxDiscardSize to 4096 in vdo volue 2020-07-09 11:12:16 UTC
oVirt gerrit 107802 0 None MERGED Added default maxDiscardSize to 16M in vdo volume 2020-07-09 11:12:16 UTC

Description SATHEESARAN 2020-03-10 10:43:54 UTC
Description of problem:
-----------------------
RHHI-V uses VDO for dedupe & compression functionality. On top of VDO, thin LVs are created. In this combination, we found a problem (BZ 1600156), where discards weren't passed down, because of vdo_discard_sector(size) is smaller than thinpool's. To avoid that RHHI deployment at cockpit made custom changes to VDO systemd unit file to have the following:
---
ExecStartPre=/bin/sh -c "echo 4096 > /sys/kvdo/max_discard_sectors"
---
in /usr/lib/systemd/system/vdo.service.

But as per VDO instructions, with kernel > 4.6 (i.e) RHEL 8 kernel && from VDO 6.2, VDO exposes the option 'maxDiscardSize' per VDO volume.

RHHI-V 1.8 will be using RHEL 8.2 hosts, with RHV 4.4, with VDO 6.2.z.
This change needs to be updated in cockpit-wizard and that's the reason for existence of this bug

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
kmod-kvdo-6.2.2.117-64.el8.x86_64
vdo-6.2.2.117-13.el8.x86_64
Kernel - 4.18.0-187.el8.x86_64
cockpit-ovirt-dashboard-0.14.1-1.el8ev.noarch0
gluster-ansible-infra-1.0.4-4.el8rhgs.noarch

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

Steps to Reproduce:
-------------------
1. Start with RHHI-V deployment with VDO

Actual results:
---------------
systemd unit file for VDO (/usr/lib/systemd/system/vdo.service) has the following:
---
ExecStartPre=/bin/sh -c "echo 4096 > /sys/kvdo/max_discard_sectors"
---

Expected results:
-----------------
VDO option maxDiscardSize should be used instead

Additional info:
----------------
Following changes are required at gluster-ansible-infra
    change-1: Remove the lines that customizes systemd VDO unit file
    change-2: Update the VDO options set on the newly created VDO volume
    Add the new option - 'maxDiscardSize' in /etc/ansible/roles/gluster.infra/roles/backend_setup/tasks/vdo_create.yml

1. gluster-ansible changes
---------------------------
1. Remove the line from '/etc/ansible/roles/gluster.infra/roles/backend_setup/tasks/main.yml'
<snip>
# When VDO is used, upon creation and activation of thinpools discard is not
# possible, because of the misaligned discard size between thinpool and VDO.
# Warning: kernel: device-mapper: thin: Data device (dm-N) max discard sectors
# smaller than a block: Disabling discard passdown. Is displayed.
# To overcome this, add command in service file to set
# /sys/kvdo/max_discard_sectors to 4096 and restart vdo service

- name: Update vdo service to set /sys/kvdo/max_discard_sectors to 4096
  blockinfile:
     path: /usr/lib/systemd/system/vdo.service
     insertbefore: '^ExecStart='
     marker: "#{mark} ANSIBLE MANAGED BLOCK - DO NOT EDIT THIS LINE"
     block: |
        ExecStartPre=/sbin/modprobe -a uds
        ExecStartPre=/sbin/modprobe -a kvdo
        ExecStartPre=/bin/sh -c "echo 4096 > /sys/kvdo/max_discard_sectors"
  when: gluster_infra_vdo is defined
  tags:
    - vdocreate
</snip>

update required
<snip>
- name: Update vdo service to set /sys/kvdo/max_discard_sectors to 4096
  blockinfile:
     path: /usr/lib/systemd/system/vdo.service
     insertbefore: '^ExecStart='
     marker: "#{mark} ANSIBLE MANAGED BLOCK - DO NOT EDIT THIS LINE"
     block: |
        ExecStartPre=/sbin/modprobe -a uds
        ExecStartPre=/sbin/modprobe -a kvdo
  when: gluster_infra_vdo is defined
  tags:
    - vdocreate
</snip>

2. Update the VDO option 'maxDiscardSize' in /etc/ansible/roles/gluster.infra/roles/backend_setup/tasks/vdo_create.yml

Comment 3 SATHEESARAN 2020-03-20 13:28:39 UTC
I see that the default option 'maxDiscardSize' is not set to 16M in /etc/ansible/roles/gluster.infra/roles/backend_setup/tasks/vdo_create.yml
as mentioned in comment0

Comment 5 SATHEESARAN 2020-04-07 09:31:28 UTC
Tested with gluster-ansible-infra-1.0.4-7.el8

When role was execute, it no longer tries to add changes to vdo systemd unit file,
instead the per VDO volume option 'maxDiscardSize' is set to 16M

Comment 8 errata-xmlrpc 2020-06-16 05:57:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2020:2575


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