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 720946

Summary: make the uninstall fail more obviously
Product: Red Hat Enterprise Linux 6 Reporter: Mohua Li <moli>
Component: ovirt-nodeAssignee: Mike Burns <mburns>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: apevec, cshao, gouyang, leiwang, mburns, ovirt-maint, ycui
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-node-2.0.2-0.6.gitcc6ba8c.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 19:17:42 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:
Attachments:
Description Flags
Patch none

Description Mohua Li 2011-07-13 10:19:37 UTC
Description of problem:

in kernel boot command line, user could specify
storage_init=/dev/mapper/* uninstall to uninstall the exist HostVG,
but if there is any fail, like follow storage_init can't find the disk
we should drop to shell, or better, we could provide the command let
the user to manually uninstall the HostVG in emergency shell

in ovirt-early, we just wipe the disk's mbr, if disk could not be
found,we should call  autoinstall_failed  to drop to shell, sth like that,


        wipe_mbr "$init_disk"
        if [ $rc -ne 0 ]; then
           autoinstall_failed
        fi


Version-Release number of selected component (if applicable):
rhev-hypervisor-6.2-0.5

How reproducible:
always

Steps to Reproduce:
1,boot to rhev-hypervisor kernel command line
2,specify invalid disk in "storage_init=$invalidisk uninstall"


  
Actual results:


Expected results:


Additional info:

Comment 5 Mike Burns 2011-07-25 14:58:11 UTC
It's not that simple.

autoinstall_failed is a local function in ovirt-firstboot and isn't available in ovirt-early where this check is.  It can be refactored pretty easily though.

This is actually a bigger issue.  If you specify an invalid disk, that gets handled silently earlier in the process.  When we parse the storage_init parameter, an invalid device gets dropped


ovirt-early runs parse_disk_id from ovirt-boot-functions which has a case statement:

case
...
 /dev/*)
            disk="$(ls -1 "$i" 2>/dev/null | grep -m 1 "$dev")"
 ;;

Comment 6 Alan Pevec 2011-08-09 08:31:34 UTC
(In reply to comment #5)
>  /dev/*)
>             disk="$(ls -1 "$i" 2>/dev/null | grep -m 1 "$dev")"
>  ;;

So in case of invalid storage_init we end up with disk="", we could check for that and bail-out:
diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index fa24720..47864fe 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -364,10 +364,14 @@ start_ovirt_early () {
                     IFS=,
                     init=
                     for d in $hostvgdisks; do
+                        did="$(IFS="$oldIFS" parse_disk_id "$d")"
+                        if [ -z "$did" ]; then
+                            autoinstall_failed
+                        fi
                         if [ -n "$init" ]; then
-                            init="$init${SEP}$(IFS="$oldIFS" parse_disk_id "$d")"
+                            init="$init${SEP}$did"
                         else
-                            init="$(IFS="$oldIFS" parse_disk_id "$d")"
+                            init="$did"
                         fi
                     done
                     IFS="$oldIFS"
@@ -378,10 +382,14 @@ start_ovirt_early () {
                     IFS=,
                     init_app=
                     for d in $appvgdisks; do
+                        did="$(IFS="$oldIFS" parse_disk_id "$d")"
+                        if [ -z "$did" ]; then
+                            autoinstall_failed
+                        fi
                         if [ -n "$init_app" ]; then
-                            init_app="$init_app${SEP}$(IFS="$oldIFS" parse_disk_id "$d")"
+                            init_app="$init_app${SEP}$did"
                         else
-                            init_app="$(IFS="$oldIFS" parse_disk_id "$d")"
+                            init_app="$did"
                         fi
                     done
                     IFS="$oldIFS"

Comment 9 Mike Burns 2011-09-12 18:29:59 UTC
Created attachment 522754 [details]
Patch

Comment 10 Mike Burns 2011-09-12 18:30:45 UTC
Testing: 

specify a device in storage_init that does not exist (/dev/vda on a physical machine seems like a good choice).

Comment 15 errata-xmlrpc 2011-12-06 19:17:42 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-2011-1783.html