Bug 736457

Summary: linuxrc fails to read CMS config file on a z/VM guest with one CPU
Product: Red Hat Enterprise Linux 6 Reporter: Jan Stodola <jstodola>
Component: anacondaAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 6.1   
Target Milestone: rc   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-13.21.162-1 Doc Type: Bug Fix
Doc Text:
Cause: z/VM guests with only one CPU allocated fail to read the CMS configuration file used by the installation environment. Consequence: Users of z/VM guests with a single CPU must either pass all installation environment configuration values on the kernel boot line -or- supply the information at the interactive prompts as the installation environment boots up. Fix: Detect guests with one CPU and bring the boot device online so the CMS configuration file can be read using cmsfscat. Result: Users of z/VM guests with one CPU can provide a CMSCONF file on the kernel boot line to more easily automate installations.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 12:45:49 UTC Type: ---
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: 691780, 756082, 761078    
Attachments:
Description Flags
boot log from x3270 console
none
proposed patch none

Description Jan Stodola 2011-09-07 17:50:32 UTC
Created attachment 521958 [details]
boot log from x3270 console

Description of problem:
On a z/VM guest with only one CPU, linuxrc fails to read CMS config file at the beginning of the installation:

...
INFO kernel:Initalizing network drop monitor service
WARNING kernel:Freeing unused kernel memory: 256k freed
Could not access DASD 0.0.0191 in time
/init: line 2759: /tmp/e40.conf: No such file or directory
Scanning for available network devices...
Autodetection found 0 devices.
Note: There is a device blacklist active! (Clearing might take long)
c) clear blacklist, m) manual config, r) rescan, s) shell:
s
Enter 'exit' at the shell prompt to get back to the installation dialog. 
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell 
bash-4.1# cat /proc/cio_ignore
0.0.0000-0.0.0008 
0.0.000a-0.0.0190 
0.0.0192-0.0.ffff 
0.1.0000-0.1.ffff 
0.2.0000-0.2.ffff 
0.3.0000-0.3.ffff 
bash-4.1# cat /sys/bus/ccw/devices/0.0.0191/online
0 
bash-4.1# cat /sys/bus/ccw/devices/0.0.0191/status
unknown 
bash-4.1# 


Version-Release number of selected component (if applicable):
RHEL6.2-20110906.n.0
anaconda-13.21.138-1.el6
kernel-2.6.32-193.el6
udev-147-2.37.el6
s390utils-1.8.2-38.el6

How reproducible:
always

Steps to Reproduce:
1. make sure that z/VM guest has only one CPU defined:

q v cpus
00: CPU 00  ID  FF11C5C220978000 (BASE) CP   CPUAFF ON
00: CPU 01  ID  FF11C5C220978000 STOPPED CP   CPUAFF ON

detach cpu 01
00: CPU 01 detached
00: Storage cleared - system reset.
 
CP Q V CPUS
CPU 00  ID  FF11C5C220978000 (BASE) STOPPED CP   CPUAFF ON

2. make sure that CMS parameter file contains boot parameter "cio_ignore=all,!0.0.0009" and variables "CMSDASD" and "CMSCONFFILE" are defined correctly, for example:

root=/dev/ram0 ro ip=off ramdisk_size=40000 cio_ignore=all,!0.0.0009
CMSDASD=191 CMSCONFFILE=e40.conf

3. start the installation
  
Actual results:
Could not access DASD 0.0.0191 in time, CMS config file is not read

Expected results:
linuxrc reads CMS config file

Additional info:
Also reproducible with RHEL6.1 GA
Unable to reproduce without the "cio_ignore=all,!0.0.0009" boot parameter
Unable to reproduce on a z/VM guest with two CPUs

Comment 3 David Cantrell 2012-03-02 21:58:59 UTC
IBM is weird.  This seems to make it work on single cpu or multi cpu guests:

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 288dc12..498c68f 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -50,6 +50,7 @@ elif [ "${0##*/}" = "halt" ]; then
 fi
 
 VERSION=1.2
