Bug 1472189 - Missing discard for the NIST partitions when choosing auto partitioning
Summary: Missing discard for the NIST partitions when choosing auto partitioning
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: rhev-hypervisor-ng
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ovirt-4.1.4-1
: ---
Assignee: Ryan Barry
QA Contact: Qin Yuan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-18 08:56 UTC by Qin Yuan
Modified: 2019-04-28 14:02 UTC (History)
20 users (show)

Fixed In Version: imgbased-0.9.34-0.1.el7ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-10 16:11:24 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
anaconda log for autopart (259.91 KB, application/x-gzip)
2017-07-19 04:03 UTC, Qin Yuan
no flags Details
anaconda log for custom part (257.98 KB, application/x-gzip)
2017-07-19 04:04 UTC, Qin Yuan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1422952 0 unspecified CLOSED [RFE] RHV-H should meet NIST 800-53 partitioning requirements by default 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2017:2464 0 normal SHIPPED_LIVE redhat-virtualization-host bug fix, and enhancement update 2017-08-10 20:11:04 UTC
oVirt gerrit 79673 0 master ABANDONED Add 'discard' to NIST mounts also 2017-07-21 12:45:36 UTC
oVirt gerrit 79678 0 master MERGED Add 'discard' to NIST mounts also 2017-07-21 13:53:18 UTC
oVirt gerrit 79679 0 ovirt-4.1 MERGED Add 'discard' to NIST mounts also 2017-07-21 13:54:29 UTC

Internal Links: 1422952

Description Qin Yuan 2017-07-18 08:56:51 UTC
Description of problem:
With Anaconda 7.4, the NIST partitions will be generated by anaconda when choosing auto partitioning, after installation finished, the mount infos would be like:

