Bug 736971 - dracut wiped the disk although didn't match any bus type
Summary: dracut wiped the disk although didn't match any bus type
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ovirt-node
Version: 6.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Mike Burns
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-09 08:09 UTC by Mohua Li
Modified: 2011-12-06 19:27 UTC (History)
7 users (show)

Fixed In Version: ovirt-node-2.0.2-0.5.git83340dd.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 19:27:40 UTC


Attachments (Terms of Use)
console output (65.23 KB, text/plain)
2011-09-09 08:14 UTC, Mohua Li
no flags Details
Patch (1.23 KB, patch)
2011-09-09 19:12 UTC, Mike Burns
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1783 normal SHIPPED_LIVE rhev-hypervisor6 bug fix and enhancement update 2011-12-06 15:10:54 UTC

Description Mohua Li 2011-09-09 08:09:29 UTC
Description of problem:

dracut wiped the disk although the disk didn't match any storage_init bus    
type, installed with the following parameter in a vm with emulated virtio   
disk(installed with wrong bus type cciss)                                   
                                                                             
rootflags=loop  root=live:/rhev-hypervisor.iso rootfstype=auto ro liveimg    
nomodeset check rootflags=ro crashkernel=512M-2G:64M,2G-:128M               
elevator=deadline processor.max_cstate=1 install quiet rd_NO_LVM rhgb       
rd_NO_LUKS rd_NO_MD rd_NO_DM                                                
storage_init=cciss storage_vol=::::: local_boot firstboot                    
console=ttyS0,115200n8                                                      
                                                                             
                                                                             
get the following output,                                                    
                                                                             
                                                                             
    [%G^[%GWiping LVM from device: /dev/vda3^M                               
    Logical volume "Swap" successfully removed^M                             
    Logical volume "Config" successfully removed^M                           
    Logical volume "Logging" successfully removed^M                          
    Logical volume "Data" successfully removed^M                             
    Volume group "HostVG" successfully removed^M                             
    Labels on physical volume "/dev/vda3" successfully wiped^M               
    Wiping LVM from device: ^M                                               
                                                                             
                                                                             
Starting ovirt-firstboot: Device specified in storage_init does not exist^M  
Sep 09 07:24:48 Automatic installation failed. Please review console         
messages.^M                                                                 
Sep 09 07:24:48 Press Enter to drop to emergency shell.^M    

How reproducible:
always with the wrong bus type

Steps to Reproduce:
1.installed rhev-hypervisor on the disk before
2.reinstall again with the above parameter, and wrong bus type
3.
  
Actual results:


Expected results:


Additional info:
this only could reproduce with rhev-hypervisor installed before, could not reproduce on a clean disk,

Comment 1 Mohua Li 2011-09-09 08:10:45 UTC
actually, dracut module ovirt-cleanup.sh didn't consider about the  bus type,
                                                                             
        storage_init="$(getargs storage_init)"                               
        if [ $? -eq 1 ]; then                                                
        storage_init="$(getargs ovirt_init)"                                 
        if [ $? -eq 1 ]; then                                                
        info "storage_init or ovirt_init arguments not found"                
        else                                                                 
        info "Found storage_init:  $storage_init"                            
        fi                                                                   
        fi                                                                   
                                                                             
                                                                             
                                                                             
# Check for HostVG                                                           
        lvm pvscan >/dev/null 2>&1                                           
        for hostvg in $(lvm pvs --noheadings -o vg_name,pv_name 2>/dev/null |
+awk '/^  HostVG/{print $2}'); do                                            
        storage_init="$hostvg,$storage_init"                                 
        info "Found HostVG on $hostvg"                                       
        done

Comment 2 Mohua Li 2011-09-09 08:14:17 UTC
Created attachment 522268 [details]
console output

Comment 4 Alan Pevec 2011-09-09 09:00:49 UTC
Existing HostVG is wiped when only reinstall/uninstall/firstboot is provided, see
bug 733274 comment 4

Comment 5 Mohua Li 2011-09-09 09:10:36 UTC
this mean will wipe the hostvg if reinstall/uninstall/firstboot specify although the hostvg disk not in the storage_init list? if so, we might risk to wipe the wrong disk?

Comment 6 Alan Pevec 2011-09-09 12:45:25 UTC
good point from mburns: wipe HostVG (op.ed. unconditionally) only if storage_init is NOT passed

Comment 8 Mike Burns 2011-09-09 19:12:07 UTC
Created attachment 522388 [details]
Patch

Comment 10 Mohua Li 2011-09-14 06:59:57 UTC
rhev-hypervisor 6.2-0.16.2, specify "storage_init=cciss(wrong bus type) reinstall" this won't wipe the HostVG disk(vda), but only "uninstall" without 
"storage_init" this will wipe the HostVG disk, so it's fixed,

but here we have another problem, we only wipe the lvs, but didn't wipe the root/rootbackup, this will make the rhev-hypervisor still bootable, but fail to load any lv(can't login, no /etc/),  if we also need wipe the boot disk?

Comment 11 Alan Pevec 2011-09-14 08:36:42 UTC
(In reply to comment #10)
> but here we have another problem, we only wipe the lvs, but didn't wipe the
> root/rootbackup, this will make the rhev-hypervisor still bootable, but fail to
> load any lv(can't login, no /etc/),  if we also need wipe the boot disk?

Please open separate BZ for this, but it's not critical since reinstall will work.

Comment 14 errata-xmlrpc 2011-12-06 19:27:40 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


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