+NUMCPUS=$(grep processors /proc/cpuinfo | cut -c19-)
 
 export TEXTDOMAIN=s390installer
 export TEXTDOMAINDIR=/usr/lib/locale
@@ -150,7 +151,7 @@ function dasd_settle() {
         return 1
     fi
     local i=1
-    while [ $i -le 30 ] ; do
+    while [ $i -le 60 ] ; do
         local status
         read status < $dasd_status
         case $status in
@@ -225,14 +226,18 @@ function readcmsfile() # $1=dasdport $2=filename
     # precondition: dasd_eckd_mod driver incl. dependencies loaded,
     #               dasd_mod must be loaded without setting any DASD online
     dev=$(canonicalize_devno $1)
-    if ! sysecho /sys/bus/ccw/devices/$dev/online 1; then
-        echo $"DASD $dev could not be set online"
-        return 1
-    fi
-    udevadm settle
-    if ! dasd_settle $dev ; then
-        echo $"Could not access DASD $dev in time"
-        return 1
+    if [ ${NUMCPUS} -eq 1 ]; then
+        echo 1 > /sys/bus/ccw/devices/$dev/online
+    else
+        if ! sysecho /sys/bus/ccw/devices/$dev/online 1; then
+            echo $"DASD $dev could not be set online"
+            return 1
+        fi
+        udevadm settle
+        if ! dasd_settle $dev ; then
+            echo $"Could not access DASD $dev in time"
+            return 1
+        fi
     fi
     udevadm settle
     if ! cmsfscat -d /dev/dasda -a $2 > /tmp/$2; then

Comment 6 Jan Stodola 2012-03-15 16:22:54 UTC
With anaconda-13.21.161-1.el6 and guest with one CPU, I'm getting this:

...
Initalizing network drop monitor service 
Freeing unused kernel memory: 260k freed 
grep: /proc/cpuinfo: No such file or directory 
 
Starting the zSeries initrd to configure networking. Version is 1.2
...
NFO kernel:TCP cubic registered 
INFO kernel:Initializing XFRM netlink socket 
INFO kernel:NET: Registered protocol family 17 
WARNING kernel:registered taskstats version 1 
INFO kernel:Initalizing network drop monitor service 
WARNING kernel:Freeing unused kernel memory: 260k freed 
/init: line 229: Ý: -eq: unary operator expected 
Could not access DASD 0.0.0191 in time 
/init: line 2762: /tmp/r6.conf: No such file or directory 
Scanning for available network devices... 
Autodetection found 0 devices. 
Note: There is a device blacklist active! (Clearing might take long) 
c) clear blacklist, m) manual config, r) rescan, s) shell: 


error/warning messages are also present on a guest with 2 CPUs, but CMS config file is read.
Moving to ASSIGNED

Comment 7 Jan Stodola 2012-03-15 16:23:56 UTC
Created attachment 570343 [details]
proposed patch

Tested on a guests with 1 and 2 CPUs

Comment 9 David Cantrell 2012-04-23 18:20:45 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:
z/VM guests with only one CPU allocated fail to read the CMS configuration file used by the installation environment.

Consequence:
Users of z/VM guests with a single CPU must either pass all installation environment configuration values on the kernel boot line -or- supply the information at the interactive prompts as the installation environment boots up.

Fix:
Detect guests with one CPU and bring the boot device online so the CMS configuration file can be read using cmsfscat.

Result:
Users of z/VM guests with one CPU can provide a CMSCONF file on the kernel boot line to more easily automate installations.

Comment 10 Jan Stodola 2012-04-24 11:22:28 UTC
Tested on RHEL6.3-20120416.0 (Beta), anaconda-13.21.167-1.el6.

No issues while installing on a guest with one or two CPUs, CMS config file was read, anaconda finished successfully.

Moving to VERIFIED.

Comment 12 errata-xmlrpc 2012-06-20 12:45:49 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.

http://rhn.redhat.com/errata/RHBA-2012-0782.html