/dev/mapper/rhvh_dhcp--10--111-rhvh--4.1--0.20170714.0+1 on / type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-var on /var type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-var_log on /var/log type ext4 (rw,relatime,seclabel,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-tmp on /tmp type ext4 (rw,relatime,seclabel,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-home on /home type ext4 (rw,relatime,seclabel,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-var_log_audit on /var/log/audit type ext4 (rw,relatime,seclabel,stripe=16,data=ordered)

In the mounting parameters, there is no discard for /var/log, /tmp, /home, and /var/log/audit, which are NIST partitions generated by program.


Version-Release number of selected component (if applicable):
redhat-virtualization-host-4.1-20170714.1


How reproducible:
100%


Steps to Reproduce:
1. Install redhat-virtualization-host-4.1-20170714.1 via Anaconda GUI, and choose auto partitioning, finish all needed steps.
2. Reboot and log into RHVH, run 'mount'


Actual results:
1. After step2, there is missing discard for /var/log, /tmp, /home, and /var/log/audit.


Expected results:
1. After step2, there is discard for /var/log, /tmp, /home, and /var/log/audit.


Additional info:
There is discard for the NIST partitions if choosing manual partitioning(clicking '+' to add partitions), the mount infos are like:

/dev/mapper/rhvh_dhcp--10--111-rhvh--4.1--0.20170714.0+1 on / type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-home on /home type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-tmp on /tmp type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-var on /var type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-var--log on /var/log type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)
/dev/mapper/rhvh_dhcp--10--111-var--log--audit on /var/log/audit type ext4 (rw,relatime,seclabel,discard,stripe=16,data=ordered)

Comment 1 Ryan Barry 2017-07-18 09:22:08 UTC
This is a regression from behavior in RHEL 7.3

Since LVM thin provisions are used in RHV-H, this is very important to us.

Comment 4 Radek Vykydal 2017-07-18 14:44:40 UTC
Could you please attach installation logs for both working (custom) and non-working (autopart) case?
/var/log/anaconda/storage.log
/var/log/anaconda/journal.log
Or point to the image to reproduce with.

I think the change in autopartitioning went only to rhv installclass.
https://github.com/rhinstaller/anaconda/commit/1596d0b3e2bb58b723f0d099ab3c072ef87cf306
I am assuming the regression/change is that in 7.3 autopart would create only / and /var having discard, now there are more partitions of which only / and /var have discard.
AFAIK there were no similar changes of autopartitioning in other products so there should be no such regressions.

Comment 5 Radek Vykydal 2017-07-18 14:46:40 UTC
CCing storage experts for hints.

Comment 6 Qin Yuan 2017-07-19 04:03:15 UTC
Created attachment 1300799 [details]
anaconda log for autopart

Comment 7 Qin Yuan 2017-07-19 04:04:24 UTC
Created attachment 1300800 [details]
anaconda log for custom part

Comment 8 Radek Vykydal 2017-07-19 09:42:36 UTC
Anaconda doesn't add discard options to /etc/fstab. It seems to be done by imgbase tool run from kickstart %post embedded by rhv to installer environment, so this tool should be responsible for setting the option and perhaps it should be adapted to the new autopartitioning based on NIST?

I tried 
with http://download-node-02.eng.bos.redhat.com/devel/candidate-trees/RHVH-4.1-20170718.2/compose/RHVH/x86_64/iso/
to create the NIST layout in custom partitioning with the same result as reported for auto - only / and /var had discard set in /etc/fstab of installed sytem.

OTOH from the logs for custom installation in comment #7 - it seems there was only ordinary / partition created, also the version of anaconda (20:47:04,311 INFO anaconda: /sbin/anaconda 21.48.22.93-1 - RHEL 7.3) is different for the auto case in comment #6 (11:14:30,771 INFO anaconda: /sbin/anaconda 21.48.22.121-1 - the latest 7.4)? I wonder how the reporter got the result claimed in Additional info of Description though.

To sum up to me it seems that there is no regression in installer but rhv tools (imgbase) need to be updated to reflect the changes done in rhv autopartitioning in RHEL 7.4 (https://github.com/rhinstaller/anaconda/commit/1596d0b3e2bb58b723f0d099ab3c072ef87cf306), ie to set the discard option for added partitions/mount points.

Comment 9 Qin Yuan 2017-07-19 12:44:58 UTC
(In reply to Radek Vykydal from comment #8)
> Anaconda doesn't add discard options to /etc/fstab. It seems to be done by
> imgbase tool run from kickstart %post embedded by rhv to installer
> environment, so this tool should be responsible for setting the option and
> perhaps it should be adapted to the new autopartitioning based on NIST?
> 
> I tried 
> with
> http://download-node-02.eng.bos.redhat.com/devel/candidate-trees/RHVH-4.1-
> 20170718.2/compose/RHVH/x86_64/iso/
> to create the NIST layout in custom partitioning with the same result as
> reported for auto - only / and /var had discard set in /etc/fstab of
> installed sytem.
> 
> OTOH from the logs for custom installation in comment #7 - it seems there
> was only ordinary / partition created, also the version of anaconda
> (20:47:04,311 INFO anaconda: /sbin/anaconda 21.48.22.93-1 - RHEL 7.3) is
> different for the auto case in comment #6 (11:14:30,771 INFO anaconda:
> /sbin/anaconda 21.48.22.121-1 - the latest 7.4)? I wonder how the reporter
> got the result claimed in Additional info of Description though.
> 

Thanks for pointing out this error. I tried to retest this, the steps and results are:
1. Install RHVH-4.1-20170718.2-RHVH-x86_64-dvd1.iso, choose auto partitioning
2. After installation finished, log into RHVH, check /var/log/anaconda/anaconda.log for the version, it's 21.48.22.121-1
3. Reinstall RHVH-4.1-20170718.2-RHVH-x86_64-dvd1.iso, choose custom partitioning(click '+' to add partitions)
4. After installation finished, log into RHVH, check /var/log/anaconda/anaconda.log for the version, it's 21.48.22.93-1

So, it's wired that the version in /var/log/anaconda/anaconda.log differs according to the partitioning method.


> To sum up to me it seems that there is no regression in installer but rhv
> tools (imgbase) need to be updated to reflect the changes done in rhv
> autopartitioning in RHEL 7.4
> (https://github.com/rhinstaller/anaconda/commit/
> 1596d0b3e2bb58b723f0d099ab3c072ef87cf306), ie to set the discard option for
> added partitions/mount points.

Comment 10 Ryan Barry 2017-07-19 12:57:09 UTC
It should be the same version of anaconda on the ISO either way. I wonder why there are different version number?

Comment 11 Qin Yuan 2017-07-19 13:00:40 UTC
To add one more thing that when using custom partitioning, there won't have related records for the NIST partitions in /etc/fstab. They are mounted via *.mount under /etc/systemd/system/ during boot time.

[root@fctest ~]# ll /etc/systemd/system |grep .mount
-rw-r--r--. 1 root root  132 Jul 19 20:36 home.mount
-rw-r--r--. 1 root root  130 Jul 19 20:36 tmp.mount
-rw-r--r--. 1 root root  150 Jul 19 20:36 var-log-audit.mount
-rw-r--r--. 1 root root  138 Jul 19 20:36 var-log.mount

Comment 12 Radek Vykydal 2017-07-19 14:05:55 UTC
(In reply to Qin Yuan from comment #9)
 
> So, it's wired that the version in /var/log/anaconda/anaconda.log differs
> according to the partitioning method.

Ii is still telling me that, for some mysterious reason, you are doing quite a different installation in your step 3. I wonder if it can be caused by the data on disks from previous installation (step 1.) What if you try step 3. on clean disks?

(In reply to Radek Vykydal from comment #8)
 
> I tried 
> with
> http://download-node-02.eng.bos.redhat.com/devel/candidate-trees/RHVH-4.1-
> 20170718.2/compose/RHVH/x86_64/iso/
> to create the NIST layout in custom partitioning with the same result as
> reported for auto - only / and /var had discard set in /etc/fstab of
> installed sytem.

This is the /etc/fstab:

#
# /etc/fstab
# Created by anaconda on Wed Jul 19 10:48:54 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/rhvh/rhvh-4.1-0.20170714.0+1 / ext4 defaults,discard 1 1
UUID=aa856ef4-8719-4e38-a17b-a0ed2ae26714 /boot                   ext4    defaults        1 2
/dev/mapper/rhvh-home   /home                   ext4    defaults        1 2
/dev/mapper/rhvh-tmp    /tmp                    ext4    defaults        1 2
/dev/mapper/rhvh-var /var ext4 defaults,discard 1 2
/dev/mapper/rhvh-var_log /var/log                ext4    defaults        1 2
/dev/mapper/rhvh-var_log_audit /var/log/audit          ext4    defaults        1 2
/dev/mapper/rhvh-swap   swap                    swap    defaults        0 0

Comment 13 Qin Yuan 2017-07-19 16:23:28 UTC
(In reply to Radek Vykydal from comment #12)
> (In reply to Qin Yuan from comment #9)
>  
> > So, it's wired that the version in /var/log/anaconda/anaconda.log differs
> > according to the partitioning method.
> 
> Ii is still telling me that, for some mysterious reason, you are doing quite
> a different installation in your step 3. I wonder if it can be caused by the
> data on disks from previous installation (step 1.) What if you try step 3.
> on clean disks?
> 

Tried step3 on clean disk, the result is the same, the version is:
20:47:04,311 INFO anaconda: /sbin/anaconda 21.48.22.93-1

The time is always "20:47:04,311", no matter what the real installation time is.

> (In reply to Radek Vykydal from comment #8)
>  
> > I tried 
> > with
> > http://download-node-02.eng.bos.redhat.com/devel/candidate-trees/RHVH-4.1-
> > 20170718.2/compose/RHVH/x86_64/iso/
> > to create the NIST layout in custom partitioning with the same result as
> > reported for auto - only / and /var had discard set in /etc/fstab of
> > installed sytem.
> 
> This is the /etc/fstab:
> 
> #
> # /etc/fstab
> # Created by anaconda on Wed Jul 19 10:48:54 2017
> #
> # Accessible filesystems, by reference, are maintained under '/dev/disk'
> # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
> #
> /dev/rhvh/rhvh-4.1-0.20170714.0+1 / ext4 defaults,discard 1 1
> UUID=aa856ef4-8719-4e38-a17b-a0ed2ae26714 /boot                   ext4   
> defaults        1 2
> /dev/mapper/rhvh-home   /home                   ext4    defaults        1 2
> /dev/mapper/rhvh-tmp    /tmp                    ext4    defaults        1 2
> /dev/mapper/rhvh-var /var ext4 defaults,discard 1 2
> /dev/mapper/rhvh-var_log /var/log                ext4    defaults        1 2
> /dev/mapper/rhvh-var_log_audit /var/log/audit          ext4    defaults     
> 1 2
> /dev/mapper/rhvh-swap   swap                    swap    defaults        0 0

Is this the /etc/fstab for custom partitioning? If so, I guess you might have chosen "click here to create them automatically" on the manual partitioning page, this will have the same effect with auto partitioning. The custom partitioning method I used was clicking "+" at the left bottom corner of manual partitioning page to add /boot, /var, /, and swap manually.

Comment 15 Radek Vykydal 2017-07-20 08:33:40 UTC
(In reply to Qin Yuan from comment #13)
 
> Is this the /etc/fstab for custom partitioning? If so, I guess you might
> have chosen "click here to create them automatically" on the manual
> partitioning page, this will have the same effect with auto partitioning.
> The custom partitioning method I used was clicking "+" at the left bottom
> corner of manual partitioning page to add /boot, /var, /, and swap manually.

Yes, I created the partitions individually using "+"

Comment 16 Qin Yuan 2017-07-20 11:26:39 UTC
(In reply to Radek Vykydal from comment #15)
> (In reply to Qin Yuan from comment #13)
>  
> > Is this the /etc/fstab for custom partitioning? If so, I guess you might
> > have chosen "click here to create them automatically" on the manual
> > partitioning page, this will have the same effect with auto partitioning.
> > The custom partitioning method I used was clicking "+" at the left bottom
> > corner of manual partitioning page to add /boot, /var, /, and swap manually.
> 
> Yes, I created the partitions individually using "+"

Oh, I see, you must have added /var/log, /var/log/audit, /tmp, and /home via "+". I didn't add these partitions, just only added /boot, /var, / and swap via "+". I tried your case, and the /etc/fstab is:

[root@dhcp-10-111 ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Jul 20 18:51:52 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/rhvh_dhcp-10-111/rhvh-4.1-0.20170714.0+1 / ext4 defaults,discard 1 1
UUID=5417af9e-b1b3-4007-9877-6f2395ff037c /boot                   ext4    defaults        1 2
/dev/mapper/rhvh_dhcp--10--111-home /home                   ext4    defaults        1 2
/dev/mapper/rhvh_dhcp--10--111-tmp /tmp                    ext4    defaults        1 2
/dev/mapper/rhvh_dhcp--10--111-var /var ext4 defaults,discard 1 2
/dev/mapper/rhvh_dhcp--10--111-var_log /var/log                ext4    defaults        1 2
/dev/mapper/rhvh_dhcp--10--111-var_log_audit /var/log/audit          ext4    defaults        1 2
/dev/mapper/rhvh_dhcp--10--111-swap swap                    swap    defaults        0 0

You could try my case that only add /boot, /var, /, and swap via "+", then check mount infos after installation finished, the result will be like the one in the Additional info.

Comment 18 Radek Vykydal 2017-07-20 14:30:21 UTC
(In reply to Qin Yuan from comment #16)

> You could try my case that only add /boot, /var, /, and swap via "+", then
> check mount infos after installation finished, the result will be like the
> one in the Additional info.

It is.

Comment 19 Radek Vykydal 2017-07-21 08:24:02 UTC
(In reply to Radek Vykydal from comment #8)

> To sum up to me it seems that there is no regression in installer but rhv
> tools (imgbase) need to be updated to reflect the changes done in rhv
> autopartitioning in RHEL 7.4
> (https://github.com/rhinstaller/anaconda/commit/
> 1596d0b3e2bb58b723f0d099ab3c072ef87cf306), ie to set the discard option for
> added partitions/mount points.

Therefore changing the component.

Comment 23 Qin Yuan 2017-07-26 10:44:58 UTC
Verify Versions:
RHVH-4.1-20170723.1-RHVH-x86_64-dvd1.iso
redhat-virtualization-host-4.1-20170721.0
imgbased-0.9.34-0.1.el7ev.noarch 

Verify Steps and Results:
1. Install RHVH via Anaconda GUI, choose auto partitioning, and finish other needed steps.
2. After installation finished, log into to system, run `cat /etc/fstab' to check the discard option for the NIST partitions:

[root@fctest ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Jul 26 10:06:56 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/rhvh_fctest/rhvh-4.1-0.20170721.0+1 / ext4 defaults 1 1
UUID=0e5dc5d4-2dea-48be-bc63-8dc6a032f69e /boot                   ext4    defaults        1 2
/dev/mapper/rhvh_fctest-home /home ext4 defaults,discard 1 2
/dev/mapper/rhvh_fctest-tmp /tmp ext4 defaults,discard 1 2
/dev/mapper/rhvh_fctest-var /var ext4 defaults,discard 1 2
/dev/mapper/rhvh_fctest-var_log /var/log ext4 defaults,discard 1 2
/dev/mapper/rhvh_fctest-var_log_audit /var/log/audit ext4 defaults,discard 1 2
/dev/mapper/rhvh_fctest-swap swap                    swap    defaults        0 0

There is discard for /home, /tmp, /var/log, and /var/log/audit. But the discard is missing for /, this issue is tracked by Bug 1475111. 

Since the issue described in the bug is solved, change the status to verified.

Comment 25 errata-xmlrpc 2017-08-10 16:11:24 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/RHBA-2017:2464


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