Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1191305

Summary: Hot add disk to VM does not refresh "Installation Destination" screen
Product: Red Hat Enterprise Linux 7 Reporter: Bryan Yount <byount>
Component: anacondaAssignee: David Lehman <dlehman>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: glesage, mbanas, mkovarik, tgummels
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-21.48.22.75-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 23:06:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1203710, 1295926, 1313485    
Attachments:
Description Flags
Initial anaconda screen with no system disk present
none
Hot add disk in RHEV
none
After disk attached, nothing is automatically visible
none
After clicking "Refresh" in the "Add disk" screen, a system disk is visible none

Description Bryan Yount 2015-02-11 01:22:56 UTC
Created attachment 990333 [details]
Initial anaconda screen with no system disk present

Description of problem:
A system disk was hot added to a RHEL 7.1 VM in RHEV but the disk did not automatically show up on the "Installation Destination" screen.

Version-Release number of selected component (if applicable):
7.1 beta

How reproducible:
100%

Steps to Reproduce:
1. Create a VM without a system disk
2. While the VM is running and waiting on the anaconda "Installation Destination" screen, hot add a disk to the system.

Actual results:
The disk does not automatically appear

Expected results:
The disk should appear without the user having to initiate a workaround

Additional info:
As a workaround, I got the disk to appear by clicking on the "Add disk" button and then selecting "Refresh" at the bottom right hand corner. Upon returning to the previous screen, the local disk was visible.

Comment 1 Bryan Yount 2015-02-11 01:24:49 UTC
Created attachment 990334 [details]
Hot add disk in RHEV

Comment 2 Bryan Yount 2015-02-11 01:25:38 UTC
Created attachment 990335 [details]
After disk attached, nothing is automatically visible

Comment 3 Bryan Yount 2015-02-11 01:27:00 UTC
Created attachment 990336 [details]
After clicking "Refresh" in the "Add disk" screen, a system disk is visible

Comment 5 Bryan Yount 2015-02-11 01:29:10 UTC
Version-Release number of selected component (if applicable):
  anaconda-19.31.122-1.el7.x86_64.rpm

Comment 6 Brian Lane 2015-02-11 04:13:19 UTC
Disks are scanned at startup, you need to use refresh to pick up any changes.

Comment 7 Bryan Yount 2015-02-13 23:36:42 UTC
Reopening. Then I believe we need to add a "Refresh" button to the main Disk page and not just under "Add disk". This is unintuitive for the user since they will hit refresh on that screen and see nothing appear until they go back one screen.

Comment 8 Travis Gummels 2015-02-20 21:06:29 UTC
I'm in agreement with Bryan, the UI is not intuitive for this use case.  Also disconcerting is not seeing the added disk show up in the Add a disk screen after hitting Refresh List though I can see logically why it doesn't, the interface is intended for specialized and network devices not local. A customer would probably get pretty frustrated adding the disk to the VM, not seeing it appear automatically, deciding to hit the Add a disk, getting to the Add a disk screen then repeatedly hitting Refresh List because there is no indication anything has happened.  It would be greatly appreciated if the UI could be modified to take in to account this use case.

Comment 9 Garrett LeSage 2016-04-14 09:11:48 UTC
In most cases, it is a bad idea to have a refresh button... especially when the computer itself should know something has been changed. This especially holds true when one is trying to handle corner cases, such as in this bug report.

(Aside: One very notable exception is when there's a high price to check concerning data and latency on something that most likely hasn't changed — prime example: a web page. But a web page is one of the very few exceptions.)

Sometimes the best interface is no interface. The new local disk should appear when it is available. That's what's expected, and adding a widget to refresh (which is useless 99% of the time) isn't really the right approach.



## Solution 1: Polling

How intensive is it to refresh local disks? It's probably more involved than checking /proc/partitions, certainly — but does it take any significant time or resources for Anaconda to check the status of locally available drives?

Would it be possible to check the status of local disks every second or few while the "Installation Destination" view is active and refresh the "Local Standard Disks" part of UI if available disks change?



## Solution 2: udev

Better yet: Using a udev rule to run a command when a disk is added (or removed) to tell Anaconda that disks have been refreshed.


Something like one of the following lines in /etc/udev/rules.d/60-anaconda-disk-refresh.rules:

ACTION=="add|remove", KERNEL=="sd[a-z]", RUN+="/usr/bin/something-to-tell-anaconda-the-disks-have-changed"

SUBSYSTEM=="block", ACTION=="change", RUN+="/usr/bin/something-to-tell-anaconda-the-disks-have-changed"


...and it's possible to pass variables to the command or script too, so you can actually specify what exactly changed.

Some pretty decent udev docs: http://reactivated.net/writing_udev_rules.html

Comment 10 David Lehman 2016-06-02 19:17:11 UTC
https://github.com/rhinstaller/anaconda/pull/657

Comment 14 errata-xmlrpc 2016-11-03 23:06:58 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://rhn.redhat.com/errata/RHEA-2016-2158.html